[PATCH] D128359: [clang][dataflow] Move logic for `createStorageLocation` from `DataflowEnvironment` to `DataflowAnalysisContext`.
Stanislav Gatev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 22 10:31:08 PDT 2022
sgatev added inline comments.
================
Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:91-92
+ // FIXME: Rename `createOrGetStorageLocation` to `getOrCreateStorageLocation`,
+ // `getStableStorageLocation`, or something more appropriate.
+
----------------
Let's implement this for the new members you are adding and keep the existing members in `DataflowEnvironment` as they are. I suggest calling the new ones `getStableStorageLocation`.
================
Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:94-95
+
+ /// Creates a storage location appropriate for `Type`. Does not assign a value
+ /// to the returned storage location in the environment.
+ ///
----------------
================
Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:102-104
+ /// Creates a storage location for `D`. Does not assign the returned storage
+ /// location to `D` in the environment. Does not assign a value to the
+ /// returned storage location in the environment.
----------------
================
Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:107-109
+ /// Creates a storage location for `E`. Does not assign the returned storage
+ /// location to `E` in the environment. Does not assign a value to the
+ /// returned storage location in the environment.
----------------
================
Comment at: clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp:41-43
+ // Evaluated declarations are always assigned the same storage locations to
+ // ensure that the environment stabilizes across loop iterations. Storage
+ // locations for evaluated declarations are stored in the analysis context.
----------------
I think it makes sense to keep this comment in the wrapper in `DataflowEnvironment`. Same for the one below.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D128359/new/
https://reviews.llvm.org/D128359
More information about the cfe-commits
mailing list