r200236 - Driver: support -fno-debug-types-section to override -fdebug-types-section

David Blaikie dblaikie at gmail.com
Mon Jan 27 10:52:44 PST 2014


Author: dblaikie
Date: Mon Jan 27 12:52:43 2014
New Revision: 200236

URL: http://llvm.org/viewvc/llvm-project?rev=200236&view=rev
Log:
Driver: support -fno-debug-types-section to override -fdebug-types-section

Modified:
    cfe/trunk/include/clang/Driver/Options.td
    cfe/trunk/lib/Driver/Tools.cpp
    cfe/trunk/test/Driver/debug-options.c

Modified: cfe/trunk/include/clang/Driver/Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=200236&r1=200235&r2=200236&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Mon Jan 27 12:52:43 2014
@@ -873,6 +873,8 @@ def fno_data_sections : Flag <["-"], "fn
   Flags<[CC1Option]>;
 def fdebug_types_section: Flag <["-"], "fdebug-types-section">, Group<f_Group>,
   Flags<[CC1Option]>, HelpText<"Place debug types in their own section (ELF Only)">;
+def fno_debug_types_section: Flag<["-"], "fno-debug-types-section">, Group<f_Group>,
+  Flags<[CC1Option]>;
 def g_Flag : Flag<["-"], "g">, Group<g_Group>,
   HelpText<"Generate source level debug information">, Flags<[CC1Option]>;
 def gline_tables_only : Flag<["-"], "gline-tables-only">, Group<g_Group>,

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=200236&r1=200235&r2=200236&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Mon Jan 27 12:52:43 2014
@@ -2606,7 +2606,8 @@ void Clang::ConstructJob(Compilation &C,
     CmdArgs.push_back("-generate-gnu-dwarf-pub-sections");
   }
 
-  if (Args.hasArg(options::OPT_fdebug_types_section)) {
+  if (Args.hasFlag(options::OPT_fdebug_types_section,
+                   options::OPT_fno_debug_types_section, false)) {
     CmdArgs.push_back("-backend-option");
     CmdArgs.push_back("-generate-type-units");
   }

Modified: cfe/trunk/test/Driver/debug-options.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/debug-options.c?rev=200236&r1=200235&r2=200236&view=diff
==============================================================================
--- cfe/trunk/test/Driver/debug-options.c (original)
+++ cfe/trunk/test/Driver/debug-options.c Mon Jan 27 12:52:43 2014
@@ -53,6 +53,10 @@
 // RUN: %clang -### -fdebug-types-section %s 2>&1 \
 // RUN:        | FileCheck -check-prefix=FDTS %s
 //
+// RUN: %clang -### -fdebug-types-section -fno-debug-types-section %s 2>&1 \
+// RUN:        | FileCheck -check-prefix=NOFDTS %s
+//
+//
 // G: "-cc1"
 // G: "-g"
 //
@@ -94,3 +98,5 @@
 // GOPT: -generate-gnu-dwarf-pub-sections
 //
 // FDTS: "-backend-option" "-generate-type-units"
+//
+// NOFDTS-NOT: "-backend-option" "-generate-type-units"





More information about the cfe-commits mailing list