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 | 48a1647c93716977049185440cbbdb1a4a903757 (patch) | |
tree | e5f174a708c18f26f43fb6d52a74c4a3624c0b25 /llvm/lib/CodeGen/LiveDebugVariables.cpp | |
parent | 8a833649e5b409344b8dc74da1f506ed7ee35f02 (diff) | |
download | bcm5719-llvm-48a1647c93716977049185440cbbdb1a4a903757.tar.gz bcm5719-llvm-48a1647c93716977049185440cbbdb1a4a903757.zip |
Don't depend on live ranges being present.
DBG_VALUE instructions could be referring to non-existing virtual
registers.
llvm-svn: 159020
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugVariables.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveDebugVariables.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugVariables.cpp b/llvm/lib/CodeGen/LiveDebugVariables.cpp index dd28252e53f..c32ce2df780 100644 --- a/llvm/lib/CodeGen/LiveDebugVariables.cpp +++ b/llvm/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; } |