Skip to content

Commit

Permalink
RegAllocBase: Avoid using temporary DiagnosticInfo (llvm#120046)
Browse files Browse the repository at this point in the history
  • Loading branch information
arsenm authored Dec 16, 2024
1 parent f65a21a commit a3db591
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions llvm/lib/CodeGen/RegAllocBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,9 @@ MCPhysReg RegAllocBase::getErrorAssignment(const TargetRegisterClass &RC,
ArrayRef<MCPhysReg> RawRegs = RC.getRegisters();

if (EmitError) {
DiagnosticInfoRegAllocFailure DI(
Context.diagnose(DiagnosticInfoRegAllocFailure(
"no registers from class available to allocate", Fn,
CtxMI ? CtxMI->getDebugLoc() : DiagnosticLocation());
Context.diagnose(DI);
CtxMI ? CtxMI->getDebugLoc() : DiagnosticLocation()));
}

assert(!RawRegs.empty() && "register classes cannot have no registers");
Expand All @@ -215,10 +214,9 @@ MCPhysReg RegAllocBase::getErrorAssignment(const TargetRegisterClass &RC,
CtxMI->emitInlineAsmError(
"inline assembly requires more registers than available");
} else {
DiagnosticInfoRegAllocFailure DI(
Context.diagnose(DiagnosticInfoRegAllocFailure(
"ran out of registers during register allocation", Fn,
CtxMI ? CtxMI->getDebugLoc() : DiagnosticLocation());
Context.diagnose(DI);
CtxMI ? CtxMI->getDebugLoc() : DiagnosticLocation()));
}
}

Expand Down

0 comments on commit a3db591

Please sign in to comment.