<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
Hmm, indeed, thanks for reverting, i'll get this fixed.<br>
<br>
Weird that i'm not getting any compile errors locally or from
buildbots. Shared libs buildbots are usually very loud about this
stuff.<br>
<br>
<div class="moz-cite-prefix">On 12/11/20 12:51 AM, Haojian Wu wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAGQTG1YzD5nr-=aTwNNFsuZ9Y-ckgQ9FB+4GLQZpcCirf9+osg@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Hi Artem,
<div><br>
</div>
<div>Looks like this patch has some layer violations, I tried to
fix that but there is a main issue not easy to fix -- the
issue is that there is a cycle dependency:</div>
<div><br>
</div>
<div>1. PlistPathDiagnosticConsumer.cpp (now being moved to
clangAnalysis target), and this file calls a method from
clang::ASTUnit, so <b>clangAnalysis</b> should depend on <b>clangFrontend</b>
(this is not listed in the CMake file).<br>
</div>
<div>2. <b>clangFrontend</b> depends on <b>clangSema</b></div>
<div>3. <b>clangSema</b> depends on <b>clangAnalysis</b></div>
<div><b><br>
</b></div>
<div>I'm going to revert this patch (to unblock our integration,
sorry), feel free to land it again if you fix the issue.
Thanks!</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Thu, Dec 10, 2020 at 8:03
PM Artem Dergachev via cfe-commits <<a
href="mailto:cfe-commits@lists.llvm.org"
moz-do-not-send="true">cfe-commits@lists.llvm.org</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Author: Artem Dergachev<br>
Date: 2020-12-10T11:02:54-08:00<br>
New Revision: ea6641085d025ca0a5cef940465ef14d0ccace02<br>
<br>
URL: <a
href="https://github.com/llvm/llvm-project/commit/ea6641085d025ca0a5cef940465ef14d0ccace02"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://github.com/llvm/llvm-project/commit/ea6641085d025ca0a5cef940465ef14d0ccace02</a><br>
DIFF: <a
href="https://github.com/llvm/llvm-project/commit/ea6641085d025ca0a5cef940465ef14d0ccace02.diff"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://github.com/llvm/llvm-project/commit/ea6641085d025ca0a5cef940465ef14d0ccace02.diff</a><br>
<br>
LOG: Revert "Revert "Revert "Revert "[analyzer] NFC: Move path
diagnostic consumer implementations to libAnalysis.""""<br>
<br>
This reverts commit 6a89cb8136f3435bd977b419b683dc0acc98e61e.<br>
<br>
Added: <br>
  clang/include/clang/Analysis/PathDiagnosticConsumers.def<br>
  clang/include/clang/Analysis/PathDiagnosticConsumers.h<br>
  clang/lib/Analysis/HTMLPathDiagnosticConsumer.cpp<br>
  clang/lib/Analysis/PlistHTMLPathDiagnosticConsumer.cpp<br>
  clang/lib/Analysis/PlistPathDiagnosticConsumer.cpp<br>
  clang/lib/Analysis/SarifPathDiagnosticConsumer.cpp<br>
  clang/lib/Analysis/TextPathDiagnosticConsumer.cpp<br>
<br>
Modified: <br>
  clang/include/clang/StaticAnalyzer/Core/Analyses.def<br>
  clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h<br>
 Â
clang/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h<br>
  clang/include/clang/module.modulemap<br>
  clang/lib/Analysis/CMakeLists.txt<br>
  clang/lib/Frontend/CompilerInvocation.cpp<br>
  clang/lib/StaticAnalyzer/Core/CMakeLists.txt<br>
  clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp<br>
<br>
Removed: <br>
 Â
clang/include/clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h<br>
  clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp<br>
  clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp<br>
  clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp<br>
  clang/lib/StaticAnalyzer/Core/TextDiagnostics.cpp<br>
<br>
<br>
################################################################################<br>
diff --git
a/clang/include/clang/Analysis/PathDiagnosticConsumers.def
b/clang/include/clang/Analysis/PathDiagnosticConsumers.def<br>
new file mode 100644<br>
index 000000000000..33d2072fcf31<br>
--- /dev/null<br>
+++ b/clang/include/clang/Analysis/PathDiagnosticConsumers.def<br>
@@ -0,0 +1,50 @@<br>
+//===-- PathDiagnosticConsumers.def - Visualizing warnings
------*- C++ -*-===//<br>
+//<br>
+// Part of the LLVM Project, under the Apache License v2.0
with LLVM Exceptions.<br>
+// See <a href="https://llvm.org/LICENSE.txt"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://llvm.org/LICENSE.txt</a>
for license information.<br>
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception<br>
+//<br>
+//===----------------------------------------------------------------------===//<br>
+//<br>
+// This file defines the set of path diagnostic consumers -
objects that<br>
+// implement <br>
diff erent representations of static analysis results.<br>
+//<br>
+//===----------------------------------------------------------------------===//<br>
+<br>
+#ifndef ANALYSIS_DIAGNOSTICS<br>
+#define ANALYSIS_DIAGNOSTICS(NAME, CMDFLAG, DESC, CREATEFN)<br>
+#endif<br>
+<br>
+ANALYSIS_DIAGNOSTICS(HTML, "html", "Output analysis results
using HTML",<br>
+Â Â Â Â Â Â Â Â Â Â Â createHTMLDiagnosticConsumer)<br>
+<br>
+ANALYSIS_DIAGNOSTICS(<br>
+Â Â HTML_SINGLE_FILE, "html-single-file",<br>
+Â Â "Output analysis results using HTML (not allowing for
multi-file bugs)",<br>
+Â Â createHTMLSingleFileDiagnosticConsumer)<br>
+<br>
+ANALYSIS_DIAGNOSTICS(PLIST, "plist", "Output analysis results
using Plists",<br>
+Â Â Â Â Â Â Â Â Â Â Â createPlistDiagnosticConsumer)<br>
+<br>
+ANALYSIS_DIAGNOSTICS(<br>
+Â Â PLIST_MULTI_FILE, "plist-multi-file",<br>
+Â Â "Output analysis results using Plists (allowing for
multi-file bugs)",<br>
+Â Â createPlistMultiFileDiagnosticConsumer)<br>
+<br>
+ANALYSIS_DIAGNOSTICS(PLIST_HTML, "plist-html",<br>
+Â Â Â Â Â Â Â Â Â Â Â "Output analysis results using HTML
wrapped with Plists",<br>
+Â Â Â Â Â Â Â Â Â Â Â createPlistHTMLDiagnosticConsumer)<br>
+<br>
+ANALYSIS_DIAGNOSTICS(SARIF, "sarif", "Output analysis results
in a SARIF file",<br>
+Â Â Â Â Â Â Â Â Â Â Â createSarifDiagnosticConsumer)<br>
+<br>
+ANALYSIS_DIAGNOSTICS(TEXT, "text", "Text output of analysis
results to stderr",<br>
+Â Â Â Â Â Â Â Â Â Â Â createTextPathDiagnosticConsumer)<br>
+<br>
+ANALYSIS_DIAGNOSTICS(TEXT_MINIMAL, "text-minimal",<br>
+Â Â Â Â Â Â Â Â Â Â Â "Emits minimal diagnostics to stderr,
stating only the "<br>
+Â Â Â Â Â Â Â Â Â Â Â "warning message and the associated
notes. Usually "<br>
+Â Â Â Â Â Â Â Â Â Â Â "used in addition to other analysis
types",<br>
+Â Â Â Â Â Â Â Â Â Â Â createTextMinimalPathDiagnosticConsumer)<br>
+<br>
+#undef ANALYSIS_DIAGNOSTICS<br>
<br>
diff --git
a/clang/include/clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h
b/clang/include/clang/Analysis/PathDiagnosticConsumers.h<br>
similarity index 89%<br>
rename from
clang/include/clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h<br>
rename to
clang/include/clang/Analysis/PathDiagnosticConsumers.h<br>
index f40f88eb32ff..9f23bea1b4c1 100644<br>
---
a/clang/include/clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h<br>
+++ b/clang/include/clang/Analysis/PathDiagnosticConsumers.h<br>
@@ -18,6 +18,8 @@<br>
 #include <string><br>
 #include <vector><br>
<br>
+#include "clang/Analysis/PathDiagnostic.h"<br>
+<br>
 namespace clang {<br>
<br>
 class AnalyzerOptions;<br>
@@ -29,14 +31,14 @@ class CrossTranslationUnitContext;<br>
 namespace ento {<br>
<br>
 class PathDiagnosticConsumer;<br>
-typedef std::vector<PathDiagnosticConsumer*>
PathDiagnosticConsumers;<br>
+typedef std::vector<PathDiagnosticConsumer *>
PathDiagnosticConsumers;<br>
<br>
 #define ANALYSIS_DIAGNOSTICS(NAME, CMDFLAG, DESC, CREATEFN)Â
         \<br>
  void CREATEFN(PathDiagnosticConsumerOptions Diagopts,  Â
         \<br>
         PathDiagnosticConsumers &C, const
std::string &Prefix,     \<br>
         const Preprocessor &PP,        Â
           \<br>
         const cross_tu::CrossTranslationUnitContext
&CTU);<br>
-#include "clang/StaticAnalyzer/Core/Analyses.def"<br>
+#include "clang/Analysis/PathDiagnosticConsumers.def"<br>
<br>
 } // end 'ento' namespace<br>
 } // end 'clang' namespace<br>
<br>
diff --git
a/clang/include/clang/StaticAnalyzer/Core/Analyses.def
b/clang/include/clang/StaticAnalyzer/Core/Analyses.def<br>
index c4e5f5be6fd7..2e98cbba4c9e 100644<br>
--- a/clang/include/clang/StaticAnalyzer/Core/Analyses.def<br>
+++ b/clang/include/clang/StaticAnalyzer/Core/Analyses.def<br>
@@ -28,42 +28,6 @@ ANALYSIS_CONSTRAINTS(RangeConstraints,
"range",<br>
 ANALYSIS_CONSTRAINTS(Z3Constraints, "z3", "Use Z3 contraint
solver",<br>
           CreateZ3ConstraintManager)<br>
<br>
-#ifndef ANALYSIS_DIAGNOSTICS<br>
-#define ANALYSIS_DIAGNOSTICS(NAME, CMDFLAG, DESC, CREATEFN)<br>
-#endif<br>
-<br>
-ANALYSIS_DIAGNOSTICS(HTML, "html", "Output analysis results
using HTML",<br>
-Â Â Â Â Â Â Â Â Â Â Â createHTMLDiagnosticConsumer)<br>
-<br>
-ANALYSIS_DIAGNOSTICS(<br>
-Â Â HTML_SINGLE_FILE, "html-single-file",<br>
-Â Â "Output analysis results using HTML (not allowing for
multi-file bugs)",<br>
-Â Â createHTMLSingleFileDiagnosticConsumer)<br>
-<br>
-ANALYSIS_DIAGNOSTICS(PLIST, "plist", "Output analysis results
using Plists",<br>
-Â Â Â Â Â Â Â Â Â Â Â createPlistDiagnosticConsumer)<br>
-<br>
-ANALYSIS_DIAGNOSTICS(<br>
-Â Â PLIST_MULTI_FILE, "plist-multi-file",<br>
-Â Â "Output analysis results using Plists (allowing for
multi-file bugs)",<br>
-Â Â createPlistMultiFileDiagnosticConsumer)<br>
-<br>
-ANALYSIS_DIAGNOSTICS(PLIST_HTML, "plist-html",<br>
-Â Â Â Â Â Â Â Â Â Â Â "Output analysis results using HTML
wrapped with Plists",<br>
-Â Â Â Â Â Â Â Â Â Â Â createPlistHTMLDiagnosticConsumer)<br>
-<br>
-ANALYSIS_DIAGNOSTICS(SARIF, "sarif", "Output analysis results
in a SARIF file",<br>
-Â Â Â Â Â Â Â Â Â Â Â createSarifDiagnosticConsumer)<br>
-<br>
-ANALYSIS_DIAGNOSTICS(TEXT, "text", "Text output of analysis
results to stderr",<br>
-Â Â Â Â Â Â Â Â Â Â Â createTextPathDiagnosticConsumer)<br>
-<br>
-ANALYSIS_DIAGNOSTICS(TEXT_MINIMAL, "text-minimal",<br>
-Â Â Â Â Â Â Â Â Â Â Â "Emits minimal diagnostics to stderr,
stating only the "<br>
-Â Â Â Â Â Â Â Â Â Â Â "warning message and the associated
notes. Usually "<br>
-Â Â Â Â Â Â Â Â Â Â Â "used in addition to other analysis
types",<br>
-Â Â Â Â Â Â Â Â Â Â Â createTextMinimalPathDiagnosticConsumer)<br>
-<br>
 #ifndef ANALYSIS_PURGE<br>
 #define ANALYSIS_PURGE(NAME, CMDFLAG, DESC)<br>
 #endif<br>
@@ -91,7 +55,6 @@ ANALYSIS_INLINING_MODE(<br>
<br>
 #undef ANALYSIS_STORE<br>
 #undef ANALYSIS_CONSTRAINTS<br>
-#undef ANALYSIS_DIAGNOSTICS<br>
 #undef ANALYSIS_PURGE<br>
 #undef ANALYSIS_INLINING_MODE<br>
 #undef ANALYSIS_IPA<br>
<br>
diff --git
a/clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
b/clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h<br>
index e1093772e02c..aa334fed41fb 100644<br>
---
a/clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h<br>
+++
b/clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h<br>
@@ -58,7 +58,7 @@ NumConstraints<br>
 /// analysis results.<br>
 enum AnalysisDiagClients {<br>
 #define ANALYSIS_DIAGNOSTICS(NAME, CMDFLAG, DESC, CREATFN)
PD_##NAME,<br>
-#include "clang/StaticAnalyzer/Core/Analyses.def"<br>
+#include "clang/Analysis/PathDiagnosticConsumers.def"<br>
 PD_NONE,<br>
 NUM_ANALYSIS_DIAG_CLIENTS<br>
 };<br>
<br>
diff --git
a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h
b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h<br>
index c76e9c0326af..7e8b9de3a942 100644<br>
---
a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h<br>
+++
b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h<br>
@@ -16,10 +16,10 @@<br>
<br>
 #include "clang/Analysis/AnalysisDeclContext.h"<br>
 #include "clang/Analysis/PathDiagnostic.h"<br>
+#include "clang/Analysis/PathDiagnosticConsumers.h"<br>
 #include "clang/Lex/Preprocessor.h"<br>
 #include "clang/StaticAnalyzer/Core/AnalyzerOptions.h"<br>
 #include
"clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"<br>
-#include
"clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h"<br>
<br>
 namespace clang {<br>
<br>
<br>
diff --git a/clang/include/clang/module.modulemap
b/clang/include/clang/module.modulemap<br>
index 332e533f0347..ec396e1532e0 100644<br>
--- a/clang/include/clang/module.modulemap<br>
+++ b/clang/include/clang/module.modulemap<br>
@@ -3,6 +3,7 @@ module Clang_Analysis {<br>
  umbrella "Analysis"<br>
<br>
  textual header "Analysis/Analyses/ThreadSafetyOps.def"<br>
+Â textual header "Analysis/PathDiagnosticConsumers.def"<br>
<br>
  module * { export * }<br>
<br>
<br>
diff --git a/clang/lib/Analysis/CMakeLists.txt
b/clang/lib/Analysis/CMakeLists.txt<br>
index 6cad671a8a4d..a06e68835bc0 100644<br>
--- a/clang/lib/Analysis/CMakeLists.txt<br>
+++ b/clang/lib/Analysis/CMakeLists.txt<br>
@@ -17,14 +17,19 @@ add_clang_library(clangAnalysis<br>
  CodeInjector.cpp<br>
  Dominators.cpp<br>
  ExprMutationAnalyzer.cpp<br>
+Â HTMLPathDiagnosticConsumer.cpp<br>
  IssueHash.cpp<br>
  LiveVariables.cpp<br>
  ObjCNoReturn.cpp<br>
  PathDiagnostic.cpp<br>
+Â PlistPathDiagnosticConsumer.cpp<br>
+Â PlistHTMLPathDiagnosticConsumer.cpp<br>
  PostOrderCFGView.cpp<br>
  ProgramPoint.cpp<br>
  ReachableCode.cpp<br>
  RetainSummaryManager.cpp<br>
+Â SarifPathDiagnosticConsumer.cpp<br>
+Â TextPathDiagnosticConsumer.cpp<br>
  ThreadSafety.cpp<br>
  ThreadSafetyCommon.cpp<br>
  ThreadSafetyLogical.cpp<br>
@@ -36,6 +41,8 @@ add_clang_library(clangAnalysis<br>
  clangASTMatchers<br>
  clangBasic<br>
  clangLex<br>
+Â clangRewrite<br>
+Â clangToolingCore<br>
<br>
  DEPENDS<br>
  omp_gen<br>
<br>
diff --git
a/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
b/clang/lib/Analysis/HTMLPathDiagnosticConsumer.cpp<br>
similarity index 91%<br>
rename from clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp<br>
rename to clang/lib/Analysis/HTMLPathDiagnosticConsumer.cpp<br>
index 149459cf986a..de1a96ed283f 100644<br>
--- a/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp<br>
+++ b/clang/lib/Analysis/HTMLPathDiagnosticConsumer.cpp<br>
@@ -1,4 +1,4 @@<br>
-//===- HTMLDiagnostics.cpp - HTML Diagnostics for Paths
-------------------===//<br>
+//===- HTMLPathDiagnosticConsumer.cpp - HTML Diagnostics for
Paths --------===//<br>
 //<br>
 // Part of the LLVM Project, under the Apache License v2.0
with LLVM Exceptions.<br>
 // See <a href="https://llvm.org/LICENSE.txt"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://llvm.org/LICENSE.txt</a>
for license information.<br>
@@ -6,12 +6,13 @@<br>
 //<br>
 //===----------------------------------------------------------------------===//<br>
 //<br>
-//Â This file defines the HTMLDiagnostics object.<br>
+//Â This file defines the HTMLPathDiagnosticConsumer object.<br>
 //<br>
 //===----------------------------------------------------------------------===//<br>
<br>
 #include "clang/Analysis/IssueHash.h"<br>
 #include "clang/Analysis/PathDiagnostic.h"<br>
+#include "clang/Analysis/PathDiagnosticConsumers.h"<br>
 #include "clang/AST/Decl.h"<br>
 #include "clang/AST/DeclBase.h"<br>
 #include "clang/AST/Stmt.h"<br>
@@ -24,7 +25,6 @@<br>
 #include "clang/Lex/Token.h"<br>
 #include "clang/Rewrite/Core/HTMLRewrite.h"<br>
 #include "clang/Rewrite/Core/Rewriter.h"<br>
-#include
"clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h"<br>
 #include "llvm/ADT/ArrayRef.h"<br>
 #include "llvm/ADT/SmallString.h"<br>
 #include "llvm/ADT/StringRef.h"<br>
@@ -56,7 +56,7 @@ using namespace ento;<br>
<br>
 namespace {<br>
<br>
-class HTMLDiagnostics : public PathDiagnosticConsumer {<br>
+class HTMLPathDiagnosticConsumer : public
PathDiagnosticConsumer {<br>
  PathDiagnosticConsumerOptions DiagOpts;<br>
  std::string Directory;<br>
  bool createdDir = false;<br>
@@ -65,20 +65,18 @@ class HTMLDiagnostics : public
PathDiagnosticConsumer {<br>
  const bool SupportsCrossFileDiagnostics;<br>
<br>
 public:<br>
-Â HTMLDiagnostics(PathDiagnosticConsumerOptions DiagOpts,<br>
-Â Â Â Â Â Â Â Â Â const std::string &OutputDir, const
Preprocessor &pp,<br>
-Â Â Â Â Â Â Â Â Â bool supportsMultipleFiles)<br>
-Â Â Â : DiagOpts(std::move(DiagOpts)), Directory(OutputDir),
PP(pp),<br>
-Â Â Â Â SupportsCrossFileDiagnostics(supportsMultipleFiles)
{}<br>
+Â HTMLPathDiagnosticConsumer(PathDiagnosticConsumerOptions
DiagOpts,<br>
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â const std::string
&OutputDir,<br>
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â const Preprocessor &PP, bool
SupportsMultipleFiles)<br>
+Â Â Â : DiagOpts(std::move(DiagOpts)), Directory(OutputDir),
PP(PP),<br>
+Â Â Â Â SupportsCrossFileDiagnostics(SupportsMultipleFiles)
{}<br>
<br>
-Â ~HTMLDiagnostics() override { FlushDiagnostics(nullptr); }<br>
+Â ~HTMLPathDiagnosticConsumer() override {
FlushDiagnostics(nullptr); }<br>
<br>
  void FlushDiagnosticsImpl(std::vector<const
PathDiagnostic *> &Diags,<br>
               FilesMade *filesMade) override;<br>
<br>
-Â StringRef getName() const override {<br>
-Â Â return "HTMLDiagnostics";<br>
-Â }<br>
+Â StringRef getName() const override { return
"HTMLPathDiagnosticConsumer"; }<br>
<br>
  bool supportsCrossFileDiagnostics() const override {<br>
   return SupportsCrossFileDiagnostics;<br>
@@ -148,7 +146,8 @@ void ento::createHTMLDiagnosticConsumer(<br>
  if (OutputDir.empty())<br>
   return;<br>
<br>
-Â C.push_back(new HTMLDiagnostics(std::move(DiagOpts),
OutputDir, PP, true));<br>
+Â C.push_back(<br>
+Â Â Â new HTMLPathDiagnosticConsumer(std::move(DiagOpts),
OutputDir, PP, true));<br>
 }<br>
<br>
 void ento::createHTMLSingleFileDiagnosticConsumer(<br>
@@ -161,34 +160,22 @@ void
ento::createHTMLSingleFileDiagnosticConsumer(<br>
  if (OutputDir.empty())<br>
   return;<br>
<br>
-Â C.push_back(new HTMLDiagnostics(std::move(DiagOpts),
OutputDir, PP, false));<br>
-}<br>
-<br>
-void ento::createPlistHTMLDiagnosticConsumer(<br>
-Â Â PathDiagnosticConsumerOptions DiagOpts,
PathDiagnosticConsumers &C,<br>
-Â Â const std::string &prefix, const Preprocessor
&PP,<br>
-Â Â const cross_tu::CrossTranslationUnitContext &CTU) {<br>
-Â createHTMLDiagnosticConsumer(<br>
-Â Â Â DiagOpts, C,
std::string(llvm::sys::path::parent_path(prefix)), PP,<br>
-Â Â Â CTU);<br>
-Â createPlistMultiFileDiagnosticConsumer(DiagOpts, C, prefix,
PP, CTU);<br>
-Â
createTextMinimalPathDiagnosticConsumer(std::move(DiagOpts),
C, prefix, PP,<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â CTU);<br>
+Â C.push_back(new
HTMLPathDiagnosticConsumer(std::move(DiagOpts), OutputDir, PP,<br>
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â false));<br>
 }<br>
<br>
 //===----------------------------------------------------------------------===//<br>
 // Report processing.<br>
 //===----------------------------------------------------------------------===//<br>
<br>
-void HTMLDiagnostics::FlushDiagnosticsImpl(<br>
-Â std::vector<const PathDiagnostic *> &Diags,<br>
-Â FilesMade *filesMade) {<br>
+void HTMLPathDiagnosticConsumer::FlushDiagnosticsImpl(<br>
+Â Â std::vector<const PathDiagnostic *> &Diags,
FilesMade *filesMade) {<br>
  for (const auto Diag : Diags)<br>
   ReportDiag(*Diag, filesMade);<br>
 }<br>
<br>
-void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D,<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â FilesMade *filesMade) {<br>
+void HTMLPathDiagnosticConsumer::ReportDiag(const
PathDiagnostic &D,<br>
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â FilesMade
*filesMade) {<br>
  // Create the HTML directory if it is missing.<br>
  if (!createdDir) {<br>
   createdDir = true;<br>
@@ -296,8 +283,11 @@ void HTMLDiagnostics::ReportDiag(const
PathDiagnostic& D,<br>
  os << report;<br>
 }<br>
<br>
-std::string HTMLDiagnostics::GenerateHTML(const
PathDiagnostic& D, Rewriter &R,<br>
-Â Â const SourceManager& SMgr, const PathPieces&
path, const char *declName) {<br>
+std::string HTMLPathDiagnosticConsumer::GenerateHTML(const
PathDiagnostic &D,<br>
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Rewriter
&R,<br>
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â const
SourceManager &SMgr,<br>
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â const
PathPieces &path,<br>
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â const
char *declName) {<br>
  // Rewrite source files as HTML for every new file the path
crosses<br>
  std::vector<FileID> FileIDs;<br>
  for (auto I : path) {<br>
@@ -369,9 +359,8 @@ std::string
HTMLDiagnostics::GenerateHTML(const PathDiagnostic& D,
Rewriter &R,<br>
  return os.str();<br>
 }<br>
<br>
-void HTMLDiagnostics::dumpCoverageData(<br>
-Â Â const PathDiagnostic &D,<br>
-Â Â const PathPieces &path,<br>
+void HTMLPathDiagnosticConsumer::dumpCoverageData(<br>
+Â Â const PathDiagnostic &D, const PathPieces &path,<br>
   llvm::raw_string_ostream &os) {<br>
<br>
  const FilesToLineNumsMap &ExecutedLines =
D.getExecutedLines();<br>
@@ -395,8 +384,8 @@ void HTMLDiagnostics::dumpCoverageData(<br>
  os << "};";<br>
 }<br>
<br>
-std::string HTMLDiagnostics::showRelevantLinesJavascript(<br>
-Â Â Â const PathDiagnostic &D, const PathPieces
&path) {<br>
+std::string
HTMLPathDiagnosticConsumer::showRelevantLinesJavascript(<br>
+Â Â const PathDiagnostic &D, const PathPieces &path)
{<br>
  std::string s;<br>
  llvm::raw_string_ostream os(s);<br>
  os << "<script type='text/javascript'>\n";<br>
@@ -460,9 +449,10 @@
document.addEventListener("DOMContentLoaded", function() {<br>
  return os.str();<br>
 }<br>
<br>
-void HTMLDiagnostics::FinalizeHTML(const PathDiagnostic&
D, Rewriter &R,<br>
-Â Â const SourceManager& SMgr, const PathPieces&
path, FileID FID,<br>
-Â Â const FileEntry *Entry, const char *declName) {<br>
+void HTMLPathDiagnosticConsumer::FinalizeHTML(<br>
+Â Â const PathDiagnostic &D, Rewriter &R, const
SourceManager &SMgr,<br>
+Â Â const PathPieces &path, FileID FID, const FileEntry
*Entry,<br>
+Â Â const char *declName) {<br>
  // This is a cludge; basically we want to append either the
full<br>
  // working directory if we have no directory information.Â
This is<br>
  // a work in progress.<br>
@@ -607,7 +597,7 @@ void HTMLDiagnostics::FinalizeHTML(const
PathDiagnostic& D, Rewriter &R,<br>
  html::AddHeaderFooterInternalBuiltinCSS(R, FID,
Entry->getName());<br>
 }<br>
<br>
-StringRef HTMLDiagnostics::showHelpJavascript() {<br>
+StringRef HTMLPathDiagnosticConsumer::showHelpJavascript() {<br>
  return R"<<<(<br>
 <script type='text/javascript'><br>
<br>
@@ -690,8 +680,9 @@ static void
HandlePopUpPieceEndTag(Rewriter &R,<br>
  }<br>
 }<br>
<br>
-void HTMLDiagnostics::RewriteFile(Rewriter &R,<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â const PathPieces& path,
FileID FID) {<br>
+void HTMLPathDiagnosticConsumer::RewriteFile(Rewriter &R,<br>
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â const PathPieces
&path,<br>
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â FileID FID) {<br>
  // Process the path.<br>
  // Maintain the counts of extra note pieces separately.<br>
  unsigned TotalPieces = path.size();<br>
@@ -769,10 +760,9 @@ void
HTMLDiagnostics::RewriteFile(Rewriter &R,<br>
  html::HighlightMacros(R, FID, PP);<br>
 }<br>
<br>
-void HTMLDiagnostics::HandlePiece(Rewriter &R, FileID
BugFileID,<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â const PathDiagnosticPiece
&P,<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â const
std::vector<SourceRange> &PopUpRanges,<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â unsigned num, unsigned max)
{<br>
+void HTMLPathDiagnosticConsumer::HandlePiece(<br>
+Â Â Rewriter &R, FileID BugFileID, const
PathDiagnosticPiece &P,<br>
+Â Â const std::vector<SourceRange> &PopUpRanges,
unsigned num, unsigned max) {<br>
  // For now, just draw a box above the line in question, and
emit the<br>
  // warning.<br>
  FullSourceLoc Pos = P.getLocation().asLocation();<br>
@@ -1004,9 +994,8 @@ static void EmitAlphaCounter(raw_ostream
&os, unsigned n) {<br>
  os << char('a' + x);<br>
 }<br>
<br>
-unsigned HTMLDiagnostics::ProcessMacroPiece(raw_ostream
&os,<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â const
PathDiagnosticMacroPiece& P,<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â unsigned num) {<br>
+unsigned HTMLPathDiagnosticConsumer::ProcessMacroPiece(<br>
+Â Â raw_ostream &os, const PathDiagnosticMacroPiece
&P, unsigned num) {<br>
  for (const auto &subPiece : P.subPieces) {<br>
   if (const auto *MP =
dyn_cast<PathDiagnosticMacroPiece>(subPiece.get())) {<br>
    num = ProcessMacroPiece(os, *MP, num);<br>
@@ -1028,10 +1017,10 @@ unsigned
HTMLDiagnostics::ProcessMacroPiece(raw_ostream &os,<br>
  return num;<br>
 }<br>
<br>
-void HTMLDiagnostics::HighlightRange(Rewriter& R, FileID
BugFileID,<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â SourceRange Range,<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â const char
*HighlightStart,<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â const char
*HighlightEnd) {<br>
+void HTMLPathDiagnosticConsumer::HighlightRange(Rewriter
&R, FileID BugFileID,<br>
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â SourceRange
Range,<br>
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â const char
*HighlightStart,<br>
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â const char
*HighlightEnd) {<br>
  SourceManager &SM = R.getSourceMgr();<br>
  const LangOptions &LangOpts = R.getLangOpts();<br>
<br>
@@ -1066,7 +1055,7 @@ void
HTMLDiagnostics::HighlightRange(Rewriter& R, FileID
BugFileID,<br>
  html::HighlightRange(R, InstantiationStart, E,
HighlightStart, HighlightEnd);<br>
 }<br>
<br>
-StringRef
HTMLDiagnostics::generateKeyboardNavigationJavascript() {<br>
+StringRef
HTMLPathDiagnosticConsumer::generateKeyboardNavigationJavascript()
{<br>
  return R"<<<(<br>
 <script type='text/javascript'><br>
 var digitMatcher = new RegExp("[0-9]+");<br>
<br>
diff --git
a/clang/lib/Analysis/PlistHTMLPathDiagnosticConsumer.cpp
b/clang/lib/Analysis/PlistHTMLPathDiagnosticConsumer.cpp<br>
new file mode 100644<br>
index 000000000000..60be1077f9de<br>
--- /dev/null<br>
+++ b/clang/lib/Analysis/PlistHTMLPathDiagnosticConsumer.cpp<br>
@@ -0,0 +1,31 @@<br>
+//===--- PlistHTMLDiagnostics.cpp - The Plist-HTML Diagnostic
Consumer. ---===//<br>
+//<br>
+// Part of the LLVM Project, under the Apache License v2.0
with LLVM Exceptions.<br>
+// See <a href="https://llvm.org/LICENSE.txt"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://llvm.org/LICENSE.txt</a>
for license information.<br>
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception<br>
+//<br>
+//===----------------------------------------------------------------------===//<br>
+//<br>
+// This diagnostic consumer produces both the HTML output and
the Plist output.<br>
+//<br>
+//===----------------------------------------------------------------------===//<br>
+<br>
+#include "clang/Analysis/PathDiagnostic.h"<br>
+#include "clang/Analysis/PathDiagnosticConsumers.h"<br>
+#include "clang/Basic/SourceManager.h"<br>
+#include "clang/CrossTU/CrossTranslationUnit.h"<br>
+#include "clang/Lex/Preprocessor.h"<br>
+<br>
+using namespace clang;<br>
+using namespace ento;<br>
+<br>
+void ento::createPlistHTMLDiagnosticConsumer(<br>
+Â Â PathDiagnosticConsumerOptions DiagOpts,
PathDiagnosticConsumers &C,<br>
+Â Â const std::string &Prefix, const Preprocessor
&PP,<br>
+Â Â const cross_tu::CrossTranslationUnitContext &CTU) {<br>
+Â createHTMLDiagnosticConsumer(<br>
+Â Â Â DiagOpts, C,
std::string(llvm::sys::path::parent_path(Prefix)), PP, CTU);<br>
+Â createPlistMultiFileDiagnosticConsumer(DiagOpts, C, Prefix,
PP, CTU);<br>
+Â
createTextMinimalPathDiagnosticConsumer(std::move(DiagOpts),
C, Prefix, PP,<br>
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â CTU);<br>
+}<br>
<br>
diff --git
a/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
b/clang/lib/Analysis/PlistPathDiagnosticConsumer.cpp<br>
similarity index 97%<br>
rename from clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp<br>
rename to clang/lib/Analysis/PlistPathDiagnosticConsumer.cpp<br>
index 35e320c7755f..4863b645254d 100644<br>
--- a/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp<br>
+++ b/clang/lib/Analysis/PlistPathDiagnosticConsumer.cpp<br>
@@ -1,4 +1,4 @@<br>
-//===--- PlistDiagnostics.cpp - Plist Diagnostics for Paths
-----*- C++ -*-===//<br>
+//===--- PlistPathDiagnosticConsumer.cpp - Plist Diagnostics
----*- C++ -*-===//<br>
 //<br>
 // Part of the LLVM Project, under the Apache License v2.0
with LLVM Exceptions.<br>
 // See <a href="https://llvm.org/LICENSE.txt"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://llvm.org/LICENSE.txt</a>
for license information.<br>
@@ -6,12 +6,13 @@<br>
 //<br>
 //===----------------------------------------------------------------------===//<br>
 //<br>
-//Â This file defines the PlistDiagnostics object.<br>
+//Â This file defines the PlistPathDiagnosticConsumer object.<br>
 //<br>
 //===----------------------------------------------------------------------===//<br>
<br>
 #include "clang/Analysis/IssueHash.h"<br>
 #include "clang/Analysis/PathDiagnostic.h"<br>
+#include "clang/Analysis/PathDiagnosticConsumers.h"<br>
 #include "clang/Basic/FileManager.h"<br>
 #include "clang/Basic/PlistSupport.h"<br>
 #include "clang/Basic/SourceManager.h"<br>
@@ -21,7 +22,6 @@<br>
 #include "clang/Lex/Preprocessor.h"<br>
 #include "clang/Lex/TokenConcatenation.h"<br>
 #include "clang/Rewrite/Core/HTMLRewrite.h"<br>
-#include
"clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h"<br>
 #include "llvm/ADT/SmallPtrSet.h"<br>
 #include "llvm/ADT/SmallVector.h"<br>
 #include "llvm/ADT/Statistic.h"<br>
@@ -38,7 +38,7 @@ using namespace markup;<br>
 //===----------------------------------------------------------------------===//<br>
<br>
 namespace {<br>
-Â class PlistDiagnostics : public PathDiagnosticConsumer {<br>
+Â class PlistPathDiagnosticConsumer : public
PathDiagnosticConsumer {<br>
   PathDiagnosticConsumerOptions DiagOpts;<br>
   const std::string OutputFile;<br>
   const Preprocessor &PP;<br>
@@ -49,18 +49,18 @@ namespace {<br>
            const PathPieces &Path);<br>
<br>
  public:<br>
-Â Â PlistDiagnostics(PathDiagnosticConsumerOptions DiagOpts,<br>
+Â Â PlistPathDiagnosticConsumer(PathDiagnosticConsumerOptions
DiagOpts,<br>
           const std::string &OutputFile, const
Preprocessor &PP,<br>
           const
cross_tu::CrossTranslationUnitContext &CTU,<br>
           bool supportsMultipleFiles);<br>
<br>
-Â Â ~PlistDiagnostics() override {}<br>
+Â Â ~PlistPathDiagnosticConsumer() override {}<br>
<br>
   void FlushDiagnosticsImpl(std::vector<const
PathDiagnostic *> &Diags,<br>
                FilesMade *filesMade) override;<br>
<br>
   StringRef getName() const override {<br>
-Â Â Â return "PlistDiagnostics";<br>
+Â Â Â return "PlistPathDiagnosticConsumer";<br>
   }<br>
<br>
   PathGenerationScheme getGenerationScheme() const override
{<br>
@@ -516,10 +516,10 @@ static void printCoverage(const
PathDiagnostic *D,<br>
 }<br>
<br>
 //===----------------------------------------------------------------------===//<br>
-// Methods of PlistDiagnostics.<br>
+// Methods of PlistPathDiagnosticConsumer.<br>
 //===----------------------------------------------------------------------===//<br>
<br>
-PlistDiagnostics::PlistDiagnostics(<br>
+PlistPathDiagnosticConsumer::PlistPathDiagnosticConsumer(<br>
   PathDiagnosticConsumerOptions DiagOpts, const std::string
&output,<br>
   const Preprocessor &PP, const
cross_tu::CrossTranslationUnitContext &CTU,<br>
   bool supportsMultipleFiles)<br>
@@ -538,8 +538,8 @@ void ento::createPlistDiagnosticConsumer(<br>
  if (OutputFile.empty())<br>
   return;<br>
<br>
-Â C.push_back(new PlistDiagnostics(DiagOpts, OutputFile, PP,
CTU,<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
 /*supportsMultipleFiles=*/false));<br>
+Â C.push_back(new PlistPathDiagnosticConsumer(DiagOpts,
OutputFile, PP, CTU,<br>
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
/*supportsMultipleFiles=*/false));<br>
Â
 createTextMinimalPathDiagnosticConsumer(std::move(DiagOpts),
C, OutputFile,<br>
                      PP, CTU);<br>
 }<br>
@@ -553,14 +553,15 @@ void
ento::createPlistMultiFileDiagnosticConsumer(<br>
  if (OutputFile.empty())<br>
   return;<br>
<br>
-Â C.push_back(new PlistDiagnostics(DiagOpts, OutputFile, PP,
CTU,<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
 /*supportsMultipleFiles=*/true));<br>
+Â C.push_back(new PlistPathDiagnosticConsumer(DiagOpts,
OutputFile, PP, CTU,<br>
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
/*supportsMultipleFiles=*/true));<br>
Â
 createTextMinimalPathDiagnosticConsumer(std::move(DiagOpts),
C, OutputFile,<br>
                      PP, CTU);<br>
 }<br>
<br>
-void PlistDiagnostics::printBugPath(llvm::raw_ostream &o,
const FIDMap &FM,<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â const PathPieces
&Path) {<br>
+void
PlistPathDiagnosticConsumer::printBugPath(llvm::raw_ostream
&o,<br>
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â const FIDMap
&FM,<br>
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â const
PathPieces &Path) {<br>
  PlistPrinter Printer(FM, PP, CTU);<br>
  assert(std::is_partitioned(Path.begin(), Path.end(),<br>
               [](const PathDiagnosticPieceRef
&E) {<br>
@@ -603,9 +604,8 @@ void
PlistDiagnostics::printBugPath(llvm::raw_ostream &o, const
FIDMap &FM,<br>
  o << "  </array>\n";<br>
 }<br>
<br>
-void PlistDiagnostics::FlushDiagnosticsImpl(<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â std::vector<const
PathDiagnostic *> &Diags,<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â FilesMade *filesMade) {<br>
+void PlistPathDiagnosticConsumer::FlushDiagnosticsImpl(<br>
+Â Â std::vector<const PathDiagnostic *> &Diags,
FilesMade *filesMade) {<br>
  // Build up a set of FIDs that we use by scanning the
locations and<br>
  // ranges of the diagnostics.<br>
  FIDMap FM;<br>
<br>
diff --git
a/clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp
b/clang/lib/Analysis/SarifPathDiagnosticConsumer.cpp<br>
similarity index 93%<br>
rename from clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp<br>
rename to clang/lib/Analysis/SarifPathDiagnosticConsumer.cpp<br>
index f93d04ccd61a..9d85aad5d258 100644<br>
--- a/clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp<br>
+++ b/clang/lib/Analysis/SarifPathDiagnosticConsumer.cpp<br>
@@ -1,4 +1,4 @@<br>
-//===--- SarifDiagnostics.cpp - Sarif Diagnostics for Paths
-----*- C++ -*-===//<br>
+//===--- SarifPathDiagnosticConsumer.cpp - Sarif DiagnosticsÂ
---*- C++ -*-===//<br>
 //<br>
 // Part of the LLVM Project, under the Apache License v2.0
with LLVM Exceptions.<br>
 // See <a href="https://llvm.org/LICENSE.txt"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://llvm.org/LICENSE.txt</a>
for license information.<br>
@@ -6,15 +6,15 @@<br>
 //<br>
 //===----------------------------------------------------------------------===//<br>
 //<br>
-//Â This file defines the SarifDiagnostics object.<br>
+//Â This file defines the SarifPathDiagnosticConsumer object.<br>
 //<br>
 //===----------------------------------------------------------------------===//<br>
<br>
 #include "clang/Analysis/PathDiagnostic.h"<br>
+#include "clang/Analysis/PathDiagnosticConsumers.h"<br>
 #include "clang/Basic/FileManager.h"<br>
 #include "clang/Basic/Version.h"<br>
 #include "clang/Lex/Preprocessor.h"<br>
-#include
"clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h"<br>
 #include "llvm/ADT/STLExtras.h"<br>
 #include "llvm/ADT/StringMap.h"<br>
 #include "llvm/Support/ConvertUTF.h"<br>
@@ -26,19 +26,19 @@ using namespace clang;<br>
 using namespace ento;<br>
<br>
 namespace {<br>
-class SarifDiagnostics : public PathDiagnosticConsumer {<br>
+class SarifPathDiagnosticConsumer : public
PathDiagnosticConsumer {<br>
  std::string OutputFile;<br>
  const LangOptions &LO;<br>
<br>
 public:<br>
-Â SarifDiagnostics(const std::string &Output, const
LangOptions &LO)<br>
+Â SarifPathDiagnosticConsumer(const std::string &Output,
const LangOptions &LO)<br>
    : OutputFile(Output), LO(LO) {}<br>
-Â ~SarifDiagnostics() override = default;<br>
+Â ~SarifPathDiagnosticConsumer() override = default;<br>
<br>
  void FlushDiagnosticsImpl(std::vector<const
PathDiagnostic *> &Diags,<br>
               FilesMade *FM) override;<br>
<br>
-Â StringRef getName() const override { return
"SarifDiagnostics"; }<br>
+Â StringRef getName() const override { return
"SarifPathDiagnosticConsumer"; }<br>
  PathGenerationScheme getGenerationScheme() const override {
return Minimal; }<br>
  bool supportsLogicalOpControlFlow() const override { return
true; }<br>
  bool supportsCrossFileDiagnostics() const override { return
true; }<br>
@@ -54,7 +54,7 @@ void ento::createSarifDiagnosticConsumer(<br>
  if (Output.empty())<br>
   return;<br>
<br>
-Â C.push_back(new SarifDiagnostics(Output,
PP.getLangOpts()));<br>
+Â C.push_back(new SarifPathDiagnosticConsumer(Output,
PP.getLangOpts()));<br>
Â
 createTextMinimalPathDiagnosticConsumer(std::move(DiagOpts),
C, Output, PP,<br>
                      CTU);<br>
 }<br>
@@ -299,6 +299,9 @@ static json::Object createResult(const
LangOptions &LO,<br>
 }<br>
<br>
 static StringRef getRuleDescription(StringRef CheckName) {<br>
+Â // FIXME: This is a layering violation; it only works for
the particular<br>
+Â // use-case of clang static analyzer. This info should be
provided<br>
+Â // as part of PathDiagnostic itself.<br>
  return llvm::StringSwitch<StringRef>(CheckName)<br>
 #define GET_CHECKERS<br>
 #define CHECKER(FULLNAME, CLASS, HELPTEXT, DOC_URI,
IS_HIDDEN)Â Â Â Â Â Â Â Â Â \<br>
@@ -310,6 +313,9 @@ static StringRef
getRuleDescription(StringRef CheckName) {<br>
 }<br>
<br>
 static StringRef getRuleHelpURIStr(StringRef CheckName) {<br>
+Â // FIXME: This is a layering violation; it only works for
the particular<br>
+Â // use-case of clang static analyzer. This info should be
provided<br>
+Â // as part of PathDiagnostic itself.<br>
  return llvm::StringSwitch<StringRef>(CheckName)<br>
 #define GET_CHECKERS<br>
 #define CHECKER(FULLNAME, CLASS, HELPTEXT, DOC_URI,
IS_HIDDEN)Â Â Â Â Â Â Â Â Â \<br>
@@ -377,7 +383,7 @@ static json::Object createRun(const
LangOptions &LO,<br>
            {"columnKind", "unicodeCodePoints"}};<br>
 }<br>
<br>
-void SarifDiagnostics::FlushDiagnosticsImpl(<br>
+void SarifPathDiagnosticConsumer::FlushDiagnosticsImpl(<br>
   std::vector<const PathDiagnostic *> &Diags,
FilesMade *) {<br>
  // We currently overwrite the file if it already exists.
However, it may be<br>
  // useful to add a feature someday that allows the user to
append a run to an<br>
<br>
diff --git
a/clang/lib/StaticAnalyzer/Core/TextDiagnostics.cpp
b/clang/lib/Analysis/TextPathDiagnosticConsumer.cpp<br>
similarity index 83%<br>
rename from clang/lib/StaticAnalyzer/Core/TextDiagnostics.cpp<br>
rename to clang/lib/Analysis/TextPathDiagnosticConsumer.cpp<br>
index ae2bad7ee77c..21e89548636e 100644<br>
--- a/clang/lib/StaticAnalyzer/Core/TextDiagnostics.cpp<br>
+++ b/clang/lib/Analysis/TextPathDiagnosticConsumer.cpp<br>
@@ -1,4 +1,4 @@<br>
-//===--- TextDiagnostics.cpp - Text Diagnostics for Paths
-------*- C++ -*-===//<br>
+//===--- TextPathDiagnosticConsumer.cpp - Text Diagnostics
------*- C++ -*-===//<br>
 //<br>
 // Part of the LLVM Project, under the Apache License v2.0
with LLVM Exceptions.<br>
 // See <a href="https://llvm.org/LICENSE.txt"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://llvm.org/LICENSE.txt</a>
for license information.<br>
@@ -6,19 +6,18 @@<br>
 //<br>
 //===----------------------------------------------------------------------===//<br>
 //<br>
-//Â This file defines the TextDiagnostics object.<br>
+//Â This file defines the TextPathDiagnosticConsumer object.<br>
 //<br>
 //===----------------------------------------------------------------------===//<br>
<br>
 #include "clang/Analysis/PathDiagnostic.h"<br>
+#include "clang/Analysis/PathDiagnosticConsumers.h"<br>
 #include "clang/Basic/SourceManager.h"<br>
 #include "clang/Basic/Version.h"<br>
 #include "clang/CrossTU/CrossTranslationUnit.h"<br>
 #include "clang/Frontend/ASTUnit.h"<br>
 #include "clang/Lex/Preprocessor.h"<br>
 #include "clang/Rewrite/Core/Rewriter.h"<br>
-#include "clang/StaticAnalyzer/Core/AnalyzerOptions.h"<br>
-#include
"clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h"<br>
 #include "clang/Tooling/Core/Replacement.h"<br>
 #include "clang/Tooling/Tooling.h"<br>
 #include "llvm/ADT/SmallPtrSet.h"<br>
@@ -33,21 +32,21 @@ namespace {<br>
 /// Emitsd minimal diagnostics (report message + notes) for
the 'none' output<br>
 /// type to the standard error, or to to compliment many
others. Emits detailed<br>
 /// diagnostics in textual format for the 'text' output type.<br>
-class TextDiagnostics : public PathDiagnosticConsumer {<br>
+class TextPathDiagnosticConsumer : public
PathDiagnosticConsumer {<br>
  PathDiagnosticConsumerOptions DiagOpts;<br>
  DiagnosticsEngine &DiagEng;<br>
  const LangOptions &LO;<br>
  bool ShouldDisplayPathNotes;<br>
<br>
 public:<br>
-Â TextDiagnostics(PathDiagnosticConsumerOptions DiagOpts,<br>
-Â Â Â Â Â Â Â Â Â DiagnosticsEngine &DiagEng, const
LangOptions &LO,<br>
-Â Â Â Â Â Â Â Â Â bool ShouldDisplayPathNotes)<br>
+Â TextPathDiagnosticConsumer(PathDiagnosticConsumerOptions
DiagOpts,<br>
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â DiagnosticsEngine &DiagEng,
const LangOptions &LO,<br>
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â bool ShouldDisplayPathNotes)<br>
    : DiagOpts(std::move(DiagOpts)), DiagEng(DiagEng),
LO(LO),<br>
     ShouldDisplayPathNotes(ShouldDisplayPathNotes) {}<br>
-Â ~TextDiagnostics() override {}<br>
+Â ~TextPathDiagnosticConsumer() override {}<br>
<br>
-Â StringRef getName() const override { return
"TextDiagnostics"; }<br>
+Â StringRef getName() const override { return
"TextPathDiagnosticConsumer"; }<br>
<br>
  bool supportsLogicalOpControlFlow() const override { return
true; }<br>
  bool supportsCrossFileDiagnostics() const override { return
true; }<br>
@@ -140,16 +139,16 @@ void
ento::createTextPathDiagnosticConsumer(<br>
   PathDiagnosticConsumerOptions DiagOpts,
PathDiagnosticConsumers &C,<br>
   const std::string &Prefix, const clang::Preprocessor
&PP,<br>
   const cross_tu::CrossTranslationUnitContext &CTU) {<br>
-Â C.emplace_back(new TextDiagnostics(std::move(DiagOpts),
PP.getDiagnostics(),<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â PP.getLangOpts(),<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
 /*ShouldDisplayPathNotes=*/true));<br>
+Â C.emplace_back(new TextPathDiagnosticConsumer(<br>
+Â Â Â std::move(DiagOpts), PP.getDiagnostics(),
PP.getLangOpts(),<br>
+Â Â Â /*ShouldDisplayPathNotes=*/true));<br>
 }<br>
<br>
 void ento::createTextMinimalPathDiagnosticConsumer(<br>
   PathDiagnosticConsumerOptions DiagOpts,
PathDiagnosticConsumers &C,<br>
   const std::string &Prefix, const clang::Preprocessor
&PP,<br>
   const cross_tu::CrossTranslationUnitContext &CTU) {<br>
-Â C.emplace_back(new TextDiagnostics(std::move(DiagOpts),
PP.getDiagnostics(),<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â PP.getLangOpts(),<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â
 /*ShouldDisplayPathNotes=*/false));<br>
+Â C.emplace_back(new TextPathDiagnosticConsumer(<br>
+Â Â Â std::move(DiagOpts), PP.getDiagnostics(),
PP.getLangOpts(),<br>
+Â Â Â /*ShouldDisplayPathNotes=*/false));<br>
 }<br>
<br>
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp
b/clang/lib/Frontend/CompilerInvocation.cpp<br>
index be5a64464bf1..6e3bf603b190 100644<br>
--- a/clang/lib/Frontend/CompilerInvocation.cpp<br>
+++ b/clang/lib/Frontend/CompilerInvocation.cpp<br>
@@ -444,7 +444,7 @@ static bool
ParseAnalyzerArgs(AnalyzerOptions &Opts, ArgList
&Args,<br>
   AnalysisDiagClients Value =
llvm::StringSwitch<AnalysisDiagClients>(Name)<br>
 #define ANALYSIS_DIAGNOSTICS(NAME, CMDFLAG, DESC, CREATFN) \<br>
    .Case(CMDFLAG, PD_##NAME)<br>
-#include "clang/StaticAnalyzer/Core/Analyses.def"<br>
+#include "clang/Analysis/PathDiagnosticConsumers.def"<br>
    .Default(NUM_ANALYSIS_DIAG_CLIENTS);<br>
   if (Value == NUM_ANALYSIS_DIAG_CLIENTS) {<br>
    Diags.Report(diag::err_drv_invalid_value)<br>
<br>
diff --git a/clang/lib/StaticAnalyzer/Core/CMakeLists.txt
b/clang/lib/StaticAnalyzer/Core/CMakeLists.txt<br>
index d947d415ad6e..b1f527ed75d5 100644<br>
--- a/clang/lib/StaticAnalyzer/Core/CMakeLists.txt<br>
+++ b/clang/lib/StaticAnalyzer/Core/CMakeLists.txt<br>
@@ -30,16 +30,13 @@ add_clang_library(clangStaticAnalyzerCore<br>
  ExprEngineCallAndReturn.cpp<br>
  ExprEngineObjC.cpp<br>
  FunctionSummary.cpp<br>
-Â HTMLDiagnostics.cpp<br>
  LoopUnrolling.cpp<br>
  LoopWidening.cpp<br>
  MemRegion.cpp<br>
-Â PlistDiagnostics.cpp<br>
  ProgramState.cpp<br>
  RangeConstraintManager.cpp<br>
  RangedConstraintManager.cpp<br>
  RegionStore.cpp<br>
-Â SarifDiagnostics.cpp<br>
  SimpleConstraintManager.cpp<br>
  SimpleSValBuilder.cpp<br>
  SMTConstraintManager.cpp<br>
@@ -47,7 +44,6 @@ add_clang_library(clangStaticAnalyzerCore<br>
  SValBuilder.cpp<br>
  SVals.cpp<br>
  SymbolManager.cpp<br>
-Â TextDiagnostics.cpp<br>
  WorkList.cpp<br>
<br>
  LINK_LIBS<br>
<br>
diff --git
a/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
b/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp<br>
index f2a19b2ccc90..1e94950ca097 100644<br>
--- a/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp<br>
+++ b/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp<br>
@@ -21,6 +21,7 @@<br>
 #include "clang/Analysis/CallGraph.h"<br>
 #include "clang/Analysis/CodeInjector.h"<br>
 #include "clang/Analysis/PathDiagnostic.h"<br>
+#include "clang/Analysis/PathDiagnosticConsumers.h"<br>
 #include "clang/Basic/SourceManager.h"<br>
 #include "clang/CrossTU/CrossTranslationUnit.h"<br>
 #include "clang/Frontend/CompilerInstance.h"<br>
@@ -30,7 +31,6 @@<br>
 #include "clang/StaticAnalyzer/Core/AnalyzerOptions.h"<br>
 #include
"clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"<br>
 #include "clang/StaticAnalyzer/Core/CheckerManager.h"<br>
-#include
"clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h"<br>
 #include
"clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h"<br>
 #include
"clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h"<br>
 #include "llvm/ADT/PostOrderIterator.h"<br>
@@ -152,7 +152,7 @@ class AnalysisConsumer : public
AnalysisASTConsumer,<br>
  case PD_##NAME:                     Â
         \<br>
   CREATEFN(Opts->getDiagOpts(), PathConsumers, OutDir,
PP, CTU);Â Â Â Â Â Â Â \<br>
   break;<br>
-#include "clang/StaticAnalyzer/Core/Analyses.def"<br>
+#include "clang/Analysis/PathDiagnosticConsumers.def"<br>
   default:<br>
    llvm_unreachable("Unknown analyzer output type!");<br>
   }<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank"
moz-do-not-send="true">cfe-commits@lists.llvm.org</a><br>
<a
href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote>
</div>
</blockquote>
<br>
</body>
</html>