[PATCH] D128354: Comment Diagnosis.h and add missing headers

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

samestep created this revision.
Herald added a project: All.
samestep requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

  rG LLVM Github Monorepo



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,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128354.439044.patch
Type: text/x-patch
Size: 1158 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220622/204a102b/attachment.bin>

More information about the cfe-commits mailing list