forked from OSchip/llvm-project
[ELF2] Output of all unknown arguments instead of only one.
Patch from George Rimar! llvm-svn: 248524
This commit is contained in:
parent
9b788a452b
commit
d5b5ab7638
|
@ -58,7 +58,12 @@ opt::InputArgList ArgParser::parse(ArrayRef<const char *> Argv) {
|
|||
error(Twine("missing arg value for \"") + Args.getArgString(MissingIndex) +
|
||||
"\", expected " + Twine(MissingCount) +
|
||||
(MissingCount == 1 ? " argument.\n" : " arguments"));
|
||||
for (auto *Arg : Args.filtered(OPT_UNKNOWN))
|
||||
error(Twine("unknown argument: ") + Arg->getSpelling());
|
||||
|
||||
iterator_range<opt::arg_iterator> Unknowns = Args.filtered(OPT_UNKNOWN);
|
||||
for (auto *Arg : Unknowns)
|
||||
warning("warning: unknown argument: " + Arg->getSpelling());
|
||||
if (Unknowns.begin() != Unknowns.end())
|
||||
error("unknown argument(s) found");
|
||||
|
||||
return Args;
|
||||
}
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
namespace lld {
|
||||
namespace elf2 {
|
||||
|
||||
void warning(const Twine &Msg) { llvm::errs() << Msg << "\n"; }
|
||||
|
||||
void error(const Twine &Msg) {
|
||||
llvm::errs() << Msg << "\n";
|
||||
exit(1);
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
namespace lld {
|
||||
namespace elf2 {
|
||||
|
||||
void warning(const Twine &Msg);
|
||||
|
||||
LLVM_ATTRIBUTE_NORETURN void error(const Twine &Msg);
|
||||
void error(std::error_code EC, const Twine &Prefix);
|
||||
void error(std::error_code EC);
|
||||
|
|
Loading…
Reference in New Issue