diff options
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 7 |
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 |