Skip to content

Commit e8a6563

Browse files
authored
Fix-forward 'RegAllocFast: Avoid using temporary DiagnosticInfo #120184' (#120268)
There was a buildbot breakage (https://lab.llvm.org/buildbot/#/builders/24/builds/3329/steps/11/logs/stdio): /home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/test/CodeGen/AMDGPU/ran-out-of-registers-error-all-regs-reserved.ll:9:10: error: CHECK: expected string not found in input ; CHECK: error: <unknown>:0:0: no registers from class available to allocate in function 'no_registers_from_class_available_to_allocate' 2: ==75198==ERROR: AddressSanitizer: stack-use-after-scope on address 0xfa23f9f1c270 at pc 0xb2660dda9340 bp 0xfffffe8ab340 sp 0xfffffe8ab338 caused by #120184, which made a partial fix but also renabled the tests. This patch attempts to fix forward by applying the same fix to the error message highlighted in the buildbot.
1 parent 30916b6 commit e8a6563

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/CodeGen/RegAllocFast.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,10 +1187,9 @@ MCPhysReg RegAllocFastImpl::getErrorAssignment(const LiveReg &LR,
11871187
if (AllocationOrder.empty()) {
11881188
const Function &Fn = MF.getFunction();
11891189
if (EmitError) {
1190-
DiagnosticInfoRegAllocFailure DI(
1190+
Fn.getContext().diagnose(DiagnosticInfoRegAllocFailure(
11911191
"no registers from class available to allocate", Fn,
1192-
MI.getDebugLoc());
1193-
Fn.getContext().diagnose(DI);
1192+
MI.getDebugLoc()));
11941193
}
11951194

11961195
ArrayRef<MCPhysReg> RawRegs = RC.getRegisters();

0 commit comments

Comments
 (0)