[lld] r322315 - Improve an error message.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 11 14:11:25 PST 2018
Author: ruiu
Date: Thu Jan 11 14:11:25 2018
New Revision: 322315
URL: http://llvm.org/viewvc/llvm-project?rev=322315&view=rev
Log:
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'
Modified:
lld/trunk/ELF/Driver.cpp
lld/trunk/test/ELF/lto/opt-level.ll
Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=322315&r1=322314&r2=322315&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Thu Jan 11 14:11:25 2018
@@ -584,7 +584,8 @@ static bool getCompressDebugSections(opt
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;
}
Modified: lld/trunk/test/ELF/lto/opt-level.ll
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/lto/opt-level.ll?rev=322315&r1=322314&r2=322315&view=diff
==============================================================================
--- lld/trunk/test/ELF/lto/opt-level.ll (original)
+++ lld/trunk/test/ELF/lto/opt-level.ll Thu Jan 11 14:11:25 2018
@@ -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
More information about the llvm-commits
mailing list