Driver: Add Arg::getAsString and use when dumping arguments to
diagnostics.
- This ensures that the whole argument and values are printed,
instead of just the option name.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67366 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index 2ae8826..2c32401 100644
--- a/lib/Driver/Driver.cpp
+++ b/lib/Driver/Driver.cpp
@@ -75,7 +75,7 @@
Arg *A = getOpts().ParseOneArg(*Args, Index, End);
if (A) {
if (A->getOption().isUnsupported()) {
- Diag(clang::diag::err_drv_unsupported_opt) << A->getOption().getName();
+ Diag(clang::diag::err_drv_unsupported_opt) << A->getAsString(*Args);
continue;
}
@@ -368,10 +368,10 @@
// overwriting the same files.
if (const Arg *A = Args.getLastArg(options::OPT_M_Group))
Diag(clang::diag::err_drv_invalid_opt_with_multiple_archs)
- << A->getOption().getName();
+ << A->getAsString(Args);
if (const Arg *A = Args.getLastArg(options::OPT_save_temps))
Diag(clang::diag::err_drv_invalid_opt_with_multiple_archs)
- << A->getOption().getName();
+ << A->getAsString(Args);
}
ActionList SingleActions;
@@ -534,7 +534,7 @@
// Reject -Z* at the top level, these options should never have been
// exposed by gcc.
if (Arg *A = Args.getLastArg(options::OPT_Z))
- Diag(clang::diag::err_drv_use_of_Z_option) << A->getValue(Args);
+ Diag(clang::diag::err_drv_use_of_Z_option) << A->getAsString(Args);
// Construct the actions to perform.
ActionList LinkerInputs;
@@ -552,7 +552,7 @@
// Claim here to avoid the more general unused warning.
InputArg->claim();
Diag(clang::diag::warn_drv_input_file_unused)
- << InputArg->getValue(Args)
+ << InputArg->getAsString(Args)
<< getPhaseName(InitialPhase)
<< FinalPhaseArg->getOption().getName();
continue;
@@ -699,7 +699,7 @@
// printed.
if (!A->isClaimed())
Diag(clang::diag::warn_drv_unused_argument)
- << A->getOption().getName();
+ << A->getAsString(C.getArgs());
}
}