summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-10-16 18:21:33 +0000
committerChris Lattner <sabre@nondot.org>2004-10-16 18:21:33 +0000
commitec7c1ab1dafa0fdb383d0e6df4726cecb4c88c70 (patch)
tree4050bba6a75b892bc23a261065c5f1c1afc3a51a /lib/ExecutionEngine
parentbd1d382cc47dfc43ee758714bc22ab5a750bad15 (diff)
Add support for unreachable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17056 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r--lib/ExecutionEngine/Interpreter/Execution.cpp5
-rw-r--r--lib/ExecutionEngine/Interpreter/Interpreter.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp
index 589ac7f99dc..8616656360f 100644
--- a/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/lib/ExecutionEngine/Interpreter/Execution.cpp
@@ -616,6 +616,11 @@ void Interpreter::visitUnwindInst(UnwindInst &I) {
SwitchToNewBasicBlock(cast<InvokeInst>(Inst)->getUnwindDest(), InvokingSF);
}
+void Interpreter::visitUnreachableInst(UnreachableInst &I) {
+ std::cerr << "ERROR: Program executed an 'unreachable' instruction!\n";
+ abort();
+}
+
void Interpreter::visitBranchInst(BranchInst &I) {
ExecutionContext &SF = ECStack.back();
BasicBlock *Dest;
diff --git a/lib/ExecutionEngine/Interpreter/Interpreter.h b/lib/ExecutionEngine/Interpreter/Interpreter.h
index d6e590d7357..e146135cf5f 100644
--- a/lib/ExecutionEngine/Interpreter/Interpreter.h
+++ b/lib/ExecutionEngine/Interpreter/Interpreter.h
@@ -145,6 +145,7 @@ public:
void visitCallInst(CallInst &I) { visitCallSite (CallSite (&I)); }
void visitInvokeInst(InvokeInst &I) { visitCallSite (CallSite (&I)); }
void visitUnwindInst(UnwindInst &I);
+ void visitUnreachableInst(UnreachableInst &I);
void visitShl(ShiftInst &I);
void visitShr(ShiftInst &I);