summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorPaul Robinson <paul.robinson@sony.com>2017-09-29 21:25:07 +0000
committerPaul Robinson <paul.robinson@sony.com>2017-09-29 21:25:07 +0000
commita82808115e03254e70436bf9f7e98e3f82741611 (patch)
treefd4c3f7892be16fce06dff91e3d84f5a11b79022 /clang/lib
parent3e08f66bb0f46d1065671afb6357d9162213606e (diff)
downloadbcm5719-llvm-a82808115e03254e70436bf9f7e98e3f82741611.tar.gz
bcm5719-llvm-a82808115e03254e70436bf9f7e98e3f82741611.zip
[PS4] Tidy up some debug-tuning v. triple decision-making.
llvm-svn: 314558
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Driver/ToolChains/Clang.cpp16
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp2
2 files changed, 11 insertions, 7 deletions
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 90d912511e9..4e1bf51d64d 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -2816,8 +2816,6 @@ static void RenderDebugOptions(const ToolChain &TC, const Driver &D,
ArgStringList &CmdArgs,
codegenoptions::DebugInfoKind &DebugInfoKind,
const Arg *&SplitDWARFArg) {
- bool IsPS4CPU = T.isPS4CPU();
-
if (Args.hasFlag(options::OPT_fdebug_info_for_profiling,
options::OPT_fno_debug_info_for_profiling, false))
CmdArgs.push_back("-fdebug-info-for-profiling");
@@ -2900,13 +2898,14 @@ static void RenderDebugOptions(const ToolChain &TC, const Driver &D,
// And we handle flag -grecord-gcc-switches later with DWARFDebugFlags.
Args.ClaimAllArgs(options::OPT_g_flags_Group);
- // Column info is included by default for everything except PS4 and CodeView.
+ // Column info is included by default for everything except SCE and CodeView.
// Clang doesn't track end columns, just starting columns, which, in theory,
// is fine for CodeView (and PDB). In practice, however, the Microsoft
// debuggers don't handle missing end columns well, so it's better not to
// include any column info.
if (Args.hasFlag(options::OPT_gcolumn_info, options::OPT_gno_column_info,
- /*Default=*/ !IsPS4CPU && !(IsWindowsMSVC && EmitCodeView)))
+ /*Default=*/!(IsWindowsMSVC && EmitCodeView) &&
+ DebuggerTuning != llvm::DebuggerKind::SCE))
CmdArgs.push_back("-dwarf-column-info");
// FIXME: Move backend command line options to the module.
@@ -2957,8 +2956,9 @@ static void RenderDebugOptions(const ToolChain &TC, const Driver &D,
// -gdwarf-aranges turns on the emission of the aranges section in the
// backend.
- // Always enabled on the PS4.
- if (Args.hasArg(options::OPT_gdwarf_aranges) || IsPS4CPU) {
+ // Always enabled for SCE tuning.
+ if (Args.hasArg(options::OPT_gdwarf_aranges) ||
+ DebuggerTuning == llvm::DebuggerKind::SCE) {
CmdArgs.push_back("-backend-option");
CmdArgs.push_back("-generate-arange-section");
}
@@ -2974,6 +2974,10 @@ static void RenderDebugOptions(const ToolChain &TC, const Driver &D,
if (DebuggerTuning == llvm::DebuggerKind::SCE)
CmdArgs.push_back("-debug-forward-template-params");
+ // Do we need to explicitly import anonymous namespaces into the parent scope?
+ if (DebuggerTuning == llvm::DebuggerKind::SCE)
+ CmdArgs.push_back("-dwarf-explicit-import");
+
RenderDebugInfoCompressionArgs(Args, CmdArgs, D);
}
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index e1b14d0c156..37ba39dfd07 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -527,7 +527,7 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
Opts.SplitDwarfFile = Args.getLastArgValue(OPT_split_dwarf_file);
Opts.SplitDwarfInlining = !Args.hasArg(OPT_fno_split_dwarf_inlining);
Opts.DebugTypeExtRefs = Args.hasArg(OPT_dwarf_ext_refs);
- Opts.DebugExplicitImport = Triple.isPS4CPU();
+ Opts.DebugExplicitImport = Args.hasArg(OPT_dwarf_explicit_import);
Opts.DebugFwdTemplateParams = Args.hasArg(OPT_debug_forward_template_params);
for (const auto &Arg : Args.getAllArgValues(OPT_fdebug_prefix_map_EQ))
OpenPOWER on IntegriCloud