[llvm] Allow DWARF expressions to refer to variable values (PR #181028)
Vladislav Dzhidzhoev via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 28 06:36:19 PDT 2026
dzhidzhoev wrote:
> It seems like there are even more cases missing from `DebugInfoFinder` than I previously thought. E.g., `DICompositeType::getDataLocation` isn't checked, nor are several other fields of composite.
Hmm, probably, it's not that important to cover all the cases, if nobody actually reported problems with them before.
> I've also been wondering if it would make sense to enforce a scoping rule in the verifier, namely that a type should only be able to refer to either a global variable, or a variable in the type's own scope or higher (that is, not in a deeper scope or sibling scope). And perhaps this rule should be extended to intra-type references as well.
Will it work for function clones? And for LTO case with ODR-type-uniquing? Currently we may encounter local variables referencing types from other subprograms. I guess the opposite may be true as well, if a variable used in expression is of an ODR-uniqued type.. See https://github.com/llvm/llvm-project/pull/165032:
> for each loaded distinct (definition) DISubprogram, its retainedNodes list is scanned after loading, and DITypes with a scope of another subprogram are removed. If something from a Function corresponding to the DISubprogram references uniqued type, we rely on cross-CU links.
https://github.com/llvm/llvm-project/pull/181028
More information about the llvm-commits
mailing list