2017-12-27 00:44:08 +00:00
|
|
|
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,
|
2018-01-25 06:46:12 +00:00
|
|
|
SetRuntimeSafety,
|
2017-12-27 00:44:08 +00:00
|
|
|
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,
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|