diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2023-05-26 16:04:53 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-06-10 20:47:55 -0700 |
| commit | 9cd0ca9f482ef7f76d3f3ca683913e9aceaa47fe (patch) | |
| tree | 86e9cfb93f1cf8b68aebc83877bef7c24aed47a6 /src/codegen/spirv.zig | |
| parent | d5f0ee0d62e48e623625779a0cf722c3f0f66921 (diff) | |
| download | zig-9cd0ca9f482ef7f76d3f3ca683913e9aceaa47fe.tar.gz zig-9cd0ca9f482ef7f76d3f3ca683913e9aceaa47fe.zip | |
Module: rename functions to make ownership checks explicit
This makes the difference between `decl.getOwnedFunction` and
`decl.val.getFunction` more clear when reading the code.
Diffstat (limited to 'src/codegen/spirv.zig')
| -rw-r--r-- | src/codegen/spirv.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/codegen/spirv.zig b/src/codegen/spirv.zig index 80e98dbcd3..64a0a7ec57 100644 --- a/src/codegen/spirv.zig +++ b/src/codegen/spirv.zig @@ -261,7 +261,7 @@ pub const DeclGen = struct { const entry = try self.decl_link.getOrPut(decl_index); if (!entry.found_existing) { // TODO: Extern fn? - const kind: SpvModule.DeclKind = if (decl.getFunctionIndex(self.module) != .none) + const kind: SpvModule.DeclKind = if (decl.val.getFunctionIndex(self.module) != .none) .func else .global; @@ -1544,7 +1544,7 @@ pub const DeclGen = struct { const decl_id = self.spv.declPtr(spv_decl_index).result_id; log.debug("genDecl: id = {}, index = {}, name = {s}", .{ decl_id.id, @enumToInt(spv_decl_index), decl.name }); - if (decl.getFunction(mod)) |_| { + if (decl.val.getFunction(mod)) |_| { assert(decl.ty.zigTypeTag(mod) == .Fn); const prototype_id = try self.resolveTypeId(decl.ty); try self.func.prologue.emit(self.spv.gpa, .OpFunction, .{ @@ -1597,7 +1597,7 @@ pub const DeclGen = struct { try self.generateTestEntryPoint(fqn, spv_decl_index); } } else { - const init_val = if (decl.getVariable(mod)) |payload| + const init_val = if (decl.val.getVariable(mod)) |payload| payload.init.toValue() else decl.val; |
