[PATCH] D125693: [DebugInfo] Support types, imports and static locals declared in a lexical block (3/5)

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 11 18:39:32 PDT 2022


dblaikie added a subscriber: JDevlieghere.
dblaikie added a comment.

In D125693#3641742 <https://reviews.llvm.org/D125693#3641742>, @krisb wrote:

> @dblaikie, could you please take a look at this and/or D113741 <https://reviews.llvm.org/D113741>? Do you see any ways to proceed?

My concern with this direction is that anything that adds lists to the IR metadata makes it difficult for that data to be dropped when it becomes unused (the type graph, apart from the "retained types" on the CU, is structured so that if a variable, say, gets optimized away, or a function gets optimized away and its parameters along with it, the types get dropped too - similarly with function descriptions, they aren't in a list (they used to be) and are instead referenced from the `llvm::Function` ensuring that if the function is optimized away entirely, the debug info for that goes away too). Admittedly function-local things are handled somewhat differently, for instance there is a list on the `DISubprogram` of the local variables to ensure they are retained through optimizations so name lookup does the right things at function-scope. So /maybe/ it's OK to move in that direction here, but it might look more like that, add these other function-local things to the `DISubprogram`-scoped list (rename the list to generalize over more than just variables), rather than adding per-scope lists?

(@aprantl @JDevlieghere @probinson - what do you folks think? Add these things to some list (be it on the scope itself, or on a/the existing list on the subprogram metadata) or go with the lazy-referenced style already in-place and proposed in https://reviews.llvm.org/D113741 though some issues are discussed with that. I'm not sure if those are solvable problems?)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125693/new/

https://reviews.llvm.org/D125693



More information about the llvm-commits mailing list