diff options
author | Reid Kleckner <rnk@google.com> | 2016-09-27 18:45:31 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2016-09-27 18:45:31 +0000 |
commit | 6481822e28a123779cfb0bf469040eb183029314 (patch) | |
tree | e6a06c0845010e3ad99e79d270e80a6c900d7a45 /llvm/lib/Transforms/Utils/Local.cpp | |
parent | 586fc12e320d243b0efde5b0a058ffd9b0ef9c3f (diff) | |
download | bcm5719-llvm-6481822e28a123779cfb0bf469040eb183029314.tar.gz bcm5719-llvm-6481822e28a123779cfb0bf469040eb183029314.zip |
[DebugInfo] Add comments to phi dbg.value tracking code, NFC
LLVM developers might be surprised to learn that there are blocks
without valid insertion points (catchswitch), so it seems worth calling
that out explicitly. Also add a FIXME about what we should really be
doing if we ever need to make optimized Windows EH code debuggable.
While I'm here, make auto usage more consistent with LLVM standards and
avoid an unecessary call to insertBefore.
llvm-svn: 282521
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index 9b28f837d70..5c46111822b 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -1147,13 +1147,15 @@ void llvm::ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI, if (PhiHasDebugValue(DIVar, DIExpr, APN)) return; - auto BB = APN->getParent(); + BasicBlock *BB = APN->getParent(); auto InsertionPt = BB->getFirstInsertionPt(); - if (InsertionPt != BB->end()) { - Instruction *DbgValue = Builder.insertDbgValueIntrinsic( - APN, 0, DIVar, DIExpr, DDI->getDebugLoc(), (Instruction *)nullptr); - DbgValue->insertBefore(&*InsertionPt); - } + + // The block may be a catchswitch block, which does not have a valid + // insertion point. + // FIXME: Insert dbg.value markers in the successors when appropriate. + if (InsertionPt != BB->end()) + Builder.insertDbgValueIntrinsic(APN, 0, DIVar, DIExpr, DDI->getDebugLoc(), + &*InsertionPt); } /// Determine whether this alloca is either a VLA or an array. |