[clang] [NFC][analyzer] Cleanup checker calls in `ExprEngine::ProcessStmt`, `ExprEngine::Visit*` (PR #218691)
Balázs Benics via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 1 08:08:14 PDT 2026
================
@@ -1115,17 +1258,35 @@ void ExprEngine::ProcessStmt(const Stmt *currStmt, ExplodedNode *Pred) {
} else
CleanedStates.insert(Pred);
- // Visit the statement.
- ExplodedNodeSet Dst;
+ ExplodedNodeSet PreVisited;
for (const auto I : CleanedStates) {
- ExplodedNodeSet DstI;
- // Visit the statement.
- Visit(currStmt, I, DstI);
- Dst.insert(DstI);
+ ExplodedNodeSet Tmp;
+ if (shouldJustCallCheckers(currStmt, PreVisitKind)) {
+ getCheckerManager().runCheckersForPreStmt(Tmp, I, currStmt, *this);
+ PreVisited.insert(Tmp);
+ } else
+ PreVisited.insert(I);
+ }
+
+ ExplodedNodeSet Visited;
+ for (const auto I : PreVisited) {
+ ExplodedNodeSet Tmp;
+ Visit(currStmt, I, Tmp);
+ Visited.insert(Tmp);
+ }
+
+ ExplodedNodeSet PostVisited;
+ for (const auto I : Visited) {
+ ExplodedNodeSet Tmp;
+ if (shouldJustCallCheckers(currStmt, PostVisitKind)) {
+ getCheckerManager().runCheckersForPostStmt(Tmp, I, currStmt, *this);
+ PostVisited.insert(Tmp);
+ } else
+ PostVisited.insert(I);
}
----------------
steakhal wrote:
```suggestion
ExplodedNodeSet PostVisited;
if (shouldJustCallCheckers(currStmt, PostVisitKind))
getCheckerManager().runCheckersForPostStmt(PostVisited, Visited, currStmt, *this);
else
PostVisited.insert(Visited);
```
https://github.com/llvm/llvm-project/pull/218691
More information about the cfe-commits
mailing list