[clang][dataflow] Store flow condition constraints in a single `FlowConditionConstrai...
authorWei Yi Tee <wyt@google.com>
Fri, 24 Jun 2022 19:39:23 +0000 (21:39 +0200)
committerDmitri Gribenko <gribozavr@gmail.com>
Fri, 24 Jun 2022 19:52:16 +0000 (21:52 +0200)
commitfb88ea62602c90f8f7c80560fd6a14f1c8c6d520
tree61844f6c1938948bf4af93cf9921c11d74d0033a
parent11a8dd65ec604b59b79f64ee4b4874f439085514
[clang][dataflow] Store flow condition constraints in a single `FlowConditionConstraints` map.

A flow condition is represented with an atomic boolean token, and it is bound to a set of constraints: `(FC <=> C1 ^ C2 ^ ...)`. \
This was internally represented as `(FC v !C1 v !C2 v ...) ^ (C1 v !FC) ^ (C2 v !FC) ^ ...` and tracked by 2 maps:
- `FlowConditionFirstConjunct` stores the first conjunct `(FC v !C1 v !C2 v ...)`
- `FlowConditionRemainingConjuncts` stores the remaining conjuncts `(C1 v !FC) ^ (C2 v !FC) ^ ...`

This patch simplifies the tracking of the constraints by using a single `FlowConditionConstraints` map which stores `(C1 ^ C2 ^ ...)`, eliminating the use of two maps.

Reviewed By: gribozavr2, sgatev, xazax.hun

Differential Revision: https://reviews.llvm.org/D128357
clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h
clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp