diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-06-27 05:31:49 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-06-27 05:31:49 +0000 |
commit | 8832992df56dd51f58bf8fc386dec9cbf99054c9 (patch) | |
tree | 429eda54f9162c44d7c031e0b41a97264180a531 /llvm/lib/IR/DebugInfo.cpp | |
parent | bb712eda0f7a76704862d435323257b2e1059153 (diff) | |
download | bcm5719-llvm-8832992df56dd51f58bf8fc386dec9cbf99054c9.tar.gz bcm5719-llvm-8832992df56dd51f58bf8fc386dec9cbf99054c9.zip |
Revert "Revert "PR20038: DebugInfo: Inlined call sites where the caller has debug info but the call itself has no debug location.""
This reverts commit r211724.
llvm-svn: 211871
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r-- | llvm/lib/IR/DebugInfo.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index db9e56defa1..2023be313bd 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -532,6 +532,32 @@ bool DISubprogram::Verify() const { if (isLValueReference() && isRValueReference()) return false; + if (auto *F = getFunction()) { + LLVMContext &Ctxt = F->getContext(); + for (auto &BB : *F) { + for (auto &I : BB) { + DebugLoc DL = I.getDebugLoc(); + if (DL.isUnknown()) + continue; + + MDNode *Scope = nullptr; + MDNode *IA = nullptr; + // walk the inlined-at scopes + while (DL.getScopeAndInlinedAt(Scope, IA, F->getContext()), IA) + DL = DebugLoc::getFromDILocation(IA); + DL.getScopeAndInlinedAt(Scope, IA, Ctxt); + assert(!IA); + while (!DIDescriptor(Scope).isSubprogram()) { + DILexicalBlockFile D(Scope); + Scope = D.isLexicalBlockFile() + ? D.getScope() + : DebugLoc::getFromDILexicalBlock(Scope).getScope(Ctxt); + } + if (!DISubprogram(Scope).describes(F)) + return false; + } + } + } return DbgNode->getNumOperands() == 20; } |