mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
Set the parent pointer of cloned DBG_VALUE instructions correctly.
Fixes PR20523. When spilling variables onto the stack, spillVirtReg() is setting the parent pointer of the cloned DBG_VALUE intrinsic for the stack location to the parent pointer of the original intrinsic. MachineInstr parent pointers should however always point to the parent basic block. MBB is shadowing the MBB member variable. The instruction still ends up being inserted into the right basic block, because it's inserted after MI which serves as the iterator. I failed at constructing a reliable testcase for this, see http://llvm.org/bugs/show_bug.cgi?id=20523 for a large testcases. llvm-svn: 217260
This commit is contained in:
parent
f0d95e1847
commit
6118051e4d
@ -309,10 +309,10 @@ void RAFast::spillVirtReg(MachineBasicBlock::iterator MI,
|
||||
DL = (--EI)->getDebugLoc();
|
||||
} else
|
||||
DL = MI->getDebugLoc();
|
||||
MachineBasicBlock *MBB = DBG->getParent();
|
||||
MachineInstr *NewDV =
|
||||
BuildMI(*MBB, MI, DL, TII->get(TargetOpcode::DBG_VALUE))
|
||||
.addFrameIndex(FI).addImm(Offset).addMetadata(MDPtr);
|
||||
assert(NewDV->getParent() == MBB && "dangling parent pointer");
|
||||
(void)NewDV;
|
||||
DEBUG(dbgs() << "Inserting debug info due to spill:" << "\n" << *NewDV);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user