diff options
author | Fangrui Song <i@maskray.me> | 2022-11-09 01:39:09 +0300 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2022-11-09 01:39:09 +0300 |
commit | 8c2c62282fca2f3dbfa338427aa97f702e67f86b (patch) | |
tree | fb6d4fbbec933cd0b8edd269096a83843315c69a /flang | |
parent | 1a2bc103bba04e8fba574c70c6201ba18ccc08ba (diff) |
[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 'flang')
-rw-r--r-- | flang/lib/Frontend/CompilerInvocation.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index f2180145af71..043c35296bf3 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -688,7 +688,7 @@ static bool parseFloatingPointArgs(CompilerInvocation &invoc, fpContractMode = LangOptions::FPM_Fast; else { diags.Report(clang::diag::err_drv_unsupported_option_argument) - << a->getOption().getName() << val; + << a->getSpelling() << val; return false; } |