Followup to D127898. This patch updates bugprone-unchecked-optional-access to use the new diagnoseCFG function instead of just looking at the exit block.
A followup to this will update the optional model itself to use a noop lattice rather than redundantly computing the diagnostics in both phases of the analysis.
I think the typed API should still be preferred unless we make a call to drop it. The type-erased API is only used internally in the dataflow analysis framework. I suggest taking a DataflowAnalysisState<Lattice> in diagnoseCFG instead of TypeErasedDataflowAnalysisState for now. Would that work?