From 40cb819c6f23cf58416798e3f39136b39a33f8e6 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Sun, 25 Jan 2015 19:04:08 +0000 Subject: Debug info: Fix PR22296 by omitting the DW_AT_location if we lost the physical register that is described in a DBG_VALUE. In the testcase the DBG_VALUE describing "p5" becomes unavailable because the register its address is in is clobbered and we (currently) aren't smart enough to realize that the value is rematerialized immediately after the DBG_VALUE and/or is actually a stack slot. llvm-svn: 227056 --- llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp') diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp index f3d3fb45bb2..7c5c879289b 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp @@ -92,6 +92,9 @@ bool DwarfExpression::AddMachineRegPiece(unsigned MachineReg, unsigned PieceSizeInBits, unsigned PieceOffsetInBits) { const TargetRegisterInfo *TRI = getTRI(); + if (!TRI->isPhysicalRegister(MachineReg)) + return false; + int Reg = TRI->getDwarfRegNum(MachineReg, false); // If this is a valid register number, emit it. -- cgit v1.2.3