[PATCH] D127898: [clang][dataflow] Add API to separate analysis from diagnosis

Sam Estep via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 24 08:16:37 PDT 2022


samestep marked an inline comment as done.
samestep added inline comments.


================
Comment at: clang/include/clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h:85
+private:
+  ASTContext &Context;
+  MatchSwitch<DiagnoseState<llvm::DenseSet<SourceLocation>>>
----------------
samestep wrote:
> xazax.hun wrote:
> > Do we expect this to modify the ASTContext? Could this be a const ref instead?
> I'd guess it shouldn't; I was mostly just copying the `ASTContext &` field from the `DataflowAnalysis` class, which is not `const`. I can try changing it to `const` here, though.
@xazax.hun Coming back to this today, I remembered why it has to be `ASTContext &` and not `const ASTContext &`: because `MatchSwitch` requires it to not be `const`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127898



More information about the cfe-commits mailing list