[clang] [llvm] [CloneFunction][DebugInfo] Avoid cloning DILocalVariables of inlined functions (PR #75385)

Duncan P. N. Exon Smith via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 1 13:09:27 PDT 2024


dexonsmith wrote:

> An immediate fix would be to not set the "identifier" field for the DICompositeType when it's created if it's inside a function scope to avoid ODRUniqing. I've only got a light understanding of what the identifier field is for, so there might be unexpected consequences, plus there'll be a metadata/DWARF size cost to that.

Actually, that seems like probably the correct fix. The identifier field is precisely for "ODR-unique-based-on-this" and only for that, IIRC (@aprantl, can you confirm? these are old memories for me at this point...).

If the function-local types should not be ODR-uniqued, then dropping the identifier field sounds correct. 

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


More information about the cfe-commits mailing list