[clang] [LifetimeSafety] Prevent duplicate loans and statement visits (PR #153661)

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 18 05:38:53 PDT 2025


usx95 wrote:

> If everything works out well, every time we call Visit on an expression, there should be a guarantee we already visited all the subexpressions of it

Yes this is the ideal scenario. But we visit the statements given by the CFG and this can, more often than not, skip many sub expressions. I don't have a great solution. An alternate could be to use a Recursive AST visitor (RAV) along that drives our FactGenerator stmt visitor. The RAV would still need to maintain a `Visited` set but `FactGenerator` visitor can now assume that all subexpressions have been visited without needing for each Visit* Method in FactGenerator to explicitly revisit subexpressions. WDYT about this alternative of using a RAV driver ?

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


More information about the cfe-commits mailing list