zig/src-self-hosted/ir.zig

113 lines
2.0 KiB
Zig

const Scope = @import("scope.zig").Scope;
pub const Instruction = struct {
id: Id,
scope: &Scope,
pub const Id = enum {
Br,
CondBr,
SwitchBr,
SwitchVar,
SwitchTarget,
Phi,
UnOp,
BinOp,
DeclVar,
LoadPtr,
StorePtr,
FieldPtr,
StructFieldPtr,
UnionFieldPtr,
ElemPtr,
VarPtr,
Call,
Const,
Return,
Cast,
ContainerInitList,
ContainerInitFields,
StructInit,
UnionInit,
Unreachable,
TypeOf,
ToPtrType,
PtrTypeChild,
SetRuntimeSafety,
SetFloatMode,
ArrayType,
SliceType,
Asm,
SizeOf,
TestNonNull,
UnwrapMaybe,
MaybeWrap,
UnionTag,
Clz,
Ctz,
Import,
CImport,
CInclude,
CDefine,
CUndef,
ArrayLen,
Ref,
MinValue,
MaxValue,
CompileErr,
CompileLog,
ErrName,
EmbedFile,
Cmpxchg,
Fence,
Truncate,
IntType,
BoolNot,
Memset,
Memcpy,
Slice,
MemberCount,
MemberType,
MemberName,
Breakpoint,
ReturnAddress,
FrameAddress,
AlignOf,
OverflowOp,
TestErr,
UnwrapErrCode,
UnwrapErrPayload,
ErrWrapCode,
ErrWrapPayload,
FnProto,
TestComptime,
PtrCast,
BitCast,
WidenOrShorten,
IntToPtr,
PtrToInt,
IntToEnum,
IntToErr,
ErrToInt,
CheckSwitchProngs,
CheckStatementIsVoid,
TypeName,
CanImplicitCast,
DeclRef,
Panic,
TagName,
TagType,
FieldParentPtr,
OffsetOf,
TypeId,
SetEvalBranchQuota,
PtrTypeOf,
AlignCast,
OpaqueType,
SetAlignStack,
ArgType,
Export,
};
};