[clang] ae90bc8 - [clang][dataflow] Add `buildAndSubstituteFlowCondition` to `DataflowEnvironment`

Dmitri Gribenko via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 27 12:09:11 PDT 2022


Author: Wei Yi Tee
Date: 2022-06-27T21:09:05+02:00
New Revision: ae90bc8467589cbc2079b93fae2b6ceec0821e27

URL: https://github.com/llvm/llvm-project/commit/ae90bc8467589cbc2079b93fae2b6ceec0821e27
DIFF: https://github.com/llvm/llvm-project/commit/ae90bc8467589cbc2079b93fae2b6ceec0821e27.diff

LOG: [clang][dataflow] Add `buildAndSubstituteFlowCondition` to `DataflowEnvironment`

Depends On D128658

Reviewed By: gribozavr2, xazax.hun

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h b/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h
index 302e35d337e64..ce195f0662f53 100644
--- a/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h
+++ b/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h
@@ -308,6 +308,16 @@ class Environment {
   /// 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);
 


        


More information about the cfe-commits mailing list