diff options
author | Adrian Prantl <aprantl@apple.com> | 2013-11-18 23:04:38 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2013-11-18 23:04:38 +0000 |
commit | 8e10fdbc0ff5aba13dcedbc0668697693aaf19fd (patch) | |
tree | b43dec1faa3a8b0786842fba3348d05ac6717c53 /llvm/lib/Transforms/Utils | |
parent | 69c71cc82747d006735ab7919875ed3a0a784f0b (diff) | |
download | bcm5719-llvm-8e10fdbc0ff5aba13dcedbc0668697693aaf19fd.tar.gz bcm5719-llvm-8e10fdbc0ff5aba13dcedbc0668697693aaf19fd.zip |
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
llvm-svn: 195052
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index 82b8da3a107..2768041fb2b 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/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; |