forked from OSchip/llvm-project
Improve error message.
Previously the parser always printed out an error message followed by "Invalid file type" even if the file type is correct. llvm-svn: 210093
This commit is contained in:
parent
9213a6bfa4
commit
eafa806b72
|
@ -1079,9 +1079,9 @@ private:
|
|||
stream.flush();
|
||||
// Print error message if error.
|
||||
if (parseFailed) {
|
||||
llvm::errs() << "Failed to parse '" << directives << "'\n"
|
||||
<< "Reason: " << errorMessage;
|
||||
return make_error_code(llvm::object::object_error::invalid_file_type);
|
||||
auto msg = Twine("Failed to parse '") + directives + "'\n"
|
||||
+ "Reason: " + errorMessage;
|
||||
return make_dynamic_error_code(msg);
|
||||
}
|
||||
if (!errorMessage.empty()) {
|
||||
llvm::errs() << "lld warning: " << errorMessage << "\n";
|
||||
|
|
Loading…
Reference in New Issue