(1) Enable PlistDiagnostics to take an option "PathDiagnosticClientFactory"
object that it can use to forward PathDiagnostics for further processing. Along
with this feature, the PlistDiagnostics object logs which files are created by
the forwarding of the PathDiagnostics.

(2) Create a new PathDiagnosticClientFactory object for HTMLDiagnostics,
allowing other PathDiagnosticClients to forward PathDiagnostics through an
opaque interface.

(3) Create a "plist-html" diagnostics option in AnalysisConsumer to allow the
    logging of HTML files created in a hybrid Plist+HTML diagnostic client.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77264 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/AnalysisConsumer.cpp b/lib/Frontend/AnalysisConsumer.cpp
index dfbd856..2031174 100644
--- a/lib/Frontend/AnalysisConsumer.cpp
+++ b/lib/Frontend/AnalysisConsumer.cpp
@@ -50,6 +50,19 @@
 } // end anonymous namespace
 
 //===----------------------------------------------------------------------===//
+// Special PathDiagnosticClients.
+//===----------------------------------------------------------------------===//
+
+static PathDiagnosticClient*
+CreatePlistHTMLDiagnosticClient(const std::string& prefix, Preprocessor* PP,
+                            PreprocessorFactory* PPF) {
+  llvm::sys::Path F(prefix);  
+  PathDiagnosticClientFactory *PF = 
+    CreateHTMLDiagnosticClientFactory(F.getDirname(), PP, PPF);
+  return CreatePlistDiagnosticClient(prefix, PP, PPF, PF);
+}
+
+//===----------------------------------------------------------------------===//
 // AnalysisConsumer declaration.
 //===----------------------------------------------------------------------===//