diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2017-09-12 21:50:41 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2017-09-12 21:50:41 +0000 |
commit | b52e23669cbd8637819d9ff7777d43cbc3bf8f31 (patch) | |
tree | 50b6f514a58df8209c56928ac50a4fa1bc041c6e /clang | |
parent | e4dacb750da45f4183ae67868d7283a89efe0b40 (diff) | |
download | bcm5719-llvm-b52e23669cbd8637819d9ff7777d43cbc3bf8f31.tar.gz bcm5719-llvm-b52e23669cbd8637819d9ff7777d43cbc3bf8f31.zip |
IR: Represent -ggnu-pubnames with a flag on the DICompileUnit.
This allows the flag to be persisted through to LTO.
Differential Revision: https://reviews.llvm.org/D37655
llvm-svn: 313078
Diffstat (limited to 'clang')
-rw-r--r-- | clang/include/clang/Driver/Options.td | 2 | ||||
-rw-r--r-- | clang/include/clang/Frontend/CodeGenOptions.def | 3 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 3 | ||||
-rw-r--r-- | clang/lib/Driver/ToolChains/Clang.cpp | 6 | ||||
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 1 | ||||
-rw-r--r-- | clang/test/Driver/debug-options.c | 2 |
6 files changed, 10 insertions, 7 deletions
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 4f6cbe5fd41..4b5a9ec25f2 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -1596,7 +1596,7 @@ def gno_strict_dwarf : Flag<["-"], "gno-strict-dwarf">, Group<g_flags_Group>; def gcolumn_info : Flag<["-"], "gcolumn-info">, Group<g_flags_Group>, Flags<[CoreOption]>; 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>; +def ggnu_pubnames : Flag<["-"], "ggnu-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/include/clang/Frontend/CodeGenOptions.def b/clang/include/clang/Frontend/CodeGenOptions.def index b58a5d5725b..ac85c73d0fc 100644 --- a/clang/include/clang/Frontend/CodeGenOptions.def +++ b/clang/include/clang/Frontend/CodeGenOptions.def @@ -287,6 +287,9 @@ CODEGENOPT(DebugInfoForProfiling, 1, 0) /// Whether 3-component vector type is preserved. CODEGENOPT(PreserveVec3Type, 1, 0) +/// Whether to emit .debug_gnu_pubnames section instead of .debug_pubnames. +CODEGENOPT(GnuPubnames, 1, 0) + #undef CODEGENOPT #undef ENUM_CODEGENOPT #undef VALUE_CODEGENOPT diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index f4c84c5c630..a052ffb6173 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -562,7 +562,8 @@ void CGDebugInfo::CreateCompileUnit() { Producer, LO.Optimize || CGOpts.PrepareForLTO || CGOpts.EmitSummaryIndex, CGOpts.DwarfDebugFlags, RuntimeVers, CGOpts.EnableSplitDwarf ? "" : CGOpts.SplitDwarfFile, EmissionKind, - 0 /* DWOid */, CGOpts.SplitDwarfInlining, CGOpts.DebugInfoForProfiling); + 0 /* DWOid */, CGOpts.SplitDwarfInlining, CGOpts.DebugInfoForProfiling, + CGOpts.GnuPubnames); } llvm::DIType *CGDebugInfo::CreateType(const BuiltinType *BT) { diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index 25998627a1b..d69ea4926f7 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -2952,10 +2952,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)) { - CmdArgs.push_back("-backend-option"); - CmdArgs.push_back("-generate-gnu-dwarf-pub-sections"); - } + if (Args.hasArg(options::OPT_ggnu_pubnames)) + CmdArgs.push_back("-ggnu-pubnames"); // -gdwarf-aranges turns on the emission of the aranges section in the // backend. diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index f9dafbb88ea..3321dac8673 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -564,6 +564,7 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, Opts.SampleProfileFile = Args.getLastArgValue(OPT_fprofile_sample_use_EQ); Opts.DebugInfoForProfiling = Args.hasFlag( OPT_fdebug_info_for_profiling, OPT_fno_debug_info_for_profiling, false); + Opts.GnuPubnames = Args.hasArg(OPT_ggnu_pubnames); setPGOInstrumentor(Opts, Args, Diags); Opts.InstrProfileOutput = diff --git a/clang/test/Driver/debug-options.c b/clang/test/Driver/debug-options.c index b4a2e909b3a..9445156f4bc 100644 --- a/clang/test/Driver/debug-options.c +++ b/clang/test/Driver/debug-options.c @@ -219,7 +219,7 @@ // // GIGNORE-NOT: "argument unused during compilation" // -// GOPT: -generate-gnu-dwarf-pub-sections +// GOPT: -ggnu-pubnames // // GARANGE: -generate-arange-section // |