diff options
author | Adrian Prantl <aprantl@apple.com> | 2014-04-25 23:00:25 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2014-04-25 23:00:25 +0000 |
commit | 232897feaadcd89570286cef6f88585438d7dcdc (patch) | |
tree | 8b2af6350cfed1bc4e76e096429d5221ccf93c08 /llvm/lib/Transforms/Utils | |
parent | ece0e90e338ef61194edf3fcd938785dbc446ff7 (diff) | |
download | bcm5719-llvm-232897feaadcd89570286cef6f88585438d7dcdc.tar.gz bcm5719-llvm-232897feaadcd89570286cef6f88585438d7dcdc.zip |
Unbreak the gdb buildbot by not lowering dbg.declare intrinsics for arrays.
llvm-svn: 207284
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index 9c78a99b2aa..51778151e4d 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/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); |