[PATCH] D146507: [clang][dataflow][NFC] Eliminate StmtToEnvMap interface.

Martin Böhme via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 28 00:57:43 PDT 2023


mboehme marked 2 inline comments as done.
mboehme added inline comments.


================
Comment at: clang/include/clang/Analysis/FlowSensitive/Transfer.h:35
+  /// The result is guaranteed never to be null.
+  virtual const Environment *getEnvironment(const Stmt &S) const {
+    auto BlockIt = CFCtx.getStmtToBlock().find(&ignoreCFGOmittedNodes(S));
----------------
gribozavr2 wrote:
> Drop virtual?
Duh. Thanks for catching. Done!


================
Comment at: clang/include/clang/Analysis/FlowSensitive/Transfer.h:36-40
+    auto BlockIt = CFCtx.getStmtToBlock().find(&ignoreCFGOmittedNodes(S));
+    assert(BlockIt != CFCtx.getStmtToBlock().end());
+    const auto &State = BlockToState[BlockIt->getSecond()->getBlockID()];
+    assert(State);
+    return &State->Env;
----------------
ymandel wrote:
> Nit: why inline vs putting the definition in Transfer.cpp? I don't have a good sense for the size cutoff on this decision but if it's only used there, then might make sense just to keep the header leaner.
Good point. Done.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146507



More information about the cfe-commits mailing list