aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-09-24 19:22:25 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-10-03 12:12:50 -0700
commitc0b55125443cab63945205b2f7c66bf12cae71e1 (patch)
treec47592afbee6b860b6a611e594ab8e7ed732e621 /src/codegen.zig
parent4df7f7c86a0a105b5d3764121f259a39487a6c8a (diff)
downloadzig-c0b55125443cab63945205b2f7c66bf12cae71e1.tar.gz
zig-c0b55125443cab63945205b2f7c66bf12cae71e1.zip
compiler: start handling anonymous decls differently
Instead of explicitly creating a `Module.Decl` object for each anonymous declaration, each `InternPool.Index` value is implicitly understood to be an anonymous declaration when encountered by backend codegen. The memory management strategy for these anonymous decls then becomes to garbage collect them along with standard InternPool garbage. In the interest of a smooth transition, this commit only implements this new scheme for string literals and leaves all the previous mechanisms in place.
Diffstat (limited to 'src/codegen.zig')
-rw-r--r--src/codegen.zig1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/codegen.zig b/src/codegen.zig
index 738281cf55..ecbc05b1cc 100644
--- a/src/codegen.zig
+++ b/src/codegen.zig
@@ -655,6 +655,7 @@ fn lowerParentPtr(
debug_output,
reloc_info,
),
+ .anon_decl => @panic("TODO"),
.int => |int| try generateSymbol(bin_file, src_loc, .{
.ty = Type.usize,
.val = int.toValue(),