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 {...@@ -741,7 +741,7 @@ pub const DwarfInfo = struct {
741 fn scanAllFunctions(di: *DwarfInfo, allocator: mem.Allocator) !void {741 fn scanAllFunctions(di: *DwarfInfo, allocator: mem.Allocator) !void {
742 var stream = io.fixedBufferStream(di.section(.debug_info).?);742 var stream = io.fixedBufferStream(di.section(.debug_info).?);
743 const in = stream.reader();743 const in = stream.reader();
744 const seekable = &stream.seekableStream();744 const seekable = stream.seekableStream();
745 var this_unit_offset: u64 = 0;745 var this_unit_offset: u64 = 0;
746746
747 var tmp_arena = std.heap.ArenaAllocator.init(allocator);747 var tmp_arena = std.heap.ArenaAllocator.init(allocator);
...@@ -909,8 +909,8 @@ pub const DwarfInfo = struct {...@@ -909,8 +909,8 @@ pub const DwarfInfo = struct {
909909
910 fn scanAllCompileUnits(di: *DwarfInfo, allocator: mem.Allocator) !void {910 fn scanAllCompileUnits(di: *DwarfInfo, allocator: mem.Allocator) !void {
911 var stream = io.fixedBufferStream(di.section(.debug_info).?);911 var stream = io.fixedBufferStream(di.section(.debug_info).?);
912 const in = &stream.reader();912 const in = stream.reader();
913 const seekable = &stream.seekableStream();913 const seekable = stream.seekableStream();
914 var this_unit_offset: u64 = 0;914 var this_unit_offset: u64 = 0;
915915
916 while (this_unit_offset < try seekable.getEndPos()) {916 while (this_unit_offset < try seekable.getEndPos()) {
...@@ -1175,8 +1175,8 @@ pub const DwarfInfo = struct {...@@ -1175,8 +1175,8 @@ pub const DwarfInfo = struct {
11751175
1176 fn parseAbbrevTable(di: *DwarfInfo, allocator: mem.Allocator, offset: u64) !AbbrevTable {1176 fn parseAbbrevTable(di: *DwarfInfo, allocator: mem.Allocator, offset: u64) !AbbrevTable {
1177 var stream = io.fixedBufferStream(di.section(.debug_abbrev).?);1177 var stream = io.fixedBufferStream(di.section(.debug_abbrev).?);
1178 const in = &stream.reader();1178 const in = stream.reader();
1179 const seekable = &stream.seekableStream();1179 const seekable = stream.seekableStream();
11801180
1181 try seekable.seekTo(offset);1181 try seekable.seekTo(offset);
1182 var result = AbbrevTable.init(allocator);1182 var result = AbbrevTable.init(allocator);
...@@ -1256,8 +1256,8 @@ pub const DwarfInfo = struct {...@@ -1256,8 +1256,8 @@ pub const DwarfInfo = struct {
1256 target_address: u64,1256 target_address: u64,
1257 ) !debug.LineInfo {1257 ) !debug.LineInfo {
1258 var stream = io.fixedBufferStream(di.section(.debug_line).?);1258 var stream = io.fixedBufferStream(di.section(.debug_line).?);
1259 const in = &stream.reader();1259 const in = stream.reader();
1260 const seekable = &stream.seekableStream();1260 const seekable = stream.seekableStream();
12611261
1262 const compile_unit_cwd = try compile_unit.die.getAttrString(di, AT.comp_dir, di.section(.debug_line_str), compile_unit);1262 const compile_unit_cwd = try compile_unit.die.getAttrString(di, AT.comp_dir, di.section(.debug_line_str), compile_unit);
1263 const line_info_offset = try compile_unit.die.getAttrSecOffset(AT.stmt_list);1263 const line_info_offset = try compile_unit.die.getAttrSecOffset(AT.stmt_list);