[llvm] r225858 - Debug Info: Don't bother emitting DW_AT_frame_base if the function has

Adrian Prantl aprantl at apple.com
Tue Jan 13 16:15:16 PST 2015


Author: adrian
Date: Tue Jan 13 18:15:16 2015
New Revision: 225858

URL: http://llvm.org/viewvc/llvm-project?rev=225858&view=rev
Log:
Debug Info: Don't bother emitting DW_AT_frame_base if the function has
no frame register. "Tested" via an assertion triggered by DwarfExpression.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=225858&r1=225857&r2=225858&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Tue Jan 13 18:15:16 2015
@@ -295,7 +295,8 @@ DIE &DwarfCompileUnit::updateSubprogramS
     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





More information about the llvm-commits mailing list