From: Chandler Carruth Date: Tue, 25 Feb 2014 11:12:04 +0000 (+0000) Subject: [SROA] Rather than copying the logic for building a name prefix into the X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=19899632f7125c449f983ad00c9fb3bf44aa0a76;p=oota-llvm.git [SROA] Rather than copying the logic for building a name prefix into the 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 --- diff --git a/lib/Transforms/Scalar/SROA.cpp b/lib/Transforms/Scalar/SROA.cpp index 66da6c6ee0d..a102212b96c 100644 --- a/lib/Transforms/Scalar/SROA.cpp +++ b/lib/Transforms/Scalar/SROA.cpp @@ -2649,9 +2649,9 @@ private: // 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());