mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-16 00:38:58 +00:00
lld, llvm-dlltool, llvm-lib: Use getAsString() instead of getSpelling() for printing unknown args
Since OPT_UNKNOWN args never have any values and consist only of spelling (and are never aliased), this doesn't make any difference in practice, but it's more consistent with Arg's guidance to use getAsString() for diagnostics, and it matches what clang does. Also tweak two tests to use an unknown option that contains '=' for additional coverage while here. (The new tests pass fine with the old code too though.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365200 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a71113c59d
commit
67c80aa9b0
@ -108,7 +108,8 @@ int llvm::dlltoolDriverMain(llvm::ArrayRef<const char *> ArgsArr) {
|
||||
}
|
||||
|
||||
for (auto *Arg : Args.filtered(OPT_UNKNOWN))
|
||||
llvm::errs() << "ignoring unknown argument: " << Arg->getSpelling() << "\n";
|
||||
llvm::errs() << "ignoring unknown argument: " << Arg->getAsString(Args)
|
||||
<< "\n";
|
||||
|
||||
if (!Args.hasArg(OPT_d)) {
|
||||
llvm::errs() << "no definition file specified\n";
|
||||
|
@ -163,7 +163,8 @@ int llvm::libDriverMain(ArrayRef<const char *> ArgsArr) {
|
||||
return 1;
|
||||
}
|
||||
for (auto *Arg : Args.filtered(OPT_UNKNOWN))
|
||||
llvm::errs() << "ignoring unknown argument: " << Arg->getSpelling() << "\n";
|
||||
llvm::errs() << "ignoring unknown argument: " << Arg->getAsString(Args)
|
||||
<< "\n";
|
||||
|
||||
// Handle /help
|
||||
if (Args.hasArg(OPT_help)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user