[llvm] [DebugInfo] Merge partially matching chains of textual inclusions (PR #125780)

Stephen Tozer via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 25 05:08:58 PST 2025


SLTozer wrote:

> This patch has nothing to do with "full textual-inclusion call stack". The goal here is to preserve as much information as possible when merging locations. I think Anton meant that nested DILexicalBlocks attributed to different files have structure similar to inlinedAt-location chains.

Alright, that's in line with my initial assumptions about the goal of the patch. So going back to my first comment, is there a need to generalize the location-merging logic? We shouldn't need to produce a full stack of nested DILexicalBlockFiles, because only the immediately containing file of the merged DILocations matters for the debug info consumer. If we get a non-line-0 location, then it will have the correct file as long as we check that the file scope for the merged lines match and use the matching file; if we get a line-0 location, then it doesn't matter what the file is (we can just fall back to the file scope of the containing DISubprogram). In either case, the chain of DILexicalBlockFiles won't be visible and as far as I can tell doesn't need to be produced - is this correct, or am I missing something either in general or about your particular use case?

https://github.com/llvm/llvm-project/pull/125780


More information about the llvm-commits mailing list