add a version of IRBuilder::SetInsertPoint that takes an instruction.
authorChris Lattner <sabre@nondot.org>
Sun, 19 Dec 2010 19:16:22 +0000 (19:16 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 19 Dec 2010 19:16:22 +0000 (19:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122180 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/IRBuilder.h

index c6b48473ac4221f52eec51346b33632b1d53e19f..10d96286ffc4746e3bbaf1eb969e5ae769316a23 100644 (file)
@@ -73,6 +73,13 @@ public:
     InsertPt = BB->end();
   }
 
+  /// SetInsertPoint - This specifies that created instructions should be
+  /// inserted before the specified instruction.
+  void SetInsertPoint(Instruction *I) {
+    BB = I->getParent();
+    InsertPt = I;
+  }
+  
   /// SetInsertPoint - This specifies that created instructions should be
   /// inserted at the specified point.
   void SetInsertPoint(BasicBlock *TheBB, BasicBlock::iterator IP) {