diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-02-28 13:38:33 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-02-28 13:38:33 -0700 |
| commit | d5100dc81555f0e8197d5f189b1432070e8d72dd (patch) | |
| tree | 96de992b22f7cfc4bcb672892c64fb2cdf621913 /src/Sema.zig | |
| parent | 90bce11f62aa2f246b9bce5bc49069a3faf7ec9a (diff) | |
| download | zig-d5100dc81555f0e8197d5f189b1432070e8d72dd.tar.gz zig-d5100dc81555f0e8197d5f189b1432070e8d72dd.zip | |
stage2: fix frame_address AIR instruction
Various places were assuming different union tags. Now it is
consistently a no-op instruction, just like the similar
instruction ret_addr.
Diffstat (limited to 'src/Sema.zig')
| -rw-r--r-- | src/Sema.zig | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/Sema.zig b/src/Sema.zig index de69cbe5da..ccea8377c8 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -9993,14 +9993,21 @@ fn zirRetAddr( block: *Block, extended: Zir.Inst.Extended.InstData, ) CompileError!Air.Inst.Ref { - const tracy = trace(@src()); - defer tracy.end(); - const src: LazySrcLoc = .{ .node_offset = @bitCast(i32, extended.operand) }; try sema.requireRuntimeBlock(block, src); return try block.addNoOp(.ret_addr); } +fn zirFrameAddress( + sema: *Sema, + block: *Block, + extended: Zir.Inst.Extended.InstData, +) CompileError!Air.Inst.Ref { + const src: LazySrcLoc = .{ .node_offset = @bitCast(i32, extended.operand) }; + try sema.requireRuntimeBlock(block, src); + return try block.addNoOp(.frame_addr); +} + fn zirBuiltinSrc( sema: *Sema, block: *Block, @@ -11889,16 +11896,6 @@ fn zirFrame( return sema.fail(block, src, "TODO: Sema.zirFrame", .{}); } -fn zirFrameAddress( - sema: *Sema, - block: *Block, - extended: Zir.Inst.Extended.InstData, -) CompileError!Air.Inst.Ref { - const src: LazySrcLoc = .{ .node_offset = @bitCast(i32, extended.operand) }; - try sema.requireFunctionBlock(block, src); - return block.addTy(.frame_address, Type.@"usize"); -} - fn zirAlignOf(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air.Inst.Ref { const inst_data = sema.code.instructions.items(.data)[inst].un_node; const operand_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = inst_data.src_node }; |
