| ... | @@ -109,13 +109,8 @@ frame_locs: std.MultiArrayList(Mir.FrameLoc) = .{}, | ... | @@ -109,13 +109,8 @@ frame_locs: std.MultiArrayList(Mir.FrameLoc) = .{}, |
| 109 | /// Debug field, used to find bugs in the compiler. | 109 | /// Debug field, used to find bugs in the compiler. |
| 110 | air_bookkeeping: @TypeOf(air_bookkeeping_init) = air_bookkeeping_init, | 110 | air_bookkeeping: @TypeOf(air_bookkeeping_init) = air_bookkeeping_init, |
| 111 | | 111 | |
| 112 | /// For mir debug info, maps a mir index to a air index | | |
| 113 | mir_to_air_map: @TypeOf(mir_to_air_map_init) = mir_to_air_map_init, | | |
| 114 | | | |
| 115 | const air_bookkeeping_init = if (std.debug.runtime_safety) @as(usize, 0) else {}; | 112 | const air_bookkeeping_init = if (std.debug.runtime_safety) @as(usize, 0) else {}; |
| 116 | | 113 | |
| 117 | const mir_to_air_map_init = if (builtin.mode == .Debug) std.AutoHashMapUnmanaged(Mir.Inst.Index, Air.Inst.Index){} else {}; | | |
| 118 | | | |
| 119 | const FrameAddr = struct { index: FrameIndex, off: i32 = 0 }; | 114 | const FrameAddr = struct { index: FrameIndex, off: i32 = 0 }; |
| 120 | const RegisterOffset = struct { reg: Register, off: i32 = 0 }; | 115 | const RegisterOffset = struct { reg: Register, off: i32 = 0 }; |
| 121 | const SymbolOffset = struct { sym: u32, off: i32 = 0 }; | 116 | const SymbolOffset = struct { sym: u32, off: i32 = 0 }; |
| ... | @@ -837,7 +832,6 @@ pub fn generate( | ... | @@ -837,7 +832,6 @@ pub fn generate( |
| 837 | function.exitlude_jump_relocs.deinit(gpa); | 832 | function.exitlude_jump_relocs.deinit(gpa); |
| 838 | function.mir_instructions.deinit(gpa); | 833 | function.mir_instructions.deinit(gpa); |
| 839 | function.mir_extra.deinit(gpa); | 834 | function.mir_extra.deinit(gpa); |
| 840 | if (builtin.mode == .Debug) function.mir_to_air_map.deinit(gpa); | | |
| 841 | } | 835 | } |
| 842 | | 836 | |
| 843 | wip_mir_log.debug("{}:", .{function.fmtDecl(func.owner_decl)}); | 837 | wip_mir_log.debug("{}:", .{function.fmtDecl(func.owner_decl)}); |
| ... | @@ -1906,11 +1900,6 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -1906,11 +1900,6 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void { |
| 1906 | const air_tags = self.air.instructions.items(.tag); | 1900 | const air_tags = self.air.instructions.items(.tag); |
| 1907 | | 1901 | |
| 1908 | for (body) |inst| { | 1902 | for (body) |inst| { |
| 1909 | if (builtin.mode == .Debug) { | | |
| 1910 | const mir_inst: Mir.Inst.Index = @intCast(self.mir_instructions.len); | | |
| 1911 | try self.mir_to_air_map.put(self.gpa, mir_inst, inst); | | |
| 1912 | } | | |
| 1913 | | | |
| 1914 | if (self.liveness.isUnused(inst) and !self.air.mustLower(inst, ip)) continue; | 1903 | if (self.liveness.isUnused(inst) and !self.air.mustLower(inst, ip)) continue; |
| 1915 | wip_mir_log.debug("{}", .{self.fmtAir(inst)}); | 1904 | wip_mir_log.debug("{}", .{self.fmtAir(inst)}); |
| 1916 | verbose_tracking_log.debug("{}", .{self.fmtTracking()}); | 1905 | verbose_tracking_log.debug("{}", .{self.fmtTracking()}); |