[clang][dataflow] Use diagnosis API in optional checker
authorSam Estep <sam@samestep.com>
Wed, 29 Jun 2022 19:19:58 +0000 (19:19 +0000)
committerSam Estep <sam@samestep.com>
Wed, 29 Jun 2022 19:50:36 +0000 (19:50 +0000)
commit2adaca532df4d3d7ae4cd3b724b2099ffefe235c
tree298c4653789d447c32544877c0924ccf548fcc4a
parent2a33d12642d862a8aa307e4a8b8a94d2d0c5ad1d
[clang][dataflow] Use diagnosis API in optional checker

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.

Reviewed By: ymandel, sgatev, gribozavr2, xazax.hun

Differential Revision: https://reviews.llvm.org/D128352
clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.cpp
clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h