spirv: anon decl refs

This commit is contained in:
Robin Voetter
2023-10-07 14:21:59 +02:00
parent 08ea9a9ff6
commit ab701c3d37
3 changed files with 163 additions and 5 deletions

View File

@@ -3050,6 +3050,7 @@ pub const Object = struct {
decl_val: InternPool.Index,
llvm_addr_space: Builder.AddrSpace,
) Error!Builder.Variable.Index {
// TODO: Add address space to the anon_decl_map
const gop = try o.anon_decl_map.getOrPut(o.gpa, decl_val);
if (gop.found_existing) return gop.value_ptr.ptr(&o.builder).kind.variable;
errdefer assert(o.anon_decl_map.remove(decl_val));