diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-03-30 17:41:24 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-03-30 17:41:24 +0000 |
commit | 8f7bc7919ba426ec34f6ac9859472d722148f732 (patch) | |
tree | 1c80253862893fcf8bceae131c09b45999a47288 /llvm/lib/IR/DebugLoc.cpp | |
parent | 29e36dc0c688b2f1b1bdd4d9a319770ea83890ec (diff) | |
download | bcm5719-llvm-8f7bc7919ba426ec34f6ac9859472d722148f732.tar.gz bcm5719-llvm-8f7bc7919ba426ec34f6ac9859472d722148f732.zip |
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
Diffstat (limited to 'llvm/lib/IR/DebugLoc.cpp')
-rw-r--r-- | llvm/lib/IR/DebugLoc.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
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<MDLocation>(Loc)->getInlinedAtScope(); } DebugLoc DebugLoc::getFnDebugLoc() const { |