From bb7e1f3687e71ddeb4dc1c7a9a1beec027c6fd5e Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Wed, 14 Jan 2015 00:15:16 +0000 Subject: [PATCH] Debug Info: Don't bother emitting DW_AT_frame_base if the function has no frame register. "Tested" via an assertion triggered by DwarfExpression. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225858 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 6901d2290e..fe01980c81 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -295,7 +295,8 @@ DIE &DwarfCompileUnit::updateSubprogramScopeDIE(DISubprogram SP) { const TargetRegisterInfo *RI = Asm->TM.getSubtargetImpl()->getRegisterInfo(); MachineLocation Location(RI->getFrameRegister(*Asm->MF)); - addAddress(*SPDie, dwarf::DW_AT_frame_base, Location); + if (RI->isPhysicalRegister(Location.getReg())) + addAddress(*SPDie, dwarf::DW_AT_frame_base, Location); } // Add name to the name table, we do this here because we're guaranteed -- 2.39.2