summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/SROA.cpp
diff options
context:
space:
mode:
authorAnastasis Grammenos <anastasis.gramm2@gmail.com>2018-06-28 18:58:30 +0000
committerAnastasis Grammenos <anastasis.gramm2@gmail.com>2018-06-28 18:58:30 +0000
commit425df22ee30b110815813cf9ad82fe087f3a0375 (patch)
tree67ed98924adb1a3e2a7de79791a5e5c742938e99 /llvm/lib/Transforms/Scalar/SROA.cpp
parentbc78b621694e725510f44319120bcb3bd87bf6dd (diff)
downloadbcm5719-llvm-425df22ee30b110815813cf9ad82fe087f3a0375.tar.gz
bcm5719-llvm-425df22ee30b110815813cf9ad82fe087f3a0375.zip
[SROA] Preserve DebugLoc when rewriting alloca partitions
When rewriting an alloca partition copy the DL from the old alloca over the the new one. Differential Revision: https://reviews.llvm.org/D48640 llvm-svn: 335904
Diffstat (limited to 'llvm/lib/Transforms/Scalar/SROA.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/SROA.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/SROA.cpp b/llvm/lib/Transforms/Scalar/SROA.cpp
index a541c5571c8..6c3f012c628 100644
--- a/llvm/lib/Transforms/Scalar/SROA.cpp
+++ b/llvm/lib/Transforms/Scalar/SROA.cpp
@@ -4029,6 +4029,8 @@ AllocaInst *SROA::rewritePartition(AllocaInst &AI, AllocaSlices &AS,
NewAI = new AllocaInst(
SliceTy, AI.getType()->getAddressSpace(), nullptr, Alignment,
AI.getName() + ".sroa." + Twine(P.begin() - AS.begin()), &AI);
+ // Copy the old AI debug location over to the new one.
+ NewAI->setDebugLoc(AI.getDebugLoc());
++NumNewAllocas;
}
OpenPOWER on IntegriCloud