[PATCH] D144730: [FlowSensitive] Log analysis progress for debugging purposes

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 21 11:36:28 PDT 2023


sammccall added a reviewer: xazax.hun.
sammccall added a comment.
Herald added a subscriber: rnkovacs.

Thanks! I cleaned up a bit and added tests, as well as a `-dataflow-log` flag to make this easy to access when running unit tests, tidy checks etc.
The HTML experiments seem to have validated that the logging API is sufficient to produce something useful there.

I think this is ready for proper review now.



================
Comment at: clang/include/clang/Analysis/FlowSensitive/Logger.h:38
+  // Forms a pair with endAnalysis().
+  virtual void beginAnalysis(const ControlFlowContext &,
+                             TypeErasedDataflowAnalysis &) {}
----------------
gribozavr2 wrote:
> Why not DataflowAnalysisContext instead of ControlFlowContext?
> 
> You can reach the latter from the former, but not vice versa.
The idea here is "we're starting to analyze a CFG", so passing in the CFG is what we need and seems natural.
DataflowAnalysisContext provides more facilities than we need, and none of the extra stuff seems useful.
It's also more awkward to use for our purposes (you can get the CFG, but only if you know the right FunctionDecl, and the framework is unclear about whether there's always a FunctionDecl).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144730



More information about the cfe-commits mailing list