[PATCH] D110294: [DebugInfo] Fix debug info for imported declarations of inlined functions
Ellis Hoag via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 12 17:26:15 PDT 2021
ellis added a comment.
In D110294#3040455 <https://reviews.llvm.org/D110294#3040455>, @dblaikie wrote:
> I don't think this is the right approach - because it depends on the abstract SP being created before the query - and would produce a different result if the abstract SP is created after the query. Abstract SPs are created only once an inlined subroutine is discovered, I believe - so the DWARF would be different depending on function ordering - in some cases having things attached to the abstract DIE, in some cases to the concrete DIE. That's not ideal.
>
> Looking at the callers, for instance - constructCallSiteEntryDIE looks like it could have that issue with the new getOrCreateSubprogramDIE behavior - depending on whether the call site is before or after the first inlining of the caller, the DWARF would point to the abstract origin or the (possibly incorrect/invalid/weird-empty) concrete subprogram DIE, perhaps?
I found that `constructCallSiteEntryDIE()` is actually called in `endFunctionImpl()` after `constructAbstractSubprogramScopeDIE()` is called for each scope in the function, so those inlined SPs will have abstract origins.
But regardless, I kind of agree with you since there are several call sites and I'm not sure I've considered all cases. For now, I'm going to update D108492 <https://reviews.llvm.org/D108492> so that it doesn't depend on this and I'll also send an email to the llvm-dev explaining what I know about this. Thanks!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D110294/new/
https://reviews.llvm.org/D110294
More information about the llvm-commits
mailing list