summaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/Local.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2014-04-25 23:00:25 +0000
committerAdrian Prantl <aprantl@apple.com>2014-04-25 23:00:25 +0000
commit2bfbbd5d4d45276ea6deac226efe9d35a7f8547b (patch)
tree3b44efd1ae0948c15fa91f5abad90806d7adbabb /lib/Transforms/Utils/Local.cpp
parenteed2620611c4eedaa4c8d1b55ce5939f66be6292 (diff)
downloadllvm-2bfbbd5d4d45276ea6deac226efe9d35a7f8547b.tar.gz
llvm-2bfbbd5d4d45276ea6deac226efe9d35a7f8547b.tar.bz2
llvm-2bfbbd5d4d45276ea6deac226efe9d35a7f8547b.tar.xz
Unbreak the gdb buildbot by not lowering dbg.declare intrinsics for arrays.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207284 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/Local.cpp')
-rw-r--r--lib/Transforms/Utils/Local.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Transforms/Utils/Local.cpp b/lib/Transforms/Utils/Local.cpp
index 9c78a99b2a..51778151e4 100644
--- a/lib/Transforms/Utils/Local.cpp
+++ b/lib/Transforms/Utils/Local.cpp
@@ -1019,6 +1019,12 @@ bool llvm::ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
return true;
}
+/// Determine whether this alloca is either a VLA or an array.
+static bool isArray(AllocaInst *AI) {
+ return AI->isArrayAllocation() ||
+ AI->getType()->getElementType()->isArrayTy();
+}
+
/// LowerDbgDeclare - Lowers llvm.dbg.declare intrinsics into appropriate set
/// of llvm.dbg.value intrinsics.
bool llvm::LowerDbgDeclare(Function &F) {
@@ -1041,7 +1047,7 @@ bool llvm::LowerDbgDeclare(Function &F) {
// stored on the stack, while the dbg.declare can only describe
// the stack slot (and at a lexical-scope granularity). Later
// passes will attempt to elide the stack slot.
- if (AI && !AI->isArrayAllocation()) {
+ if (AI && !isArray(AI)) {
for (User *U : AI->users())
if (StoreInst *SI = dyn_cast<StoreInst>(U))
ConvertDebugDeclareToDebugValue(DDI, SI, DIB);