diff options
Diffstat (limited to 'clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp')
-rw-r--r-- | clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp b/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp index 6a1feb2..40de6cd 100644 --- a/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp +++ b/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp @@ -145,19 +145,28 @@ Solver::Result DataflowAnalysisContext::querySolver( } bool DataflowAnalysisContext::flowConditionImplies(Atom Token, - const Formula &Val) { + const Formula &F) { // Returns true if and only if truth assignment of the flow condition implies - // that `Val` is also true. We prove whether or not this property holds by + // that `F` is also true. We prove whether or not this property holds by // reducing the problem to satisfiability checking. In other words, we attempt - // to show that assuming `Val` is false makes the constraints induced by the + // to show that assuming `F` is false makes the constraints induced by the // flow condition unsatisfiable. llvm::SetVector<const Formula *> Constraints; Constraints.insert(&arena().makeAtomRef(Token)); - Constraints.insert(&arena().makeNot(Val)); + Constraints.insert(&arena().makeNot(F)); addTransitiveFlowConditionConstraints(Token, Constraints); return isUnsatisfiable(std::move(Constraints)); } +bool DataflowAnalysisContext::flowConditionAllows(Atom Token, + const Formula &F) { + llvm::SetVector<const Formula *> Constraints; + Constraints.insert(&arena().makeAtomRef(Token)); + Constraints.insert(&F); + addTransitiveFlowConditionConstraints(Token, Constraints); + return isSatisfiable(std::move(Constraints)); +} + bool DataflowAnalysisContext::equivalentFormulas(const Formula &Val1, const Formula &Val2) { llvm::SetVector<const Formula *> Constraints; |