From 8f7bc7919ba426ec34f6ac9859472d722148f732 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Mon, 30 Mar 2015 17:41:24 +0000 Subject: 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 --- llvm/lib/IR/DebugLoc.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'llvm/lib/IR/DebugLoc.cpp') diff --git a/llvm/lib/IR/DebugLoc.cpp b/llvm/lib/IR/DebugLoc.cpp index e1bf7951a58..6b2a5395930 100644 --- a/llvm/lib/IR/DebugLoc.cpp +++ b/llvm/lib/IR/DebugLoc.cpp @@ -33,9 +33,7 @@ void DebugLoc::getScopeAndInlinedAt(MDNode *&Scope, MDNode *&IA) const { } MDNode *DebugLoc::getScopeNode() const { - if (MDNode *InlinedAt = getInlinedAt()) - return DebugLoc::getFromDILocation(InlinedAt).getScopeNode(); - return getScope(); + return cast(Loc)->getInlinedAtScope(); } DebugLoc DebugLoc::getFnDebugLoc() const { -- cgit v1.2.3