[llvm] [DebugInfo] Swap 'Unit' and 'Type' positions in DISubprogram. (PR #96474)

Alok Kumar Sharma via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 4 23:26:42 PDT 2024


alokkrsharma wrote:

This LGTM.

Initially (Before enhancements for the Fortran debugging) Verifier had a restriction for DISubrange to have count as REQUIRED field. As languages do have default values for lowerBound, count explicitly gives number of elements and upper bound can be calculated (upper - lower +1).
We have relaxed this restriction for the first time due to the need of the Fortran language where upperBound is used more naturally and if needed count can be calculated. Now DISubrange should either have count or upperBound.
This restriction further relaxed again for the Fortran assumed size array where for last dimension count/upper bound can be absent.

Removing restriction completely in place of relaxing would make any language (like Fortran) with prosperous arrays happy. I agree with the point that back-end should have common/minimum restrictions which applies to all the languages, any extra restriction should be moved to respective front-ends if needed. Thanks. 

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


More information about the llvm-commits mailing list