Skip to content

Commit 1fb95c9

Browse files
author
Devang Patel
committed
If builder is initialized using an instruction as insertion point, then use the instruction's debug location as current debug location.
llvm-svn: 130874
1 parent b4f4d51 commit 1fb95c9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

llvm/include/llvm/Support/IRBuilder.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ class IRBuilder : public IRBuilderBase, public Inserter {
324324
explicit IRBuilder(Instruction *IP)
325325
: IRBuilderBase(IP->getContext()), Folder() {
326326
SetInsertPoint(IP);
327+
SetCurrentDebugLocation(IP->getDebugLoc());
327328
}
328329

329330
IRBuilder(BasicBlock *TheBB, BasicBlock::iterator IP, const T& F)

0 commit comments

Comments
 (0)