DebugInfo: Implement MDLocation::getInlinedAtScope()
Write `MDLocation::getInlinedAtScope()` and use it to re-implement
`DebugLoc::getScopeNode()` (and simplify `DISubprogram::Verify()`).
This follows the inlined-at linked list and returns the scope of the
deepest/last location.
llvm-svn: 233568
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index ec4f95e..e16ac8c 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -349,9 +349,7 @@
continue;
// walk the inlined-at scopes
- while (MDLocation *IA = DL->getInlinedAt())
- DL = IA;
- MDScope *Scope = DL->getScope();
+ MDScope *Scope = DL->getInlinedAtScope();
if (!Scope)
return false;
while (!isa<MDSubprogram>(Scope)) {