From: David Blaikie Date: Thu, 28 Jun 2018 22:58:04 +0000 (+0000) Subject: DebugInfo: Add -gno-gnu-pubnames to allow disabling gnu-pubnames later in the command... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5fdc10dc8f915fe3ba480347288af144e7c44f84;p=clang DebugInfo: Add -gno-gnu-pubnames to allow disabling gnu-pubnames later in the command line git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335938 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index 089a9b3649..a6b5da209e 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -1793,6 +1793,7 @@ def gcolumn_info : Flag<["-"], "gcolumn-info">, Group, Flags<[Cor def gno_column_info : Flag<["-"], "gno-column-info">, Group, Flags<[CoreOption]>; def gsplit_dwarf : Flag<["-"], "gsplit-dwarf">, Group; def ggnu_pubnames : Flag<["-"], "ggnu-pubnames">, Group, Flags<[CC1Option]>; +def gno_gnu_pubnames : Flag<["-"], "gno-gnu-pubnames">, Group, Flags<[CC1Option]>; def gdwarf_aranges : Flag<["-"], "gdwarf-aranges">, Group; def gmodules : Flag <["-"], "gmodules">, Group, HelpText<"Generate debug info with external references to clang modules" diff --git a/lib/Driver/ToolChains/Clang.cpp b/lib/Driver/ToolChains/Clang.cpp index 1f08f30345..c5fbd09755 100644 --- a/lib/Driver/ToolChains/Clang.cpp +++ b/lib/Driver/ToolChains/Clang.cpp @@ -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 diff --git a/test/Driver/debug-options.c b/test/Driver/debug-options.c index ebbf293760..6d28a7169d 100644 --- a/test/Driver/debug-options.c +++ b/test/Driver/debug-options.c @@ -134,6 +134,8 @@ // 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 // @@ -222,6 +224,7 @@ // GIGNORE-NOT: "argument unused during compilation" // // GOPT: -ggnu-pubnames +// NOGOPT-NOT: -ggnu-pubnames // // GARANGE: -generate-arange-section //