diff options
author | Chris Lattner <sabre@nondot.org> | 2004-10-16 18:21:33 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-10-16 18:21:33 +0000 |
commit | 98e541457bbe04c22364ff82ef7aea34480012d5 (patch) | |
tree | a64a5f11be5440ac73af85796d6a7a72ad3f4277 /llvm/lib/ExecutionEngine/Interpreter | |
parent | 61753bf84796694f1165e333c3190cc02ea03ba1 (diff) | |
download | bcm5719-llvm-98e541457bbe04c22364ff82ef7aea34480012d5.tar.gz bcm5719-llvm-98e541457bbe04c22364ff82ef7aea34480012d5.zip |
Add support for unreachable
llvm-svn: 17056
Diffstat (limited to 'llvm/lib/ExecutionEngine/Interpreter')
-rw-r--r-- | llvm/lib/ExecutionEngine/Interpreter/Execution.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/ExecutionEngine/Interpreter/Interpreter.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp index 589ac7f99dc..8616656360f 100644 --- a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp +++ b/llvm/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/llvm/lib/ExecutionEngine/Interpreter/Interpreter.h b/llvm/lib/ExecutionEngine/Interpreter/Interpreter.h index d6e590d7357..e146135cf5f 100644 --- a/llvm/lib/ExecutionEngine/Interpreter/Interpreter.h +++ b/llvm/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); |