summaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2013-11-18 23:04:38 +0000
committerAdrian Prantl <aprantl@apple.com>2013-11-18 23:04:38 +0000
commit940267e7f208751fdc48dbb7d6b5d86b6310ce7c (patch)
tree0527b3bba05203554db3d856cc86a361be40df9d /lib/Transforms
parentd9ddaa4acb096ada17fe2dfb014239cafc3aa2b0 (diff)
downloadllvm-940267e7f208751fdc48dbb7d6b5d86b6310ce7c.tar.gz
llvm-940267e7f208751fdc48dbb7d6b5d86b6310ce7c.tar.bz2
llvm-940267e7f208751fdc48dbb7d6b5d86b6310ce7c.tar.xz
Debug info: Let LowerDbgDeclare perfom the dbg.declare -> dbg.value
lowering only for load/stores to scalar allocas. The resulting values confuse the backend and don't add anything because we can describe array-allocas with a dbg.declare intrinsic just fine. rdar://problem/15464571 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195052 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Utils/Local.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Transforms/Utils/Local.cpp b/lib/Transforms/Utils/Local.cpp
index 82b8da3a10..2768041fb2 100644
--- a/lib/Transforms/Utils/Local.cpp
+++ b/lib/Transforms/Utils/Local.cpp
@@ -1045,7 +1045,11 @@ bool llvm::LowerDbgDeclare(Function &F) {
for (SmallVectorImpl<DbgDeclareInst *>::iterator I = Dbgs.begin(),
E = Dbgs.end(); I != E; ++I) {
DbgDeclareInst *DDI = *I;
- if (AllocaInst *AI = dyn_cast_or_null<AllocaInst>(DDI->getAddress())) {
+ AllocaInst *AI = dyn_cast_or_null<AllocaInst>(DDI->getAddress());
+ // If this is an alloca for a scalar variable, insert a dbg.value
+ // at each load and store to the alloca and erase the dbg.declare.
+ if (AI && !AI->isArrayAllocation()) {
+
// We only remove the dbg.declare intrinsic if all uses are
// converted to dbg.value intrinsics.
bool RemoveDDI = true;