[llvm] [AsmPrinter][Dwarf5][nfc] Remove template from AccelTable class (PR #76296)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 5 18:16:33 PST 2024


dwblaikie wrote:

> > > Recently, these different implementations were combined by using a std::variant.
> > 
> > 
> > @ayermolo for posterity, could you explain/point to an existing explanation for that? (Sorry, I know I reviewed the code, but it's a lot to try to page back in, etc - perhaps we talked about it already elsewhere so a pointer to taht discussion would be good if we had one)
> 
> This was done in #69399. Which was a pre-cursor to the .debug_names + types implementation for monolithic DWARF.
> 
> Previously for .debug_names we carried CU DIE pointer until the end when .debug_names is written out. Initially I changed so that the same happens to TU DIEs, but that lead to memory overhead increase when input is llvm IR. So I changed implementation back to write out TUs as they are being finalized. This means that an TableData needs to carry finalized offset for TU, and DIE for CU (until the latter is normalized so that when we write out .debug_names all TableData instances have just offset). Thus I changed the data structure to have both using the std::variant. In that PR we also discussed using std::variant vs union.

*nod* thanks for the refresher - so since LLVM's normal emisison path used the DIE, and I guess DWARFLinker or something else needed the offset? And then since LLVM needed both anyway, the other codepath was changed to use that representation and so we only needed the one representation... 

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


More information about the llvm-commits mailing list