[llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp

Chris Lattner sabre at nondot.org
Tue Apr 17 10:38:46 PDT 2007



Changes in directory llvm/lib/ExecutionEngine/Interpreter:

Execution.cpp updated: 1.178 -> 1.179
---
Log message:

eliminate use of Instruction::getPrev().  Patch by Gabor Greif in 2005.


---
Diffs of the changes:  (+6 -3)

 Execution.cpp |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)


Index: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
diff -u llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.178 llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.179
--- llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.178	Mon Apr 16 16:50:40 2007
+++ llvm/lib/ExecutionEngine/Interpreter/Execution.cpp	Tue Apr 17 12:38:28 2007
@@ -866,16 +866,19 @@
       // 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;






More information about the llvm-commits mailing list