[clang][dataflow] Add `buildAndSubstituteFlowCondition` to `DataflowEnvironment`
authorWei Yi Tee <wyt@google.com>
Mon, 27 Jun 2022 19:05:36 +0000 (21:05 +0200)
committerDmitri Gribenko <gribozavr@gmail.com>
Mon, 27 Jun 2022 19:09:05 +0000 (21:09 +0200)
Depends On D128658

Reviewed By: gribozavr2, xazax.hun

Differential Revision: https://reviews.llvm.org/D128659

clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h

index 302e35d337e642205cb713b68288e4cb76e2c46c..ce195f0662f532ef5a9dba9776f2a17de3bdff05 100644 (file)
@@ -308,6 +308,16 @@ public:
   /// Returns the token that identifies the flow condition of the environment.
   AtomicBoolValue &getFlowConditionToken() const { return *FlowConditionToken; }
 
+  /// Builds and returns the logical formula defining the flow condition
+  /// identified by `Token`. If a value in the formula is present as a key in
+  /// `Substitutions`, it will be substituted with the value it maps to.
+  BoolValue &buildAndSubstituteFlowCondition(
+      AtomicBoolValue &Token,
+      llvm::DenseMap<AtomicBoolValue *, BoolValue *> Substitutions) {
+    return DACtx->buildAndSubstituteFlowCondition(Token,
+                                                  std::move(Substitutions));
+  }
+
   /// Adds `Val` to the set of clauses that constitute the flow condition.
   void addToFlowCondition(BoolValue &Val);