diff options
author | Chris Lattner <sabre@nondot.org> | 2003-10-14 21:07:25 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-10-14 21:07:25 +0000 |
commit | 1798e4ade88c1fccfc290846f588c1d1261a5299 (patch) | |
tree | 1c1a96f39d07efb7a5ace4b05a7415a29eca6b5b | |
parent | 8deb5814a1e648d80c0d4dc4556ebb0cdfedf147 (diff) | |
download | external_llvm-1798e4ade88c1fccfc290846f588c1d1261a5299.zip external_llvm-1798e4ade88c1fccfc290846f588c1d1261a5299.tar.gz external_llvm-1798e4ade88c1fccfc290846f588c1d1261a5299.tar.bz2 |
Actually return an error if something bad happens, don't just exit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9119 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Support/ToolRunner.cpp | 9 | ||||
-rw-r--r-- | tools/bugpoint/ToolRunner.cpp | 9 |
2 files changed, 8 insertions, 10 deletions
diff --git a/lib/Support/ToolRunner.cpp b/lib/Support/ToolRunner.cpp index 4538bb2..2fa5b39 100644 --- a/lib/Support/ToolRunner.cpp +++ b/lib/Support/ToolRunner.cpp @@ -306,8 +306,7 @@ int GCC::ExecuteProgram(const std::string &ProgramFile, return ProgramResult; } -int GCC::MakeSharedObject(const std::string &InputFile, - FileType fileType, +int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType, std::string &OutputFile) { OutputFile = getUniqueFilename(InputFile+".so"); // Compile the C/asm file into a shared object @@ -327,10 +326,10 @@ int GCC::MakeSharedObject(const std::string &InputFile, }; std::cout << "<gcc>" << std::flush; - if(RunProgramWithTimeout(GCCPath, GCCArgs, "/dev/null", "/dev/null", - "/dev/null")) { + if (RunProgramWithTimeout(GCCPath, GCCArgs, "/dev/null", "/dev/null", + "/dev/null")) { ProcessFailure(GCCArgs); - exit(1); + return 1; } return 0; } diff --git a/tools/bugpoint/ToolRunner.cpp b/tools/bugpoint/ToolRunner.cpp index 4538bb2..2fa5b39 100644 --- a/tools/bugpoint/ToolRunner.cpp +++ b/tools/bugpoint/ToolRunner.cpp @@ -306,8 +306,7 @@ int GCC::ExecuteProgram(const std::string &ProgramFile, return ProgramResult; } -int GCC::MakeSharedObject(const std::string &InputFile, - FileType fileType, +int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType, std::string &OutputFile) { OutputFile = getUniqueFilename(InputFile+".so"); // Compile the C/asm file into a shared object @@ -327,10 +326,10 @@ int GCC::MakeSharedObject(const std::string &InputFile, }; std::cout << "<gcc>" << std::flush; - if(RunProgramWithTimeout(GCCPath, GCCArgs, "/dev/null", "/dev/null", - "/dev/null")) { + if (RunProgramWithTimeout(GCCPath, GCCArgs, "/dev/null", "/dev/null", + "/dev/null")) { ProcessFailure(GCCArgs); - exit(1); + return 1; } return 0; } |