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

Abid Qadeer via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 27 04:44:13 PDT 2024


abidh wrote:

> > In principle this LGTM, perhaps other reviewers could chime in though.
> 
> Yeah, bit janky - I don't totally object.
> 
> But alternatively: Could we remove the use/need for CurrentSourceLang? Guess it was added for fortran support, but perhaps we should've gone the toher way and weakened the checks? Just don't check for count/upperbound at all? (in visitDISubrange)
> 
> Presumably LLVM can produce whatever DWARF we do for Fortran given such info, and do that for C++ too - even if it's incorrect for C++, maybe we move that to just be up to the IR generator to get that right?

I did a bit of digging and it seems that those checks for count/upperBound were added for Fortran's allocatable array in https://reviews.llvm.org/D80197. Later they had to be modified for Fortran's assumed size arrays in https://reviews.llvm.org/D87500. So the checks were added for a Fortran feature and later had to be disabled for Fortran. Removing/weakening them seems reasonable to me. Please let me know if you prefer this solution.

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


More information about the llvm-commits mailing list