[lld] r191070 - Fallback to the default stringize function to show some meaningful error message.
Rui Ueyama
ruiu at google.com
Thu Sep 19 20:32:27 PDT 2013
Author: ruiu
Date: Thu Sep 19 22:32:27 2013
New Revision: 191070
URL: http://llvm.org/viewvc/llvm-project?rev=191070&view=rev
Log:
Fallback to the default stringize function to show some meaningful error message.
GNU LD driver only understood no_such_file_or_directory error and was showing
just "Unknown Error" for any other type of error. With this patch, the driver
now prints file name and error message string by default.
Modified:
lld/trunk/lib/Driver/GnuLdDriver.cpp
Modified: lld/trunk/lib/Driver/GnuLdDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/GnuLdDriver.cpp?rev=191070&r1=191069&r2=191070&view=diff
==============================================================================
--- lld/trunk/lib/Driver/GnuLdDriver.cpp (original)
+++ lld/trunk/lib/Driver/GnuLdDriver.cpp Thu Sep 19 22:32:27 2013
@@ -87,17 +87,12 @@ llvm::ErrorOr<StringRef> ELFFileNode::pa
}
std::string ELFFileNode::errStr(llvm::error_code errc) {
- std::string errorMsg;
if (errc == llvm::errc::no_such_file_or_directory) {
if (_isDashlPrefix)
- errorMsg = (Twine("Unable to find library -l") + _path).str();
- else
- errorMsg = (Twine("Unable to find file ") + _path).str();
+ return (Twine("Unable to find library -l") + _path).str();
+ return (Twine("Unable to find file ") + _path).str();
}
- else {
- return "Unknown Error";
- }
- return std::move(errorMsg);
+ return FileNode::errStr(errc);
}
bool GnuLdDriver::linkELF(int argc, const char *argv[],
More information about the llvm-commits
mailing list