[llvm] [Verifier] Reject cyclic DIScope parent chains (PR #217997)
Manuel Carrasco via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 28 08:32:01 PDT 2026
================
@@ -164,6 +164,9 @@ class Verifier : public InstVisitor<Verifier>, VerifierSupport {
/// Keep track which DISubprogram is attached to which function.
DenseMap<const DISubprogram *, const Function *> DISubprogramAttachments;
+ /// Cache of whether following a DIScope's scope chain repeats a node.
+ DenseMap<const Metadata *, bool> DIScopeCycleCache;
----------------
mgcarrasco wrote:
We report all failures, and we don't stop at the first (in general, not just these ones). The cycle detection is also used at sites that are not reporting either, so caching all cases makes sense to me.
I renamed the variable to `DIScopeChainReachesCycle` in case it reads better in that way.
https://github.com/llvm/llvm-project/pull/217997
More information about the llvm-commits
mailing list