[clang] 7ce010f - Revert "[clang][dataflow] Add an early-out to `flowConditionImplies()` / `flowConditionAllows()`." (#77570)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 10 01:50:19 PST 2024


Author: martinboehme
Date: 2024-01-10T10:50:16+01:00
New Revision: 7ce010f2fb01341ab253547324e126d81d47f794

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

LOG: Revert "[clang][dataflow] Add an early-out to `flowConditionImplies()` / `flowConditionAllows()`." (#77570)

Reverts llvm/llvm-project#77453

Added: 
    

Modified: 
    clang/include/clang/Analysis/FlowSensitive/Formula.h
    clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Analysis/FlowSensitive/Formula.h b/clang/include/clang/Analysis/FlowSensitive/Formula.h
index 0e6352403a832f..982e400c1deff1 100644
--- a/clang/include/clang/Analysis/FlowSensitive/Formula.h
+++ b/clang/include/clang/Analysis/FlowSensitive/Formula.h
@@ -75,10 +75,6 @@ class alignas(const Formula *) Formula {
     return static_cast<bool>(Value);
   }
 
-  bool isLiteral(bool b) const {
-    return kind() == Literal && static_cast<bool>(Value) == b;
-  }
-
   ArrayRef<const Formula *> operands() const {
     return ArrayRef(reinterpret_cast<Formula *const *>(this + 1),
                     numOperands(kind()));

diff  --git a/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp b/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp
index 500fbb39955d20..fa114979c8e326 100644
--- a/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp
+++ b/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp
@@ -174,9 +174,6 @@ Solver::Result DataflowAnalysisContext::querySolver(
 
 bool DataflowAnalysisContext::flowConditionImplies(Atom Token,
                                                    const Formula &F) {
-  if (F.isLiteral(true))
-    return true;
-
   // Returns true if and only if truth assignment of the flow condition implies
   // 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
@@ -191,9 +188,6 @@ bool DataflowAnalysisContext::flowConditionImplies(Atom Token,
 
 bool DataflowAnalysisContext::flowConditionAllows(Atom Token,
                                                   const Formula &F) {
-  if (F.isLiteral(true))
-    return true;
-
   llvm::SetVector<const Formula *> Constraints;
   Constraints.insert(&arena().makeAtomRef(Token));
   Constraints.insert(&F);


        


More information about the cfe-commits mailing list