Catch exception and print message as appropriate
authorChris Lattner <sabre@nondot.org>
Wed, 18 Feb 2004 20:22:11 +0000 (20:22 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 18 Feb 2004 20:22:11 +0000 (20:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11594 91177308-0d34-0410-b5e6-96231b3b80d8

tools/bugpoint/bugpoint.cpp

index 779359e73c52d073a59ae65447f4b8fe416918a2..3c89dce525a36ff6b0a74e55d7b39d1bd454ca9d 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "BugDriver.h"
 #include "llvm/Support/PassNameParser.h"
+#include "llvm/Support/ToolRunner.h"
 #include "Support/CommandLine.h"
 #include "Config/unistd.h"
 #include <sys/resource.h>
@@ -52,6 +53,9 @@ int main(int argc, char **argv) {
 
   try {
     return D.run();
+  } catch (ToolExecutionError &TEE) {
+    std::cerr << "Tool execution error: " << TEE.getMessage() << "\n";
+    return 1;
   } catch (...) {
     std::cerr << "Whoops, an exception leaked out of bugpoint.  "
               << "This is a bug in bugpoint!\n";