aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/spirv.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/spirv.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/spirv.zig')
-rw-r--r--src/codegen/spirv.zig1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/codegen/spirv.zig b/src/codegen/spirv.zig
index 016604e1f6..a4d3ec7f46 100644
--- a/src/codegen/spirv.zig
+++ b/src/codegen/spirv.zig
@@ -818,6 +818,7 @@ pub const DeclGen = struct {
const mod = self.module;
switch (mod.intern_pool.indexToKey(ptr_val.toIntern()).ptr.addr) {
.decl => |decl| return try self.constructDeclRef(ptr_ty, decl),
+ .anon_decl => @panic("TODO"),
.mut_decl => |decl_mut| return try self.constructDeclRef(ptr_ty, decl_mut.decl),
.int => |int| {
const ptr_id = self.spv.allocId();