If builder is initialized using an instruction as insertion point, then use the instr...
authorDevang Patel <dpatel@apple.com>
Wed, 4 May 2011 21:57:22 +0000 (21:57 +0000)
committerDevang Patel <dpatel@apple.com>
Wed, 4 May 2011 21:57:22 +0000 (21:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130874 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/IRBuilder.h

index 3878e793dbe00b4e05469fd9abdbd1bc7ae93e39..147b520a72372027a6565352ae8b9ba4e8fefd6a 100644 (file)
@@ -324,6 +324,7 @@ public:
   explicit IRBuilder(Instruction *IP)
     : IRBuilderBase(IP->getContext()), Folder() {
     SetInsertPoint(IP);
+    SetCurrentDebugLocation(IP->getDebugLoc());
   }
   
   IRBuilder(BasicBlock *TheBB, BasicBlock::iterator IP, const T& F)