summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2018-06-28 22:58:04 +0000
committerDavid Blaikie <dblaikie@gmail.com>2018-06-28 22:58:04 +0000
commitcb7b6af30e89ba585e70b84b3b60e1a7d3d1640e (patch)
tree43787bd52567c1472cb9869552b8909a1599b1fa /clang
parent730c985d56c007b84f7022f7d2cfe6eafe5d3a62 (diff)
downloadbcm5719-llvm-cb7b6af30e89ba585e70b84b3b60e1a7d3d1640e.tar.gz
bcm5719-llvm-cb7b6af30e89ba585e70b84b3b60e1a7d3d1640e.zip
DebugInfo: Add -gno-gnu-pubnames to allow disabling gnu-pubnames later in the command line
llvm-svn: 335938
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/Driver/Options.td1
-rw-r--r--clang/lib/Driver/ToolChains/Clang.cpp3
-rw-r--r--clang/test/Driver/debug-options.c3
3 files changed, 6 insertions, 1 deletions
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 089a9b3649a..a6b5da209e0 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -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"
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 1f08f303452..c5fbd097557 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/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/clang/test/Driver/debug-options.c b/clang/test/Driver/debug-options.c
index ebbf2937608..6d28a7169d9 100644
--- a/clang/test/Driver/debug-options.c
+++ b/clang/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
//
OpenPOWER on IntegriCloud