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

Martin Böhme via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 21 04:41:10 PDT 2023


mboehme added inline comments.


================
Comment at: clang/include/clang/Analysis/FlowSensitive/Transfer.h:31
-  /// there isn't one.
-  /// FIXME: Ensure that the result can't be null and return a const reference.
-  virtual const Environment *getEnvironment(const Stmt &S) const = 0;
----------------
gribozavr2 wrote:
> Could you move the comment to the new declaration of this function?
Oops, done. Thanks for catching!


================
Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:135
+/// there isn't one.
+/// The result is guaranteed never to be null.
+static const Environment *getEnvironment(const Stmt &S,
----------------
I'm not changing the return type of `getEnvironment()` to a reference because https://reviews.llvm.org/D146514 (in review) makes a change that will cause `getEnvironment()` to return nullptr if `S` is not reachable, and I want to avoid churn on the return type. (There will be a conflict between the two changes anyway, and I'll deal with that once the first of the changes has landed.)


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