mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-16 12:24:03 +00:00
llvm-readobj: call exit(1) on error.
llvm-readobj exists for testing llvm. We can safely stop the program the first time we know the input in corrupted. This is in preparation for making it handle a few more broken files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242656 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -188,22 +188,19 @@ namespace opts {
|
||||
|
||||
} // namespace opts
|
||||
|
||||
static int ReturnValue = EXIT_SUCCESS;
|
||||
|
||||
static void reportError(Twine Msg) {
|
||||
ReturnValue = EXIT_FAILURE;
|
||||
outs() << Msg << "\n";
|
||||
outs().flush();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
namespace llvm {
|
||||
|
||||
bool error(std::error_code EC) {
|
||||
void error(std::error_code EC) {
|
||||
if (!EC)
|
||||
return false;
|
||||
return;
|
||||
|
||||
reportError(Twine("\nError reading file: ") + EC.message() + ".");
|
||||
return true;
|
||||
}
|
||||
|
||||
bool relocAddressLess(RelocationRef a, RelocationRef b) {
|
||||
@ -408,5 +405,5 @@ int main(int argc, const char *argv[]) {
|
||||
std::for_each(opts::InputFilenames.begin(), opts::InputFilenames.end(),
|
||||
dumpInput);
|
||||
|
||||
return ReturnValue;
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user