llvm-project
e2a2c03e - [DebugInfo] Add Verifier check for incorrectly-scoped retainedNodes (#166855)

Commit
77 days ago
[DebugInfo] Add Verifier check for incorrectly-scoped retainedNodes (#166855) These checks ensure that retained nodes of a DISubprogram belong to the subprogram. Tests with incorrect IR are fixed. We should not have variables of one subprogram present in retained nodes of other subprograms. Also, interface for accessing DISubprogram's retained nodes is slightly refactored. `DISubprogram::visitRetainedNodes` and `DISubprogram::forEachRetainedNode` are added to avoid repeating checks like ``` if (const auto *LV = dyn_cast<DILocalVariable>(N)) ... else if (const auto *L = dyn_cast<DILabel>(N)) ... else if (const auto *IE = dyn_cast<DIImportedEntity>(N)) ... ```
Author
Parents
Loading