[clang] [NFC][analyzer] Remove the NodeBuilder from VisitArrayInitLoopExpr (PR #204354)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 22 02:23:48 PDT 2026


================
@@ -3193,20 +3193,20 @@ void ExprEngine::VisitCommonDeclRefExpr(const Expr *Ex, const NamedDecl *D,
 void ExprEngine::VisitArrayInitLoopExpr(const ArrayInitLoopExpr *Ex,
                                         ExplodedNode *Pred,
                                         ExplodedNodeSet &Dst) {
+  const Expr *Arr = Ex->getCommonExpr()->getSourceExpr();
+
   ExplodedNodeSet CheckerPreStmt;
   getCheckerManager().runCheckersForPreStmt(CheckerPreStmt, Pred, Ex, *this);
 
   ExplodedNodeSet EvalSet;
-  NodeBuilder Bldr(CheckerPreStmt, EvalSet, *currBldrCtx);
-
-  const Expr *Arr = Ex->getCommonExpr()->getSourceExpr();
+  if (isa<CXXConstructExpr>(Ex->getSubExpr())) {
+    // The constructor visitior has already taken care of everything, so let's
+    // skip forward to the PostStmt handling after the 'for' loop.
+    EvalSet.insert(CheckerPreStmt);
+    CheckerPreStmt.clear();
+  }
----------------
NagyDonat wrote:

I see your point. I tried to clarify the comment in https://github.com/llvm/llvm-project/pull/204354/commits/8c604b511695bac28f89221fdeba6b2663e09948, I hope this helps.

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


More information about the cfe-commits mailing list