[clang] [clang][DebugInfo] Attach DW_AT_const_value to static data-member definitions if available (PR #72730)

Michael Buch via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 18 06:13:41 PST 2023


Michael137 wrote:

> Overall this looks good, thanks!
> 
> I think we may want to add a test to check that the output DWARF has a const value in the expected place, since consumers are relying on it.

Any suggestions where to put such end-to-end test?

This patch makes sure we encode the constant in a `DIExpression` on definitions, which is tested. And we have tests for ensuring that `DW_OP_constu` expressions get turned into `DW_AT_const_value`s (I know of at least `llvm/test/DebugInfo/Generic/dwarf5-debug-info-static-member.ll`)

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


More information about the cfe-commits mailing list