diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2024-08-20 18:41:26 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-20 18:41:26 -0400 |
| commit | 16d74809d44d6bb8db1a32923ef8db43d956e24d (patch) | |
| tree | 78344089f8c4cc2bdc07ea74f0a47b8f500d2fcb /src/Compilation.zig | |
| parent | 0a70455095a19a4c18497e6786ca6139c1cc2892 (diff) | |
| parent | 55864e98e08c9d44ee2ea6fc1f3a3c2a98042310 (diff) | |
| download | zig-16d74809d44d6bb8db1a32923ef8db43d956e24d.tar.gz zig-16d74809d44d6bb8db1a32923ef8db43d956e24d.zip | |
Merge pull request #21140 from jacobly0/self-dwarf
Dwarf: inline calls progress
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 48387e4501..dc7d0ba925 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -2997,14 +2997,26 @@ pub fn saveState(comp: *Compilation) !void { addBuf(&bufs, mem.sliceAsBytes(ip.free_dep_entries.items)); for (ip.locals, pt_headers.items) |*local, pt_header| { - addBuf(&bufs, mem.sliceAsBytes(local.shared.limbs.view().items(.@"0")[0..pt_header.intern_pool.limbs_len])); - addBuf(&bufs, mem.sliceAsBytes(local.shared.extra.view().items(.@"0")[0..pt_header.intern_pool.extra_len])); - addBuf(&bufs, mem.sliceAsBytes(local.shared.items.view().items(.data)[0..pt_header.intern_pool.items_len])); - addBuf(&bufs, mem.sliceAsBytes(local.shared.items.view().items(.tag)[0..pt_header.intern_pool.items_len])); - addBuf(&bufs, local.shared.strings.view().items(.@"0")[0..pt_header.intern_pool.string_bytes_len]); - addBuf(&bufs, mem.sliceAsBytes(local.shared.tracked_insts.view().items(.@"0")[0..pt_header.intern_pool.tracked_insts_len])); - addBuf(&bufs, mem.sliceAsBytes(local.shared.files.view().items(.bin_digest)[0..pt_header.intern_pool.files_len])); - addBuf(&bufs, mem.sliceAsBytes(local.shared.files.view().items(.root_type)[0..pt_header.intern_pool.files_len])); + if (pt_header.intern_pool.limbs_len > 0) { + addBuf(&bufs, mem.sliceAsBytes(local.shared.limbs.view().items(.@"0")[0..pt_header.intern_pool.limbs_len])); + } + if (pt_header.intern_pool.extra_len > 0) { + addBuf(&bufs, mem.sliceAsBytes(local.shared.extra.view().items(.@"0")[0..pt_header.intern_pool.extra_len])); + } + if (pt_header.intern_pool.items_len > 0) { + addBuf(&bufs, mem.sliceAsBytes(local.shared.items.view().items(.data)[0..pt_header.intern_pool.items_len])); + addBuf(&bufs, mem.sliceAsBytes(local.shared.items.view().items(.tag)[0..pt_header.intern_pool.items_len])); + } + if (pt_header.intern_pool.string_bytes_len > 0) { + addBuf(&bufs, local.shared.strings.view().items(.@"0")[0..pt_header.intern_pool.string_bytes_len]); + } + if (pt_header.intern_pool.tracked_insts_len > 0) { + addBuf(&bufs, mem.sliceAsBytes(local.shared.tracked_insts.view().items(.@"0")[0..pt_header.intern_pool.tracked_insts_len])); + } + if (pt_header.intern_pool.files_len > 0) { + addBuf(&bufs, mem.sliceAsBytes(local.shared.files.view().items(.bin_digest)[0..pt_header.intern_pool.files_len])); + addBuf(&bufs, mem.sliceAsBytes(local.shared.files.view().items(.root_type)[0..pt_header.intern_pool.files_len])); + } } //// TODO: compilation errors |
