[llvm] [DWARFLinkerParallel] Add support for -odr mode. (PR #68721)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 16 18:41:03 PDT 2023


dwblaikie wrote:

> > That said - I'm always here for a conversation about type consistency in DWARF... so let's take a look:
> > `DominatorTreeBase<llvm::BasicBlock, false>` example - `Insert` is a `static constexpr SomeEnum` member with an in-class initializer. Hmm, that might be tricky to do - because technically this isn't a definition (there may be no storage behind it) so I'm not sure we could move the const value out into a separate definition DIE. I guess a definition DIE without a DW_AT_location would be the nearest DWARF-ish way to express it. We /might/ be able to always instantiate the definition value, so put it on the declaration in all cases, but would need some language expertise to check if that's do-able.
> 
> Speaking of original example, Do I correctly understand that "DW_AT_const_value (0)" should be in both type definition copies(0x001c4090 and 0x010f623d) in currently generated DWARF?

I'm not actually sure. I'm not sure if we can always compute the value reliably in every context (some parts of templates we're not allowed to instantiate only in certain contexts).

If we couldn't do it in all cases, maybe we could not put the value on the declaration in all cases - and use a definition DIE to attach the value to (& not put a DW_AT_location on that definition, because it might not have storage in translation units, etc).

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


More information about the llvm-commits mailing list