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

Alexander Yermolovich via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 5 17:05:06 PST 2024


ayermolo 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 https://github.com/llvm/llvm-project/pull/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. 

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


More information about the llvm-commits mailing list