1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Sometimes, old virtual registers can linger on DBG_VALUE instructions.

Make sure we don't crash in that case, but simply turn them into %noreg instead.

llvm-svn: 123335
This commit is contained in:
Jakob Stoklund Olesen 2011-01-12 22:37:49 +00:00
parent 59d3b89873
commit 7a13190a2e

View File

@ -565,7 +565,8 @@ UserValue::rewriteLocations(VirtRegMap &VRM, const TargetRegisterInfo &TRI) {
!TargetRegisterInfo::isVirtualRegister(Loc.getReg()))
continue;
unsigned VirtReg = Loc.getReg();
if (VRM.isAssignedReg(VirtReg)) {
if (VRM.isAssignedReg(VirtReg) &&
TargetRegisterInfo::isPhysicalRegister(VRM.getPhys(VirtReg))) {
Loc.substPhysReg(VRM.getPhys(VirtReg), TRI);
} else if (VRM.getStackSlot(VirtReg) != VirtRegMap::NO_STACK_SLOT) {
// FIXME: Translate SubIdx to a stackslot offset.