1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

[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
This commit is contained in:
Reid Kleckner 2016-09-27 18:45:31 +00:00
parent 6ba0d72f22
commit dd0ddde1e5

View File

@ -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.