This patch splits AnalysisState into two classes: AbstractElement and AbstractState.
Now, AbstractState purely contains "facts" about the IR, whereas AbstractElement
contains all the dependency management. Crucially, this distinction allows two
version of AbstractElement, one which contains a single state and one which
contains a "main" state and several substates for analyses that are statically known
to produce values for that state.
SingleStateElement behaves the same as AnalysisState, but MultiStateElement
combines states produced by different analyses to support composability, allocating
a substate for each analysis statically known to produce that state.
The main things I would like feedback on are:
- the staticallyProvides function and whether there's a better way for analyses to indicate what they provide (it works but it's awkward to write)
- the rather complex class hierarchy that exists now with AbstractState, AbstractElement, and its two main implementations (confusing API)
- whether the update function is more ergonomic then manually calling propagateIfChanged
Depends on D128867
Maybe return const StateT &?