| ... | ... | @@ -1103,11 +1103,7 @@ const FormatAirData = struct { |
| 1103 | 1103 | inst: Air.Inst.Index, |
| 1104 | 1104 | }; |
| 1105 | 1105 | fn formatAir(data: FormatAirData, w: *std.io.Writer) Writer.Error!void { |
| 1106 | | // not acceptable implementation because it ignores `w`: |
| 1107 | | //data.self.air.dumpInst(data.inst, data.self.pt, data.self.liveness); |
| 1108 | | _ = data; |
| 1109 | | _ = w; |
| 1110 | | @panic("TODO: unimplemented"); |
| 1106 | data.self.air.writeInst(w, data.inst, data.self.pt, data.self.liveness); |
| 1111 | 1107 | } |
| 1112 | 1108 | fn fmtAir(self: *CodeGen, inst: Air.Inst.Index) std.fmt.Formatter(FormatAirData, formatAir) { |
| 1113 | 1109 | return .{ .data = .{ .self = self, .inst = inst } }; |
| ... | ... | @@ -179300,10 +179296,13 @@ fn lowerSwitchBr( |
| 179300 | 179296 | } else undefined; |
| 179301 | 179297 | const table_start: u31 = @intCast(cg.mir_table.items.len); |
| 179302 | 179298 | { |
| 179303 | | const condition_index_reg = if (condition_index.isRegister()) |
| 179304 | | condition_index.getReg().? |
| 179305 | | else |
| 179306 | | try cg.copyToTmpRegister(.usize, condition_index); |
| 179299 | const condition_index_reg = condition_index_reg: { |
| 179300 | if (condition_index.isRegister()) { |
| 179301 | const condition_index_reg = condition_index.getReg().?; |
| 179302 | if (condition_index_reg.isClass(.general_purpose)) break :condition_index_reg condition_index_reg; |
| 179303 | } |
| 179304 | break :condition_index_reg try cg.copyToTmpRegister(.usize, condition_index); |
| 179305 | }; |
| 179307 | 179306 | const condition_index_lock = cg.register_manager.lockReg(condition_index_reg); |
| 179308 | 179307 | defer if (condition_index_lock) |lock| cg.register_manager.unlockReg(lock); |
| 179309 | 179308 | try cg.truncateRegister(condition_ty, condition_index_reg); |