Omit DW_AT_frame_base under -gmlt for size
authorDavid Blaikie <dblaikie@gmail.com>
Fri, 19 Sep 2014 04:55:05 +0000 (04:55 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 19 Sep 2014 04:55:05 +0000 (04:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218100 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp
test/DebugInfo/gmlt.ll

index 1e5d09b410f771f2107d5e918afd3cfeb06c1f8b..845506fbfb2507afe9c44ea5d73868bdfe67d4df 100644 (file)
@@ -319,9 +319,13 @@ DIE &DwarfDebug::updateSubprogramScopeDIE(DwarfCompileUnit &SPCU,
 
   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.
index 3ace56feae5655765fa6168772586ead27ffc123..9271b2ed9c9ccd7de402ec6d1c05c2d6442ba8c0 100644 (file)
@@ -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}}