diff --git a/include/llvm/Support/IRBuilder.h b/include/llvm/Support/IRBuilder.h index c6b48473ac4..10d96286ffc 100644 --- a/include/llvm/Support/IRBuilder.h +++ b/include/llvm/Support/IRBuilder.h @@ -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) {