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

Abid Qadeer via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 07:22:58 PDT 2024


abidh wrote:

> As far as I understand this patch, it's swapping which field of a DISubprogram the data is stored in, and all the accessors are updated, so this patch should be transparent to any code using the accessors.
> 
> Thus, surely the problem is caused by code that directly accesses the fields of DISubprogram and is exposed to their ordering -- shouldn't such code instead examine fields in a logical manner rather than the order of storage?

The caller here is `Verifier::visitMDNode`. It does not directly access the fields of `DISubprogram`. That code does not even know it is processing `DISubprogram`. It is processing the fields of an `MDNode` in order they are returned by the MDNode.operands(). 

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


More information about the llvm-commits mailing list