[lld] r311681 - Make empty arguments visible in error messages.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 24 11:34:32 PDT 2017
Author: ruiu
Date: Thu Aug 24 11:34:32 2017
New Revision: 311681
URL: http://llvm.org/viewvc/llvm-project?rev=311681&view=rev
Log:
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
Modified:
lld/trunk/ELF/Driver.cpp
Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=311681&r1=311680&r2=311681&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Thu Aug 24 11:34:32 2017
@@ -283,7 +283,7 @@ static int getInteger(opt::InputArgList
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;
}
More information about the llvm-commits
mailing list