PHI-pointer builder, just copy the builder and clobber the obvious
fields.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202136
91177308-0d34-0410-b5e6-
96231b3b80d8
// as local as possible to the PHI. To do that, we re-use the location of
// the old pointer, which necessarily must be in the right position to
// dominate the PHI.
- IRBuilderTy PtrBuilder(OldPtr);
- PtrBuilder.SetNamePrefix(Twine(NewAI.getName()) + "." + Twine(BeginOffset) +
- ".");
+ IRBuilderTy PtrBuilder(IRB);
+ PtrBuilder.SetInsertPoint(OldPtr);
+ PtrBuilder.SetCurrentDebugLocation(OldPtr->getDebugLoc());
Value *NewPtr =
getAdjustedAllocaPtr(PtrBuilder, BeginOffset, OldPtr->getType());