aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2021-09-24 11:15:53 -0700
committerDavid Blaikie <dblaikie@gmail.com>2021-09-24 11:18:10 -0700
commit8ec7d9b8f875368a5f92596332cd05059df6bbd2 (patch)
tree626a3d2874cfcb08494df5f34e95c6f9524f168b /clang/lib/Frontend/CompilerInvocation.cpp
parentac51ad24a75c02152f8ece943d65de9a1c4e947a (diff)
downloadllvm-8ec7d9b8f875368a5f92596332cd05059df6bbd2.zip
llvm-8ec7d9b8f875368a5f92596332cd05059df6bbd2.tar.gz
llvm-8ec7d9b8f875368a5f92596332cd05059df6bbd2.tar.bz2
DebugInfo: Move the '=' version of -gsimple-template-names to the frontend
Based on feedback from Paul Robinson on 38c09ea that the 'mangled' mode is only useful as an LLVM-developer-internal tool in combination with llvm-dwarfdump --verify, so demote that to a frontend-only (not driver) option. The driver support is simply -g{no-,}simple-template-names to switch on simple template names, without the option to use the mangled template name scheme there.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index dc52190..30a80d3 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1415,9 +1415,8 @@ void CompilerInvocation::GenerateCodeGenArgs(
if (TNK != codegenoptions::DebugTemplateNamesKind::Full) {
if (TNK == codegenoptions::DebugTemplateNamesKind::Simple)
GenerateArg(Args, OPT_gsimple_template_names_EQ, "simple", SA);
- if (TNK == codegenoptions::DebugTemplateNamesKind::Mangled)
+ else if (TNK == codegenoptions::DebugTemplateNamesKind::Mangled)
GenerateArg(Args, OPT_gsimple_template_names_EQ, "mangled", SA);
-
}
// ProfileInstrumentUsePath is marshalled automatically, no need to generate
// it or PGOUseInstrumentor.
@@ -1694,6 +1693,10 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args,
? llvm::DICompileUnit::DebugNameTableKind::Default
: llvm::DICompileUnit::DebugNameTableKind::None);
if (const Arg *A = Args.getLastArg(OPT_gsimple_template_names_EQ)) {
+ StringRef Value = A->getValue();
+ if (Value != "simple" && Value != "mangled")
+ Diags.Report(diag::err_drv_unsupported_option_argument)
+ << A->getOption().getName() << A->getValue();
Opts.setDebugSimpleTemplateNames(
StringRef(A->getValue()) == "simple"
? codegenoptions::DebugTemplateNamesKind::Simple