From 48a1647c93716977049185440cbbdb1a4a903757 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Fri, 22 Jun 2012 18:51:35 +0000 Subject: Don't depend on live ranges being present. DBG_VALUE instructions could be referring to non-existing virtual registers. llvm-svn: 159020 --- llvm/lib/CodeGen/LiveDebugVariables.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'llvm/lib/CodeGen/LiveDebugVariables.cpp') 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 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; } -- cgit v1.2.3