[clang] [clang][dataflow] Process terminator condition within `transferCFGBlock()`. (PR #78127)

Yitzhak Mandelbaum via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 18 05:09:33 PST 2024


================
@@ -25,10 +25,17 @@ namespace dataflow {
 /// Maps statements to the environments of basic blocks that contain them.
 class StmtToEnvMap {
 public:
+  // `CurBlock` is the block currently being processed, and `CurState` is the
+  // pending state currently associated with this block. These are supplied
+  // separately as the pending state for the current block may not yet be
+  // represented in `BlockToState`.
   StmtToEnvMap(const ControlFlowContext &CFCtx,
                llvm::ArrayRef<std::optional<TypeErasedDataflowAnalysisState>>
-                   BlockToState)
-      : CFCtx(CFCtx), BlockToState(BlockToState) {}
+                   BlockToState,
+               const CFGBlock &CurBlock,
----------------
ymand wrote:

What about storing just the ID instead? That seems to more directly express the use of the data (which is just to check for identity rather than any deeper use).

https://github.com/llvm/llvm-project/pull/78127


More information about the cfe-commits mailing list