aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/c.zig
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2023-05-25 19:23:01 -0400
committerAndrew Kelley <andrew@ziglang.org>2023-06-10 20:47:55 -0700
commit70cc68e9994f7dca53904075e15b2b6f87342539 (patch)
treea02b75bcd056c2ce2d9a16a2ec51c4da06e03d9f /src/codegen/c.zig
parent72e4ea38216aab7e7ed05978d04c5d32de44b5ce (diff)
downloadzig-70cc68e9994f7dca53904075e15b2b6f87342539.tar.gz
zig-70cc68e9994f7dca53904075e15b2b6f87342539.zip
Air: remove constant tag
Some uses have been moved to their own tag, the rest use interned. Also, finish porting comptime mutation to be more InternPool aware.
Diffstat (limited to 'src/codegen/c.zig')
-rw-r--r--src/codegen/c.zig5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig
index 76533b4284..f97292e510 100644
--- a/src/codegen/c.zig
+++ b/src/codegen/c.zig
@@ -2890,8 +2890,7 @@ fn genBodyInner(f: *Function, body: []const Air.Inst.Index) error{ AnalysisFail,
const result_value = switch (air_tags[inst]) {
// zig fmt: off
- .constant => unreachable, // excluded from function bodies
- .interned => unreachable, // excluded from function bodies
+ .inferred_alloc, .inferred_alloc_comptime, .interned => unreachable,
.arg => try airArg(f, inst),
@@ -7783,8 +7782,8 @@ fn reap(f: *Function, inst: Air.Inst.Index, operands: []const Air.Inst.Ref) !voi
fn die(f: *Function, inst: Air.Inst.Index, ref: Air.Inst.Ref) !void {
const ref_inst = Air.refToIndex(ref) orelse return;
+ assert(f.air.instructions.items(.tag)[ref_inst] != .interned);
const c_value = (f.value_map.fetchRemove(ref_inst) orelse return).value;
- if (f.air.instructions.items(.tag)[ref_inst] == .constant) return;
const local_index = switch (c_value) {
.local, .new_local => |l| l,
else => return,