summaryrefslogtreecommitdiff
path: root/tools/bugpoint/ToolRunner.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-02-18 20:21:57 +0000
committerChris Lattner <sabre@nondot.org>2004-02-18 20:21:57 +0000
commit8c56be5e2b860ce5f22ed157c1b02409c353749c (patch)
tree148acae9b800048cb98bb5aa9b39469d0540f3ac /tools/bugpoint/ToolRunner.h
parentf5c8146a7cf899a678dc3979df6a3c99d7f19fc3 (diff)
downloadllvm-8c56be5e2b860ce5f22ed157c1b02409c353749c.tar.gz
llvm-8c56be5e2b860ce5f22ed157c1b02409c353749c.tar.bz2
llvm-8c56be5e2b860ce5f22ed157c1b02409c353749c.tar.xz
When an error occurs executing a tool, we now throw an exception instead
of calling exit(1). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11593 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/ToolRunner.h')
-rw-r--r--tools/bugpoint/ToolRunner.h25
1 files changed, 20 insertions, 5 deletions
diff --git a/tools/bugpoint/ToolRunner.h b/tools/bugpoint/ToolRunner.h
index d5c82f4da4..097fc6aed0 100644
--- a/tools/bugpoint/ToolRunner.h
+++ b/tools/bugpoint/ToolRunner.h
@@ -25,6 +25,19 @@ namespace llvm {
class CBE;
class LLC;
+
+/// ToolExecutionError - An instance of this class is thrown by the
+/// AbstractInterpreter instances if there is an error running a tool (e.g., LLC
+/// crashes) which prevents execution of the program.
+///
+class ToolExecutionError {
+ std::string Message;
+public:
+ ToolExecutionError(const std::string &M) : Message(M) {}
+ const std::string getMessage() const { return Message; }
+};
+
+
//===---------------------------------------------------------------------===//
// GCC abstraction
//
@@ -108,10 +121,11 @@ public:
const std::vector<std::string> &SharedLibs =
std::vector<std::string>());
- // Sometimes we just want to go half-way and only generate the .c file,
- // not necessarily compile it with GCC and run the program.
+ // Sometimes we just want to go half-way and only generate the .c file, not
+ // necessarily compile it with GCC and run the program. This throws an
+ // exception if LLC crashes.
//
- virtual int OutputC(const std::string &Bytecode, std::string &OutputCFile);
+ virtual void OutputC(const std::string &Bytecode, std::string &OutputCFile);
};
@@ -134,9 +148,10 @@ public:
std::vector<std::string>());
// Sometimes we just want to go half-way and only generate the .s file,
- // not necessarily compile it all the way and run the program.
+ // not necessarily compile it all the way and run the program. This throws
+ // an exception if execution of LLC fails.
//
- int OutputAsm(const std::string &Bytecode, std::string &OutputAsmFile);
+ void OutputAsm(const std::string &Bytecode, std::string &OutputAsmFile);
};
} // End llvm namespace