diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-01-12 22:37:49 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-01-12 22:37:49 +0000 |
commit | 1a3534afc4dcab48fe937a0c1aed63da6a492503 (patch) | |
tree | 852dbfc0ce6e40ab0008c99b06f068e5f089e7fc /llvm/lib/CodeGen/LiveDebugVariables.cpp | |
parent | 013c4649c0f365569affbe00dfeb8007db5c8a1d (diff) | |
download | llvm-1a3534afc4dcab48fe937a0c1aed63da6a492503.zip llvm-1a3534afc4dcab48fe937a0c1aed63da6a492503.tar.gz llvm-1a3534afc4dcab48fe937a0c1aed63da6a492503.tar.bz2 |
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
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugVariables.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveDebugVariables.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugVariables.cpp b/llvm/lib/CodeGen/LiveDebugVariables.cpp index 9a67a63..1e2dba2 100644 --- a/llvm/lib/CodeGen/LiveDebugVariables.cpp +++ b/llvm/lib/CodeGen/LiveDebugVariables.cpp @@ -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. |