]> granicus.if.org Git - clang/commitdiff
Add a command line option -gdwarf-aranges that will turn on emitting
authorEric Christopher <echristo@gmail.com>
Fri, 14 Feb 2014 01:27:03 +0000 (01:27 +0000)
committerEric Christopher <echristo@gmail.com>
Fri, 14 Feb 2014 01:27:03 +0000 (01:27 +0000)
the dwarf .debug_aranges section.

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

include/clang/Driver/CC1Options.td
include/clang/Driver/Options.td
lib/Driver/Tools.cpp
test/Driver/debug-options.c

index c4d04e9e0730a4611dc3069d3d8df383e9436af2..66674ab442e57ba9f4ace50742d61bce01f5fae9 100644 (file)
@@ -138,6 +138,8 @@ def split_dwarf : Flag<["-"], "split-dwarf">,
   HelpText<"Split out the dwarf .dwo sections">;
 def gnu_pubnames : Flag<["-"], "gnu-pubnames">,
   HelpText<"Emit newer GNU style pubnames">;
+def arange_sections : Flag<["-"], "arange_sections">,
+  HelpText<"Emit DWARF .debug_arange sections">;
 def fforbid_guard_variables : Flag<["-"], "fforbid-guard-variables">,
   HelpText<"Emit an error if a C++ static local initializer would need a guard variable">;
 def no_implicit_float : Flag<["-"], "no-implicit-float">,
index ed0fc0315ea8a7700049af42e91e46453ea5cdc2..0877133da1012fed68655ca9f15ce3b700173b5c 100644 (file)
@@ -924,6 +924,7 @@ def gno_strict_dwarf : Flag<["-"], "gno-strict-dwarf">, Group<g_flags_Group>;
 def gcolumn_info : Flag<["-"], "gcolumn-info">, Group<g_flags_Group>;
 def gsplit_dwarf : Flag<["-"], "gsplit-dwarf">, Group<g_flags_Group>;
 def ggnu_pubnames : Flag<["-"], "ggnu-pubnames">, Group<g_flags_Group>;
+def gdwarf_aranges : Flag<["-"], "gdwarf-aranges">, Group<g_flags_Group>;
 def headerpad__max__install__names : Joined<["-"], "headerpad_max_install_names">;
 def help : Flag<["-", "--"], "help">, Flags<[CC1Option]>,
   HelpText<"Display available options">;
index feac80df96a8c4c2115ced8bdd0d392723fb9f2b..083bc48d69ca3fdbaa775e294eeb971bbc7b6fd2 100644 (file)
@@ -2690,6 +2690,13 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
     CmdArgs.push_back("-generate-gnu-dwarf-pub-sections");
   }
 
+  // -gdwarf-aranges turns on the emission of the aranges section in the
+  // backend.
+  if (Args.hasArg(options::OPT_gdwarf_aranges)) {
+    CmdArgs.push_back("-backend-option");
+    CmdArgs.push_back("-generate-arange-section");
+  }
+
   if (Args.hasFlag(options::OPT_fdebug_types_section,
                    options::OPT_fno_debug_types_section, false)) {
     CmdArgs.push_back("-backend-option");
index 8582896ca251df6dc086931b4ff6a1d97f29d696..d18c26878a738cfa46001378d9a533aee2deaf9f 100644 (file)
@@ -50,6 +50,8 @@
 //
 // RUN: %clang -### -c -ggnu-pubnames %s 2>&1 | FileCheck -check-prefix=GOPT %s
 //
+// RUN: %clang -### -c -gdwarf-aranges %s 2>&1 | FileCheck -check-prefix=GARANGE %s
+//
 // RUN: %clang -### -fdebug-types-section %s 2>&1 \
 // RUN:        | FileCheck -check-prefix=FDTS %s
 //
@@ -62,7 +64,7 @@
 //
 // G_DARWIN: "-cc1"
 // G_DARWIN: "-gdwarf-2"
-// 
+//
 // G_D2: "-cc1"
 // G_D2: "-gdwarf-2"
 //
@@ -86,6 +88,8 @@
 //
 // GOPT: -generate-gnu-dwarf-pub-sections
 //
+// GARANGE: -generate-arange-section
+//
 // FDTS: "-backend-option" "-generate-type-units"
 //
 // NOFDTS-NOT: "-backend-option" "-generate-type-units"