diff --git a/clang/lib/Analysis/LifetimeSafety.cpp b/clang/lib/Analysis/LifetimeSafety.cpp index c762f63c45e09..d5d7e20a9f0cd 100644 --- a/clang/lib/Analysis/LifetimeSafety.cpp +++ b/clang/lib/Analysis/LifetimeSafety.cpp @@ -396,12 +396,18 @@ class FactGenerator : public ConstStmtVisitor { // initializations and destructions are processed in the correct sequence. for (const CFGBlock *Block : *AC.getAnalysis()) { CurrentBlockFacts.clear(); + VisitedStmts.clear(); for (unsigned I = 0; I < Block->size(); ++I) { const CFGElement &Element = Block->Elements[I]; - if (std::optional CS = Element.getAs()) + if (std::optional CS = Element.getAs()) { + DEBUG_WITH_TYPE("PrintCFG", + llvm::dbgs() + << "======CFGStmt and ASTStmt========\n"); + DEBUG_WITH_TYPE("PrintCFG", CS->dump()); + DEBUG_WITH_TYPE("PrintCFG", CS->getStmt()->dumpColor()); Visit(CS->getStmt()); - else if (std::optional DtorOpt = - Element.getAs()) + } else if (std::optional DtorOpt = + Element.getAs()) handleDestructor(*DtorOpt); } FactMgr.addBlockFacts(Block, CurrentBlockFacts);