Disable emission of aranges by default and add a command line
authorEric Christopher <echristo@gmail.com>
Fri, 14 Feb 2014 01:26:55 +0000 (01:26 +0000)
committerEric Christopher <echristo@gmail.com>
Fri, 14 Feb 2014 01:26:55 +0000 (01:26 +0000)
option to enable again that will be matched with a commit to enable
in clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201378 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp
test/DebugInfo/X86/arange.ll
test/DebugInfo/X86/dwarf-aranges-no-dwarf-labels.ll
test/DebugInfo/X86/dwarf-aranges.ll
test/DebugInfo/X86/fission-cu.ll
test/DebugInfo/X86/multiple-aranges.ll

index d50f9d6c7d0a77f0d88b07baad7b8ff9d1d4d3c0..de2f4c6e02aa490b44417a53311a9568f4d54c37 100644 (file)
@@ -67,6 +67,11 @@ GenerateGnuPubSections("generate-gnu-dwarf-pub-sections", cl::Hidden,
                        cl::desc("Generate GNU-style pubnames and pubtypes"),
                        cl::init(false));
 
+static cl::opt<bool> GenerateARangeSection("generate-arange-section",
+                                           cl::Hidden,
+                                           cl::desc("Generate dwarf aranges"),
+                                           cl::init(false));
+
 namespace {
 enum DefaultOnOff { Default, Enable, Disable };
 }
@@ -1154,7 +1159,8 @@ void DwarfDebug::endModule() {
   emitDebugLoc();
 
   // Emit info into a debug aranges section.
-  emitDebugARanges();
+  if (GenerateARangeSection)
+    emitDebugARanges();
 
   // Emit info into a debug ranges section.
   emitDebugRanges();
index c797b5de797065e086f75648c0e66338a1e90a79..4eea646968b42726f18d0af49489ff2ef7cf6d82 100644 (file)
@@ -1,7 +1,7 @@
 ; REQUIRES: object-emission
 
-; RUN: llc -mtriple=x86_64-linux -O0 -filetype=obj < %s | llvm-dwarfdump -debug-dump=aranges - | FileCheck %s
-; RUN: llc -mtriple=x86_64-linux -O0 -filetype=obj < %s | llvm-readobj --relocations - | FileCheck --check-prefix=OBJ %s
+; RUN: llc -mtriple=x86_64-linux -O0 -filetype=obj -generate-arange-section < %s | llvm-dwarfdump -debug-dump=aranges - | FileCheck %s
+; RUN: llc -mtriple=x86_64-linux -O0 -filetype=obj -generate-arange-section < %s | llvm-readobj --relocations - | FileCheck --check-prefix=OBJ %s
 
 ; extern int i;
 ; template<int *x>
index 29af6b215a4240e37376a29c624b8f6abe618bbe..021b89e1e1ca2cc5385bc149ab0abc30c31da19c 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: llc < %s | FileCheck %s
+; RUN: llc -generate-arange-section < %s | FileCheck %s
 
 ; CHECK: .short  2 # DWARF Arange version number
 ; CHECK: # Segment Size
index b44a84a85a92a3e77d1215e211afae609fdc6ac8..f78e2172c428a6e7ed77a564c3f0f2d3ba586090 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: llc < %s | FileCheck %s
+; RUN: llc -generate-arange-section < %s | FileCheck %s
 
 
 ; -- header --
index 85f007d71d4f3b9da7c59952e62a7d004e479f21..8acbced3d3276efbcd88645dbbf06da23583f941 100644 (file)
 ; OBJ-NEXT: R_X86_64_32 .debug_addr
 ; OBJ-NEXT: R_X86_64_32 .debug_str
 ; OBJ-NEXT: }
-; OBJ: .debug_aranges
-; OBJ-NEXT: R_X86_64_32 .debug_info 0x0
 
 !9 = metadata !{i32 1, metadata !"Debug Info Version", i32 1}
index cd317a96f31bfc461abd759dbfecbe7f4140f17e..2da2938742456df3506f99bcadccefd323e537ee 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: llc < %s | FileCheck %s
+; RUN: llc -generate-arange-section < %s | FileCheck %s
 
 ; First CU
 ; CHECK:      .long   44                      # Length of ARange Set