samestep updated this revision to Diff 439045.
samestep added a comment.

Comment Diagnosis.h and add missing headers


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127898

Files:
  clang/include/clang/Analysis/FlowSensitive/Diagnosis.h


Index: clang/include/clang/Analysis/FlowSensitive/Diagnosis.h
===================================================================
--- clang/include/clang/Analysis/FlowSensitive/Diagnosis.h
+++ clang/include/clang/Analysis/FlowSensitive/Diagnosis.h
@@ -18,14 +18,22 @@
 #include "clang/Analysis/FlowSensitive/DataflowEnvironment.h"
 #include "clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h"
 #include "llvm/ADT/DenseSet.h"
+#include "llvm/ADT/Optional.h"
+#include <functional>
+#include <utility>
+#include <vector>
 
 namespace clang {
 namespace dataflow {
 
+/// Looks at a single statement using the `Lattice` and `Environment` at that
+/// program point from running a dataflow analysis, and returns any 
diagnostics.
 template <typename Lattice, typename Diags>
 using Diagnosis =
     std::function<Diags(const Stmt *, const Lattice &, const Environment &)>;
 
+/// Collects diagnostics from all blocks in a CFG, given some dataflow analysis
+/// results and a `Diagnose` function which can be run on individual 
statements.
 template <typename Lattice, typename Diag>
 llvm::DenseSet<Diag> diagnoseCFG(
     const ControlFlowContext &CFCtx,


Index: clang/include/clang/Analysis/FlowSensitive/Diagnosis.h
===================================================================
--- clang/include/clang/Analysis/FlowSensitive/Diagnosis.h
+++ clang/include/clang/Analysis/FlowSensitive/Diagnosis.h
@@ -18,14 +18,22 @@
 #include "clang/Analysis/FlowSensitive/DataflowEnvironment.h"
 #include "clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h"
 #include "llvm/ADT/DenseSet.h"
+#include "llvm/ADT/Optional.h"
+#include <functional>
+#include <utility>
+#include <vector>
 
 namespace clang {
 namespace dataflow {
 
+/// Looks at a single statement using the `Lattice` and `Environment` at that
+/// program point from running a dataflow analysis, and returns any diagnostics.
 template <typename Lattice, typename Diags>
 using Diagnosis =
     std::function<Diags(const Stmt *, const Lattice &, const Environment &)>;
 
+/// Collects diagnostics from all blocks in a CFG, given some dataflow analysis
+/// results and a `Diagnose` function which can be run on individual statements.
 template <typename Lattice, typename Diag>
 llvm::DenseSet<Diag> diagnoseCFG(
     const ControlFlowContext &CFCtx,
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to