]> granicus.if.org Git - clang/commitdiff
DebugInfo: Add -gno-gnu-pubnames to allow disabling gnu-pubnames later in the command...
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 28 Jun 2018 22:58:04 +0000 (22:58 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 28 Jun 2018 22:58:04 +0000 (22:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335938 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/Options.td
lib/Driver/ToolChains/Clang.cpp
test/Driver/debug-options.c

index 089a9b3649a21b38c3958be7607f9c443a38fde5..a6b5da209e0cc46a388b21386b07cf24c58cee24 100644 (file)
@@ -1793,6 +1793,7 @@ def gcolumn_info : Flag<["-"], "gcolumn-info">, Group<g_flags_Group>, Flags<[Cor
 def gno_column_info : Flag<["-"], "gno-column-info">, Group<g_flags_Group>, Flags<[CoreOption]>;
 def gsplit_dwarf : Flag<["-"], "gsplit-dwarf">, Group<g_flags_Group>;
 def ggnu_pubnames : Flag<["-"], "ggnu-pubnames">, Group<g_flags_Group>, Flags<[CC1Option]>;
+def gno_gnu_pubnames : Flag<["-"], "gno-gnu-pubnames">, Group<g_flags_Group>, Flags<[CC1Option]>;
 def gdwarf_aranges : Flag<["-"], "gdwarf-aranges">, Group<g_flags_Group>;
 def gmodules : Flag <["-"], "gmodules">, Group<gN_Group>,
   HelpText<"Generate debug info with external references to clang modules"
index 1f08f303452118c49e7e57b3cb0431a94d381443..c5fbd0975575cb8edb4fdf7a3e84bd28a1772c51 100644 (file)
@@ -3046,7 +3046,8 @@ static void RenderDebugOptions(const ToolChain &TC, const Driver &D,
     CmdArgs.push_back("-debug-info-macro");
 
   // -ggnu-pubnames turns on gnu style pubnames in the backend.
-  if (Args.hasArg(options::OPT_ggnu_pubnames))
+  if (Args.hasFlag(options::OPT_ggnu_pubnames, options::OPT_gno_gnu_pubnames,
+                   false))
     CmdArgs.push_back("-ggnu-pubnames");
 
   // -gdwarf-aranges turns on the emission of the aranges section in the
index ebbf2937608fed184a5a81100be49aa3e0becff2..6d28a7169d9994e5bdcd8636880a776c52923d8a 100644 (file)
 // RUN:        | FileCheck -check-prefix=GIGNORE %s
 //
 // RUN: %clang -### -c -ggnu-pubnames %s 2>&1 | FileCheck -check-prefix=GOPT %s
+// RUN: %clang -### -c %s 2>&1 | FileCheck -check-prefix=NOGOPT %s
+// RUN: %clang -### -c -ggnu-pubnames -gno-gnu-pubnames %s 2>&1 | FileCheck -check-prefix=NOGOPT %s
 //
 // RUN: %clang -### -c -gdwarf-aranges %s 2>&1 | FileCheck -check-prefix=GARANGE %s
 //
 // GIGNORE-NOT: "argument unused during compilation"
 //
 // GOPT: -ggnu-pubnames
+// NOGOPT-NOT: -ggnu-pubnames
 //
 // GARANGE: -generate-arange-section
 //