summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/Interpreter
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-04-17 17:38:28 +0000
committerChris Lattner <sabre@nondot.org>2007-04-17 17:38:28 +0000
commitd9b7511928cfdfa64781338e8a922ab28c96311a (patch)
tree170ebd79a6673760f563a456c49b89ab1cd083a6 /llvm/lib/ExecutionEngine/Interpreter
parentda1ed8de79861b06fd9a8f2d95ddf4e26beec716 (diff)
downloadbcm5719-llvm-d9b7511928cfdfa64781338e8a922ab28c96311a.tar.gz
bcm5719-llvm-d9b7511928cfdfa64781338e8a922ab28c96311a.zip
eliminate use of Instruction::getPrev(). Patch by Gabor Greif in 2005.
llvm-svn: 36198
Diffstat (limited to 'llvm/lib/ExecutionEngine/Interpreter')
-rw-r--r--llvm/lib/ExecutionEngine/Interpreter/Execution.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
index 3e7a3e72b09..98213c882df 100644
--- a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
@@ -866,16 +866,19 @@ void Interpreter::visitCallSite(CallSite CS) {
// If it is an unknown intrinsic function, use the intrinsic lowering
// class to transform it into hopefully tasty LLVM code.
//
- Instruction *Prev = CS.getInstruction()->getPrev();
+ BasicBlock::iterator me(CS.getInstruction());
BasicBlock *Parent = CS.getInstruction()->getParent();
+ bool atBegin(Parent->begin() == me);
+ if (!atBegin)
+ --me;
IL->LowerIntrinsicCall(cast<CallInst>(CS.getInstruction()));
// Restore the CurInst pointer to the first instruction newly inserted, if
// any.
- if (!Prev) {
+ if (atBegin) {
SF.CurInst = Parent->begin();
} else {
- SF.CurInst = Prev;
+ SF.CurInst = me;
++SF.CurInst;
}
return;
OpenPOWER on IntegriCloud