Make empty arguments visible in error messages.

Before this patch, lld printed out something like

  error: -O: number expected, but got

After this patch, it prints out the same error message like this:

  error: -O: number expected, but got ''

Fixes https://bugs.llvm.org/show_bug.cgi?id=34311

llvm-svn: 311681
This commit is contained in:
Rui Ueyama 2017-08-24 18:34:32 +00:00
parent 1b6d8713e4
commit 00cf731ecd
1 changed files with 1 additions and 1 deletions

View File

@ -283,7 +283,7 @@ static int getInteger(opt::InputArgList &Args, unsigned Key, int Default) {
if (auto *Arg = Args.getLastArg(Key)) {
StringRef S = Arg->getValue();
if (!to_integer(S, V, 10))
error(Arg->getSpelling() + ": number expected, but got " + S);
error(Arg->getSpelling() + ": number expected, but got '" + S + "'");
}
return V;
}