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

Vladislav Dzhidzhoev via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 1 05:08:19 PST 2024


dzhidzhoev wrote:

> ...ah, actually is it malformed because there's a DICompositeType in the retainedNodes list for a DISubprogram? I remember that the verifier considered that illegal before your patch landed, but not after.

Having this commit applied, DICompositeTypes with the scope of DISubprogram must appear in the corresponding subprogram's retainedNodes list, so that's not the issue.
However, in the reproducer, DICompositeType node no !54 ("type4") has a scope value !55 ("plimsoles") but appears in the retainedNodes list of subprogram !49 ("crumpets").
!54 must have either scope of !49 or belong to the subprogram !55's retainedNodes list.
This discrepancy was likely to happen in CloneFunctionInto if LTO was used. However, I'm not sure about that.

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


More information about the cfe-commits mailing list