diff options
Diffstat (limited to 'src/Module.zig')
| -rw-r--r-- | src/Module.zig | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/Module.zig b/src/Module.zig index 0a082313b3..4bd48dad05 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -1226,6 +1226,17 @@ pub const Scope = struct { return block.src_decl.namespace.file_scope; } + pub fn addTy( + block: *Block, + tag: Air.Inst.Tag, + ty: Type, + ) error{OutOfMemory}!Air.Inst.Ref { + return block.addInst(.{ + .tag = tag, + .data = .{ .ty = ty }, + }); + } + pub fn addTyOp( block: *Block, tag: Air.Inst.Tag, @@ -1241,6 +1252,13 @@ pub const Scope = struct { }); } + pub fn addNoOp(block: *Block, tag: Air.Inst.Tag) error{OutOfMemory}!Air.Inst.Ref { + return block.addInst(.{ + .tag = tag, + .data = .no_op, + }); + } + pub fn addUnOp( block: *Block, tag: Air.Inst.Tag, @@ -1252,6 +1270,20 @@ pub const Scope = struct { }); } + pub fn addBr( + block: *Block, + target_block: Air.Inst.Index, + operand: Air.Inst.Ref, + ) error{OutOfMemory}!Air.Inst.Ref { + return block.addInst(.{ + .tag = .br, + .data = .{ .br = .{ + .block_inst = target_block, + .operand = operand, + } }, + }); + } + pub fn addBinOp( block: *Block, tag: Air.Inst.Tag, |
