[clang] [NFC][analyzer] Refactor processCFGBlockEntrance (PR #215284)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 11 04:01:55 PDT 2026


================
@@ -325,18 +325,12 @@ void CoreEngine::HandleBlockEdge(const BlockEdge &L, ExplodedNode *Pred) {
 
   // Call into the ExprEngine to process entering the CFGBlock.
   BlockEntrance BE(L.getSrc(), L.getDst(), Pred->getStackFrame());
-  ExplodedNodeSet DstNodes;
-  NodeBuilder Builder(Pred, DstNodes, ExprEng.getBuilderContext());
-  ExprEng.processCFGBlockEntrance(BE, Builder, Pred);
-
-  // Auto-generate a node.
-  if (!Builder.hasGeneratedNodes()) {
-    Builder.generateNode(BE, Pred->State, Pred);
-  }
+  ExplodedNode *Processed = ExprEng.processCFGBlockEntrance(BE, Pred);
 
   ExplodedNodeSet CheckerNodes;
-  for (auto *N : DstNodes) {
-    ExprEng.runCheckersForBlockEntrance(BE, N, CheckerNodes);
+
+  if (Processed && !Processed->isSink()) {
----------------
NagyDonat wrote:

As I revisited this area, I realized that the sink check was in fact unnecessary because `Processed` is eventually passed to a function that takes an `ExplodedNodeSet` and therefore "does the right thing" by discarding the sink node.

Therefore I removed the `isSink()` check in https://github.com/llvm/llvm-project/pull/215284/commits/5d287d92d423def755cee3ed8f261c8fe72c74fd  

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


More information about the cfe-commits mailing list