From cc3029acdd4489c2cfe4c3e39fcb59241790d590 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 19 Dec 2010 19:16:22 +0000 Subject: [PATCH] add a version of IRBuilder::SetInsertPoint that takes an instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122180 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/IRBuilder.h | 7 +++++++ 1 file changed, 7 insertions(+) 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) {