[llvm-branch-commits] [clang] 038c85c - Revert "[clang][dataflow] Add an early-out to `flowConditionImplies()` / `flowConditionAllows()`. (#77453)"
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Jan 10 01:49:50 PST 2024
Author: martinboehme
Date: 2024-01-10T10:49:45+01:00
New Revision: 038c85ca9733404a67c0f328f268ca0124cf5b17
URL: https://github.com/llvm/llvm-project/commit/038c85ca9733404a67c0f328f268ca0124cf5b17
DIFF: https://github.com/llvm/llvm-project/commit/038c85ca9733404a67c0f328f268ca0124cf5b17.diff
LOG: Revert "[clang][dataflow] Add an early-out to `flowConditionImplies()` / `flowConditionAllows()`. (#77453)"
This reverts commit 03a0bfa96a6eb09c4bbae344ac3aa062339aa730.
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 llvm-branch-commits
mailing list