[PATCH] D128352: [clang][dataflow] Use diagnosis API in optional checker

Sam Estep via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 22 09:14:02 PDT 2022


samestep added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.cpp:58
       BlockToOutputState =
-          dataflow::runDataflowAnalysis(*Context, Analysis, Env);
+          dataflow::runTypeErasedDataflowAnalysis(*Context, Analysis, Env);
   if (!BlockToOutputState)
----------------
sgatev wrote:
> 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?
That wouldn't be easy to do, because `checkDataflow` in `TestingSupport.h` uses the type-erased API. But if you know how to change that to use the non-type-erased API, then we could probably change the signature of `diagnoseCFG`. I don't know how to do that, though.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128352/new/

https://reviews.llvm.org/D128352



More information about the cfe-commits mailing list