xazax.hun added inline comments.

================
Comment at: clang/unittests/Analysis/FlowSensitive/TestingSupport.h:48
+                              << std::declval<const Lattice &>())>
+std::ostream &operator<<(std::ostream &OS,
+                         const DataflowAnalysisState<Lattice> &S) {
----------------
This would also be useful for debugging. I wonder whether utilities not 
strictly related to testing should be closer to the actual code, so someone 
wanting to use this for debugging does not need to include the header that is 
dedicated to the tests.


================
Comment at: clang/unittests/Analysis/FlowSensitive/TestingSupport.h:77
+// the files provided in `VirtualMappedFiles`.
+bool runOnCode(llvm::StringRef Code,
+               const std::function<void(ASTContext &)> &Operation,
----------------
I feel like some of our tests keep recreating lightweight versions of the 
LibTooling. Not really an action item for this PR, just a rant :) I hope we 
will have some more centralized stuff at some point. 


================
Comment at: clang/unittests/Analysis/FlowSensitive/TestingSupport.h:94
+template <typename AnalysisT>
+void runDataflow(
+    llvm::StringRef Code,
----------------
Since this function is actually matching the dataflow results against 
expectations, I wonder if something like `checkDataflow` would better describe 
its function. But feel free to keep the current name.


================
Comment at: clang/unittests/Analysis/FlowSensitive/TestingSupport.h:137
+            TypeErasedBlockStates =
+                runTypeErasedDataflowAnalysis(*cfg, Analysis, Env);
+
----------------
Wouldn't users end up calling the template (not the type erased) version of 
this function? I wonder if we should mimic how users would interact with the 
framework in the tests.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115341

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to