[clang] [LifetimeSafety] Add multi-block support to buildOriginFlowChain (PR #204592)

Yuan Suo via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 26 05:41:43 PDT 2026


suoyuan666 wrote:

> This is mostly the right direction. There is still a major flaw here: The BFS needs a visited state set otherwise this is **exponential** as it traverses all paths!
> 
> We would need a state to avoid revisiting. I _think_ a `std::pair<const CFGBlock *, OriginID>` should work fine.

This is a good point. I have used `std::pair<const CFGBlock *, OriginID>` as the BFS node and added `VisitedStates` for deduplication.


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


More information about the cfe-commits mailing list