diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-03-30 17:06:38 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-03-30 17:06:38 +0000 |
commit | 215e7edfe08ad51895be3a883eb375003ce34160 (patch) | |
tree | 8f907173bc9a5645f685ff8ecefaafc1901a22f6 /llvm/lib/IR/DebugInfo.cpp | |
parent | 894b1e385c74aa7f05abbba779022da68a2db372 (diff) | |
download | bcm5719-llvm-215e7edfe08ad51895be3a883eb375003ce34160.tar.gz bcm5719-llvm-215e7edfe08ad51895be3a883eb375003ce34160.zip |
DebugInfo: Simplify logic in DISubprogram::Verify(), NFC
Simplify the logic in `DISubprogram::Verify()` by using the new debug
info hierarchy directly instead of the `DebugLoc` wrapper.
llvm-svn: 233563
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r-- | llvm/lib/IR/DebugInfo.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index 9a6b9536bc1..ec4f95eb71f 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -343,24 +343,19 @@ bool DISubprogram::Verify() const { if (auto *F = getFunction()) { for (auto &BB : *F) { for (auto &I : BB) { - DebugLoc DL = I.getDebugLoc(); - if (DL.isUnknown()) + MDLocation *DL = + cast_or_null<MDLocation>(I.getDebugLoc().getAsMDNode()); + if (!DL) continue; - MDNode *Scope = nullptr; - MDNode *IA = nullptr; // walk the inlined-at scopes - while ((IA = DL.getInlinedAt())) - DL = DebugLoc::getFromDILocation(IA); - DL.getScopeAndInlinedAt(Scope, IA); + while (MDLocation *IA = DL->getInlinedAt()) + DL = IA; + MDScope *Scope = DL->getScope(); if (!Scope) return false; - assert(!IA); - while (!DIDescriptor(Scope).isSubprogram()) { - DILexicalBlockFile D(Scope); - Scope = D.isLexicalBlockFile() - ? D.getScope() - : DebugLoc::getFromDILexicalBlock(Scope).getScope(); + while (!isa<MDSubprogram>(Scope)) { + Scope = cast<MDLexicalBlockBase>(Scope)->getScope(); if (!Scope) return false; } |