authorgravatar for kcbanner@gmail.comCasey Banner <kcbanner@gmail.com> 2023-07-25 00:45:47-04:00
committergravatar for kcbanner@gmail.comCasey Banner <kcbanner@gmail.com> 2023-07-25 00:45:47-04:00
log49fa3a987f0b5309d629072def14ae6c6793d0b1
tree0733d5416e38b9597a5bf293fb894f484b8896d9
parentab2e0b927d5de3fb838a897bb9530ec7955b0bd7

reduce the number of duplicate instantiations due to differing stream parameters


1 files changed, 7 insertions(+), 7 deletions(-)

lib/std/dwarf.zig+7-7
......@@ -741,7 +741,7 @@ pub const DwarfInfo = struct {
741741 fn scanAllFunctions(di: *DwarfInfo, allocator: mem.Allocator) !void {
742742 var stream = io.fixedBufferStream(di.section(.debug_info).?);
743743 const in = stream.reader();
744 const seekable = &stream.seekableStream();
744 const seekable = stream.seekableStream();
745745 var this_unit_offset: u64 = 0;
746746
747747 var tmp_arena = std.heap.ArenaAllocator.init(allocator);
......@@ -909,8 +909,8 @@ pub const DwarfInfo = struct {
909909
910910 fn scanAllCompileUnits(di: *DwarfInfo, allocator: mem.Allocator) !void {
911911 var stream = io.fixedBufferStream(di.section(.debug_info).?);
912 const in = &stream.reader();
913 const seekable = &stream.seekableStream();
912 const in = stream.reader();
913 const seekable = stream.seekableStream();
914914 var this_unit_offset: u64 = 0;
915915
916916 while (this_unit_offset < try seekable.getEndPos()) {
......@@ -1175,8 +1175,8 @@ pub const DwarfInfo = struct {
11751175
11761176 fn parseAbbrevTable(di: *DwarfInfo, allocator: mem.Allocator, offset: u64) !AbbrevTable {
11771177 var stream = io.fixedBufferStream(di.section(.debug_abbrev).?);
1178 const in = &stream.reader();
1179 const seekable = &stream.seekableStream();
1178 const in = stream.reader();
1179 const seekable = stream.seekableStream();
11801180
11811181 try seekable.seekTo(offset);
11821182 var result = AbbrevTable.init(allocator);
......@@ -1256,8 +1256,8 @@ pub const DwarfInfo = struct {
12561256 target_address: u64,
12571257 ) !debug.LineInfo {
12581258 var stream = io.fixedBufferStream(di.section(.debug_line).?);
1259 const in = &stream.reader();
1260 const seekable = &stream.seekableStream();
1259 const in = stream.reader();
1260 const seekable = stream.seekableStream();
12611261
12621262 const compile_unit_cwd = try compile_unit.die.getAttrString(di, AT.comp_dir, di.section(.debug_line_str), compile_unit);
12631263 const line_info_offset = try compile_unit.die.getAttrSecOffset(AT.stmt_list);