[llvm] Allow DIDerivedType as a bound in DISubrangeType (PR #165880)

Michael Buch via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 18 06:53:36 PST 2025


https://github.com/Michael137 commented:

For `DW_TAG_subrange_type`s of VLAs we just emit a `DW_AT_count` which references a variable DIE, which holds the dynamic element count. But that's not helpful here because you have a non-zero lower bound (and the variable holding the bound is a member variable, which we never have for VLAs)? So you want the same for `DW_AT_upper_bound` but be able to refer to a member variable? That seems reasonable to me (especially if GCC does this too).

Could you briefly elaborate on this:
> gnat-llvm can then arrange for the DIE reference to be correct by setting the array type's scope to be the record.

How does that help determine the dynamic length?

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


More information about the llvm-commits mailing list