aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ExecutionEngine/Interpreter/Execution.cpp
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
commitb8e237bb86cf810deba0bd0d11c12312978667be (patch)
treebfae46bc4924bc87fdf43302f72c44faafa0c852 /lib/ExecutionEngine/Interpreter/Execution.cpp
parent4d8c16f15a9ee1b646e385bddd20a4a069e2885b (diff)
downloadexternal_llvm-b8e237bb86cf810deba0bd0d11c12312978667be.zip
external_llvm-b8e237bb86cf810deba0bd0d11c12312978667be.tar.gz
external_llvm-b8e237bb86cf810deba0bd0d11c12312978667be.tar.bz2
eliminate use of Instruction::getPrev(). Patch by Gabor Greif in 2005.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36198 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/Interpreter/Execution.cpp')
-rw-r--r--lib/ExecutionEngine/Interpreter/Execution.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp
index 3e7a3e7..98213c8 100644
--- a/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/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;