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.

llvm-svn: 201378

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

index d50f9d6..de2f4c6 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 c797b5d..4eea646 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 29af6b2..021b89e 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 b44a84a..f78e217 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: llc < %s | FileCheck %s
+; RUN: llc -generate-arange-section < %s | FileCheck %s
 
 
 ; -- header --
index 85f007d..8acbced 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 cd317a9..2da2938 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