File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -2600,14 +2600,23 @@ class DILocation : public MDNode {
26002600 StringRef getDirectory () const { return getScope ()->getDirectory (); }
26012601 std::optional<StringRef> getSource () const { return getScope ()->getSource (); }
26022602
2603+ // / Get the location where this is inlined
2604+ // /
2605+ // / Walk through \a getInlinedAt() and return the \a DILocation where this is
2606+ // / inlined.
2607+ const DILocation *getInlinedAtLocation () const {
2608+ const DILocation *Current = this , *Next = nullptr ;
2609+ while (Next = Current->getInlinedAt ())
2610+ Current = Next;
2611+ return Current;
2612+ }
2613+
26032614 // / Get the scope where this is inlined.
26042615 // /
26052616 // / Walk through \a getInlinedAt() and return \a getScope() from the deepest
26062617 // / location.
26072618 DILocalScope *getInlinedAtScope () const {
2608- if (auto *IA = getInlinedAt ())
2609- return IA->getInlinedAtScope ();
2610- return getScope ();
2619+ return getInlinedAtLocation ()->getScope ();
26112620 }
26122621
26132622 // / Get the DWARF discriminator.
You can’t perform that action at this time.
0 commit comments