[PATCH] D127898: [clang][dataflow] Add API to separate analysis from diagnosis

Stanislav Gatev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 28 23:34:16 PDT 2022


sgatev accepted this revision.
sgatev added inline comments.


================
Comment at: clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp:401
+                           const TypeErasedDataflowAnalysisState &State) {
+            PostVisitStmt(Stmt.getStmt(), State);
+          });
----------------
Let's harmonize the arguments to `transferBlock` and `runTypeErasedDataflowAnalysis`. I think in both cases we only need access to the internal `Stmt` so there's no need to pass `CFGStmt` to `transferBlock`. This way we can pass `PostVisitStmt` directly here without having to wrap it in a lambda.


================
Comment at: clang/unittests/Analysis/FlowSensitive/TestingSupport.h:87-89
+    std::function<std::function<void(
+        const Stmt *, const TypeErasedDataflowAnalysisState &)>(ASTContext &)>
+        MakePostVisitStmt,
----------------
Why is this a function that returns a function? Couldn't it be simply a void function, like `VerifyResults`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127898/new/

https://reviews.llvm.org/D127898



More information about the cfe-commits mailing list