mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233568 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -949,6 +949,16 @@ public:
|
||||
return cast_or_null<MDLocation>(getRawInlinedAt());
|
||||
}
|
||||
|
||||
/// \brief Get the scope where this is inlined.
|
||||
///
|
||||
/// Walk through \a getInlinedAt() and return \a getScope() from the deepest
|
||||
/// location.
|
||||
MDLocalScope *getInlinedAtScope() const {
|
||||
if (auto *IA = getInlinedAt())
|
||||
return IA->getInlinedAtScope();
|
||||
return getScope();
|
||||
}
|
||||
|
||||
Metadata *getRawScope() const { return getOperand(0); }
|
||||
Metadata *getRawInlinedAt() const {
|
||||
if (getNumOperands() == 2)
|
||||
|
Reference in New Issue
Block a user