diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-06-22 18:51:35 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-06-22 18:51:35 +0000 |
commit | b150930910a254377a62ed74af981c37eafe8fcb (patch) | |
tree | 4cd287f464c8938f4b059b77fd264065f3173802 /lib/CodeGen/LiveDebugVariables.cpp | |
parent | e024874d22c8f6acc4f54eb6183f70f6681f23ac (diff) |
Don't depend on live ranges being present.
DBG_VALUE instructions could be referring to non-existing virtual
registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159020 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveDebugVariables.cpp')
-rw-r--r-- | lib/CodeGen/LiveDebugVariables.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/CodeGen/LiveDebugVariables.cpp b/lib/CodeGen/LiveDebugVariables.cpp index dd28252e53..c32ce2df78 100644 --- a/lib/CodeGen/LiveDebugVariables.cpp +++ b/lib/CodeGen/LiveDebugVariables.cpp @@ -642,11 +642,16 @@ UserValue::computeIntervals(MachineRegisterInfo &MRI, // Register locations are constrained to where the register value is live. if (TargetRegisterInfo::isVirtualRegister(Loc.getReg())) { - LiveInterval *LI = &LIS.getInterval(Loc.getReg()); - const VNInfo *VNI = LI->getVNInfoAt(Idx); + LiveInterval *LI = 0; + const VNInfo *VNI = 0; + if (LIS.hasInterval(Loc.getReg())) { + LI = &LIS.getInterval(Loc.getReg()); + VNI = LI->getVNInfoAt(Idx); + } SmallVector<SlotIndex, 16> Kills; extendDef(Idx, LocNo, LI, VNI, &Kills, LIS, MDT, UVS); - addDefsFromCopies(LI, LocNo, Kills, Defs, MRI, LIS); + if (LI) + addDefsFromCopies(LI, LocNo, Kills, Defs, MRI, LIS); continue; } |