aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--flang/lib/Frontend/CompilerInvocation.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp
index 548ca67..f05c4cf 100644
--- a/flang/lib/Frontend/CompilerInvocation.cpp
+++ b/flang/lib/Frontend/CompilerInvocation.cpp
@@ -595,9 +595,15 @@ static bool parseFrontendArgs(FrontendOptions &opts, llvm::opt::ArgList &args,
// -cc1` does accept multiple action options, but will only consider the
// rightmost one.
if (args.hasMultipleArgs(clang::driver::options::OPT_Action_Group)) {
- const unsigned diagID = diags.getCustomDiagID(
- clang::DiagnosticsEngine::Error, "Only one action option is allowed");
- diags.Report(diagID);
+ llvm::SmallString<32> buf;
+ llvm::raw_svector_ostream os(buf);
+ for (const llvm::opt::Arg *arg :
+ args.filtered(clang::driver::options::OPT_Action_Group)) {
+ if (buf.size())
+ os << ", ";
+ os << "'" << arg->getSpelling() << "'";
+ }
+ diags.Report(clang::diag::err_drv_too_many_actions) << buf;
return false;
}