aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2022-11-08 14:39:09 -0800
committerFangrui Song <i@maskray.me>2022-11-08 14:39:09 -0800
commit8c2c62282fca2f3dbfa338427aa97f702e67f86b (patch)
treefb6d4fbbec933cd0b8edd269096a83843315c69a /clang/lib/Frontend/CompilerInvocation.cpp
parent1a2bc103bba04e8fba574c70c6201ba18ccc08ba (diff)
downloadllvm-8c2c62282fca2f3dbfa338427aa97f702e67f86b.zip
llvm-8c2c62282fca2f3dbfa338427aa97f702e67f86b.tar.gz
llvm-8c2c62282fca2f3dbfa338427aa97f702e67f86b.tar.bz2
[Driver] Refactor err_drv_unsupported_option_argument call sites to use llvm::opt::Arg::getSpelling
For `-foo=bar`, getSpelling return `-foo=` which is exactly what we need from the diagnostic. Drop `-` from the err_drv_unsupported_option_argument template. This change makes `--` long option diagnostics more convenient. Reviewed By: lenary Differential Revision: https://reviews.llvm.org/D137659
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index b004c6c..088e83b 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1711,7 +1711,7 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args,
StringRef Value = A->getValue();
if (Value != "simple" && Value != "mangled")
Diags.Report(diag::err_drv_unsupported_option_argument)
- << A->getOption().getName() << A->getValue();
+ << A->getSpelling() << A->getValue();
Opts.setDebugSimpleTemplateNames(
StringRef(A->getValue()) == "simple"
? codegenoptions::DebugTemplateNamesKind::Simple