Skip to content

Commit a3db591

Browse files
authored
RegAllocBase: Avoid using temporary DiagnosticInfo (#120046)
1 parent f65a21a commit a3db591

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

llvm/lib/CodeGen/RegAllocBase.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,9 @@ MCPhysReg RegAllocBase::getErrorAssignment(const TargetRegisterClass &RC,
200200
ArrayRef<MCPhysReg> RawRegs = RC.getRegisters();
201201

202202
if (EmitError) {
203-
DiagnosticInfoRegAllocFailure DI(
203+
Context.diagnose(DiagnosticInfoRegAllocFailure(
204204
"no registers from class available to allocate", Fn,
205-
CtxMI ? CtxMI->getDebugLoc() : DiagnosticLocation());
206-
Context.diagnose(DI);
205+
CtxMI ? CtxMI->getDebugLoc() : DiagnosticLocation()));
207206
}
208207

209208
assert(!RawRegs.empty() && "register classes cannot have no registers");
@@ -215,10 +214,9 @@ MCPhysReg RegAllocBase::getErrorAssignment(const TargetRegisterClass &RC,
215214
CtxMI->emitInlineAsmError(
216215
"inline assembly requires more registers than available");
217216
} else {
218-
DiagnosticInfoRegAllocFailure DI(
217+
Context.diagnose(DiagnosticInfoRegAllocFailure(
219218
"ran out of registers during register allocation", Fn,
220-
CtxMI ? CtxMI->getDebugLoc() : DiagnosticLocation());
221-
Context.diagnose(DI);
219+
CtxMI ? CtxMI->getDebugLoc() : DiagnosticLocation()));
222220
}
223221
}
224222

0 commit comments

Comments
 (0)