summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2018-01-11 22:11:25 +0000
committerRui Ueyama <ruiu@google.com>2018-01-11 22:11:25 +0000
commitc43b7e61a2b48ef6aafa0f69970c2c96636fb7ae (patch)
tree958e130169a30293be124470f63720a6ad9e31aa
parentcc9c8b95bdb05c36168e50832ead45a895b0b045 (diff)
downloadbcm5719-llvm-c43b7e61a2b48ef6aafa0f69970c2c96636fb7ae.tar.gz
bcm5719-llvm-c43b7e61a2b48ef6aafa0f69970c2c96636fb7ae.zip
Improve an error message.
Before: $ ld.lld --plugin-opt=Os ld.lld: error: --plugin-opt: number expected, but got 's' After: $ ld.lld --plugin-opt=Os ld.lld: error: --plugin-opt=Os: number expected, but got 's' llvm-svn: 322315
-rw-r--r--lld/ELF/Driver.cpp3
-rw-r--r--lld/test/ELF/lto/opt-level.ll2
2 files changed, 3 insertions, 2 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index 82171ac0da4..d5d11e3d94b 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -584,7 +584,8 @@ static bool getCompressDebugSections(opt::InputArgList &Args) {
static int parseInt(StringRef S, opt::Arg *Arg) {
int V = 0;
if (!to_integer(S, V, 10))
- error(Arg->getSpelling() + ": number expected, but got '" + S + "'");
+ error(Arg->getSpelling() + "=" + Arg->getValue() +
+ ": number expected, but got '" + S + "'");
return V;
}
diff --git a/lld/test/ELF/lto/opt-level.ll b/lld/test/ELF/lto/opt-level.ll
index 57fa3041ac6..b2b56a41097 100644
--- a/lld/test/ELF/lto/opt-level.ll
+++ b/lld/test/ELF/lto/opt-level.ll
@@ -19,7 +19,7 @@
; RUN: FileCheck --check-prefix=INVALID1 %s
; RUN: not ld.lld -o %t3 -m elf_x86_64 -e main --plugin-opt=Ofoo %t.o 2>&1 | \
; RUN: FileCheck --check-prefix=INVALID2 %s
-; INVALID2: --plugin-opt: number expected, but got 'foo'
+; INVALID2: --plugin-opt=Ofoo: number expected, but got 'foo'
; RUN: not ld.lld -o %t3 -m elf_x86_64 -e main --lto-O-1 %t.o 2>&1 | \
; RUN: FileCheck --check-prefix=INVALIDNEGATIVE1 %s
OpenPOWER on IntegriCloud