diff options
author | Sam McCall <sam.mccall@gmail.com> | 2023-06-22 02:05:12 +0200 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2023-09-22 17:12:20 +0200 |
commit | 36bd5bd888f193b70abf43a09bb4fc04cd2a2ff1 (patch) | |
tree | 3caa8b42040ceeadbbc0f6916fa64376d808092e /clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp | |
parent | 17649a7726d3ce1ddba2bbf3ef73af03ea204753 (diff) | |
download | llvm-36bd5bd888f193b70abf43a09bb4fc04cd2a2ff1.zip llvm-36bd5bd888f193b70abf43a09bb4fc04cd2a2ff1.tar.gz llvm-36bd5bd888f193b70abf43a09bb4fc04cd2a2ff1.tar.bz2 |
[dataflow] use true/false literals in formulas, rather than variables
And simplify formulas containing true/false
It's unclear to me how useful this is, it does make formulas more
conveniently self-contained now (we can usefully print them without
carrying around the "true/false" labels)
(while here, simplify !!X to X, too)
Differential Revision: https://reviews.llvm.org/D153485
Diffstat (limited to 'clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp')
-rw-r--r-- | clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp b/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp index e81048c..28a8595 100644 --- a/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp +++ b/clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp @@ -141,8 +141,6 @@ DataflowAnalysisContext::joinFlowConditions(Atom FirstToken, Solver::Result DataflowAnalysisContext::querySolver( llvm::SetVector<const Formula *> Constraints) { - Constraints.insert(&arena().makeLiteral(true)); - Constraints.insert(&arena().makeNot(arena().makeLiteral(false))); return S->solve(Constraints.getArrayRef()); } @@ -213,13 +211,8 @@ void DataflowAnalysisContext::dumpFlowCondition(Atom Token, Constraints.insert(&arena().makeAtomRef(Token)); addTransitiveFlowConditionConstraints(Token, Constraints); - // TODO: have formulas know about true/false directly instead - Atom True = arena().makeLiteral(true).getAtom(); - Atom False = arena().makeLiteral(false).getAtom(); - Formula::AtomNames Names = {{False, "false"}, {True, "true"}}; - for (const auto *Constraint : Constraints) { - Constraint->print(OS, &Names); + Constraint->print(OS); OS << "\n"; } } |