diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2024-03-25 19:02:21 +0000 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2024-03-26 13:48:06 +0000 |
| commit | c6f3e9d79cf849623e6c4f25e02e17cdfab07b7c (patch) | |
| tree | 0efc0142dd23a67509015113b9e1a3aaa2d6c15a /src/codegen.zig | |
| parent | 341857e5cd4fd4453cf9c7d1a6679feb66710d84 (diff) | |
| download | zig-c6f3e9d79cf849623e6c4f25e02e17cdfab07b7c.tar.gz zig-c6f3e9d79cf849623e6c4f25e02e17cdfab07b7c.zip | |
Zcu.Decl: remove `ty` field
`Decl` can no longer store un-interned values, so this field is now
unnecessary. The type can instead be fetched with the new `typeOf`
helper method, which just gets the type of the Decl's `Value`.
Diffstat (limited to 'src/codegen.zig')
| -rw-r--r-- | src/codegen.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/codegen.zig b/src/codegen.zig index 6015270739..5bc0d1a81f 100644 --- a/src/codegen.zig +++ b/src/codegen.zig @@ -829,8 +829,8 @@ fn lowerDeclRef( const target = namespace.file_scope.mod.resolved_target.result; const ptr_width = target.ptrBitWidth(); - const is_fn_body = decl.ty.zigTypeTag(zcu) == .Fn; - if (!is_fn_body and !decl.ty.hasRuntimeBits(zcu)) { + const is_fn_body = decl.typeOf(zcu).zigTypeTag(zcu) == .Fn; + if (!is_fn_body and !decl.typeOf(zcu).hasRuntimeBits(zcu)) { try code.appendNTimes(0xaa, @divExact(ptr_width, 8)); return Result.ok; } @@ -932,7 +932,7 @@ fn genDeclRef( }; const decl = zcu.declPtr(decl_index); - if (!decl.ty.isFnOrHasRuntimeBitsIgnoreComptime(zcu)) { + if (!decl.typeOf(zcu).isFnOrHasRuntimeBitsIgnoreComptime(zcu)) { const imm: u64 = switch (ptr_bytes) { 1 => 0xaa, 2 => 0xaaaa, |
