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`.
This commit is contained in:
mlugg
2024-03-25 19:02:21 +00:00
parent 341857e5cd
commit c6f3e9d79c
23 changed files with 120 additions and 123 deletions

View File

@@ -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,