From ea27d3f4fc0876658a39e9989d12083a40564532 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Tue, 25 Feb 2014 11:12:04 +0000 Subject: [PATCH] [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. llvm-svn: 202136 --- lib/Transforms/Scalar/SROA.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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());