[clang] [LifetimeSafety] Add multi-block support to buildOriginFlowChain (PR #204592)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 19 00:50:43 PDT 2026
================
@@ -204,51 +209,45 @@ class AnalysisImpl
llvm::SmallVector<OriginID>
buildOriginFlowChain(ProgramPoint StartPoint, const OriginID StartOID,
- const LoanID TargetLoan) const {
+ const LoanID TargetLoan,
+ const PostOrderCFGView *POV) const {
assert(getLoans(StartOID, StartPoint).contains(TargetLoan) &&
"TargetLoan must be present in the StartOID at the StartPoint");
- OriginID CurrOID = StartOID;
llvm::SmallVector<OriginID> OriginFlowChain;
- llvm::ArrayRef<const Fact *> Facts = FactMgr.getBlockContaining(StartPoint);
- const auto *StartIt = llvm::find(Facts, StartPoint);
- assert(StartIt != Facts.end());
+ std::optional<size_t> BlockID = FactMgr.getBlockID(StartPoint);
+ assert(BlockID.has_value());
+ const auto StartIt = llvm::find_if(*POV, [&BlockID](const CFGBlock *Block) {
----------------
NeKon69 wrote:
Well I guess since the range is later reversed, it is, but I still think you should name it something that is related to the end.
https://github.com/llvm/llvm-project/pull/204592
More information about the cfe-commits
mailing list