[lld] r334024 - Do not show unrelated "-m is missing" error message.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 5 09:13:40 PDT 2018
Author: ruiu
Date: Tue Jun 5 09:13:40 2018
New Revision: 334024
URL: http://llvm.org/viewvc/llvm-project?rev=334024&view=rev
Log:
Do not show unrelated "-m is missing" error message.
Previously, "-m is missing" error message is shown if you pass a
nonexistent file or don't pass any file at all to lld, as shown below:
$ ld.lld nonexistent.o
ld.lld: error: cannot open nonexistent.o: No such file or directory
ld.lld: error: target emulation unknown: -m or at least one .o file required
This patch eliminates the second error message because it's not related
and even inaccurate (you passed a .o file though it didn't exist).
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=334024&r1=334023&r2=334024&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Tue Jun 5 09:13:40 2018
@@ -382,6 +382,9 @@ void LinkerDriver::main(ArrayRef<const c
readConfigs(Args);
initLLVM();
createFiles(Args);
+ if (errorCount())
+ return;
+
inferMachineType();
setConfigs(Args);
checkOptions(Args);
More information about the llvm-commits
mailing list