[llvm] r218100 - Omit DW_AT_frame_base under -gmlt for size

David Blaikie dblaikie at gmail.com
Thu Sep 18 21:55:05 PDT 2014


Author: dblaikie
Date: Thu Sep 18 23:55:05 2014
New Revision: 218100

URL: http://llvm.org/viewvc/llvm-project?rev=218100&view=rev
Log:
Omit DW_AT_frame_base under -gmlt for size

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    llvm/trunk/test/DebugInfo/gmlt.ll

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=218100&r1=218099&r2=218100&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Thu Sep 18 23:55:05 2014
@@ -319,9 +319,13 @@ DIE &DwarfDebug::updateSubprogramScopeDI
 
   attachLowHighPC(SPCU, *SPDie, FunctionBeginSym, FunctionEndSym);
 
-  const TargetRegisterInfo *RI = Asm->TM.getSubtargetImpl()->getRegisterInfo();
-  MachineLocation Location(RI->getFrameRegister(*Asm->MF));
-  SPCU.addAddress(*SPDie, dwarf::DW_AT_frame_base, Location);
+  // Only include DW_AT_frame_base in full debug info
+  if (SPCU.getCUNode().getEmissionKind() != DIBuilder::LineTablesOnly) {
+    const TargetRegisterInfo *RI =
+        Asm->TM.getSubtargetImpl()->getRegisterInfo();
+    MachineLocation Location(RI->getFrameRegister(*Asm->MF));
+    SPCU.addAddress(*SPDie, dwarf::DW_AT_frame_base, Location);
+  }
 
   // Add name to the name table, we do this here because we're guaranteed
   // to have concrete versions of our DW_TAG_subprogram nodes.

Modified: llvm/trunk/test/DebugInfo/gmlt.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/gmlt.ll?rev=218100&r1=218099&r2=218100&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/gmlt.ll (original)
+++ llvm/trunk/test/DebugInfo/gmlt.ll Thu Sep 18 23:55:05 2014
@@ -21,8 +21,6 @@
 ; CHECK:   DW_TAG_subprogram
 ; CHECK-NEXT:     DW_AT_low_pc
 ; CHECK-NEXT:     DW_AT_high_pc
-; FIXME: We don't need the DW_AT_frame_base for -gmlt.
-; CHECK-NEXT:     DW_AT_frame_base
 ; CHECK-NEXT:     DW_AT_name
 ; CHECK-NOT: DW_AT
 ; CHECK: {{DW_TAG|NULL}}





More information about the llvm-commits mailing list