[PATCH] D131280: [clang][dataflow] Parameterize analysis by explicit map of analyzable functions.

Stanislav Gatev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 8 07:55:16 PDT 2022


sgatev added inline comments.


================
Comment at: clang/include/clang/Analysis/FlowSensitive/ControlFlowContext.h:83
+/// overload sets. change the key to support uniqueness.
+llvm::Expected<llvm::StringMap<ControlFlowContext>>
+buildFunctionMapFromAST(ASTUnit &Unit);
----------------
`#include "llvm/ADT/StringMap.h"`


================
Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:27
 #include "llvm/ADT/DenseSet.h"
+#include "llvm/ADT/StringSet.h"
 #include "llvm/Support/Compiler.h"
----------------
This should be `StringMap`.


================
Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:60
   ///
+  /// Paramter `AnalyzableFunctions` is a map of analyzable function bodies
+  /// (represented as `ControlFlowContext`s), keyed by the fully-qualified
----------------
How about `InlineableFunctions`?


================
Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:60
   ///
+  /// Paramter `AnalyzableFunctions` is a map of analyzable function bodies
+  /// (represented as `ControlFlowContext`s), keyed by the fully-qualified
----------------
sgatev wrote:
> How about `InlineableFunctions`?



================
Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:549
 
-      // Note that it is important for the storage location of `S` to be set
-      // before `pushCall`, because the latter uses it to set the storage
-      // location for `return`.
-      auto &ReturnLoc = Env.createStorageLocation(*S);
-      Env.setStorageLocation(*S, ReturnLoc);
-      auto CalleeEnv = Env.pushCall(S);
+      const FunctionDecl *FuncDecl = CFCtx->getDecl()->getAsFunction();
+      assert(FuncDecl != nullptr && "ControlFlowContexts in the environment "
----------------
How is that different from `F`? Why not let `Environment::pushCall` get this from the `CallExpr` argument?


================
Comment at: clang/unittests/Analysis/FlowSensitive/TestingSupport.h:74
 
+/// `Code` must be the source code from `ASTUnit` was built.
 template <typename AnalysisT>
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131280



More information about the cfe-commits mailing list