diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-04-27 18:36:12 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-04-28 16:57:01 -0700 |
| commit | f86469bc5eea2b7bd95222d00a11bd287bfdfedf (patch) | |
| tree | c34ef71820e4c7b962a631f2b9cdecdff3f5aa79 /src/link/MachO/DebugSymbols.zig | |
| parent | fa6bb4b662155e4d6a61cc551b5d02a2a7d5d144 (diff) | |
| download | zig-f86469bc5eea2b7bd95222d00a11bd287bfdfedf.tar.gz zig-f86469bc5eea2b7bd95222d00a11bd287bfdfedf.zip | |
stage2: semaDecl properly analyzes the decl block
Also flattened out Decl TypedValue fields into
ty, val, has_tv
and add relevant fields to Decl for alignment and link section.
Diffstat (limited to 'src/link/MachO/DebugSymbols.zig')
| -rw-r--r-- | src/link/MachO/DebugSymbols.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/link/MachO/DebugSymbols.zig b/src/link/MachO/DebugSymbols.zig index 4c6b71eed4..d399fa98b7 100644 --- a/src/link/MachO/DebugSymbols.zig +++ b/src/link/MachO/DebugSymbols.zig @@ -946,8 +946,8 @@ pub fn initDeclDebugBuffers( var dbg_info_buffer = std.ArrayList(u8).init(allocator); var dbg_info_type_relocs: link.File.DbgInfoTypeRelocsTable = .{}; - const typed_value = decl.typed_value.most_recent.typed_value; - switch (typed_value.ty.zigTypeTag()) { + assert(decl.has_tv); + switch (decl.ty.zigTypeTag()) { .Fn => { // For functions we need to add a prologue to the debug line program. try dbg_line_buffer.ensureCapacity(26); @@ -999,7 +999,7 @@ pub fn initDeclDebugBuffers( const decl_name_with_null = decl.name[0 .. mem.lenZ(decl.name) + 1]; try dbg_info_buffer.ensureCapacity(dbg_info_buffer.items.len + 27 + decl_name_with_null.len); - const fn_ret_type = typed_value.ty.fnReturnType(); + const fn_ret_type = decl.ty.fnReturnType(); const fn_ret_has_bits = fn_ret_type.hasCodeGenBits(); if (fn_ret_has_bits) { dbg_info_buffer.appendAssumeCapacity(abbrev_subprogram); @@ -1058,8 +1058,8 @@ pub fn commitDeclDebugInfo( const symbol = self.base.locals.items[decl.link.macho.local_sym_index]; const text_block = &decl.link.macho; // If the Decl is a function, we need to update the __debug_line program. - const typed_value = decl.typed_value.most_recent.typed_value; - switch (typed_value.ty.zigTypeTag()) { + assert(decl.has_tv); + switch (decl.ty.zigTypeTag()) { .Fn => { // Perform the relocations based on vaddr. { |
