Rename DiagnosticClient to DiagnosticConsumer as per issue 5397


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140479 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/ARCMigrate/ARCMT.cpp b/lib/ARCMigrate/ARCMT.cpp
index 6d44ca6..eeea519 100644
--- a/lib/ARCMigrate/ARCMT.cpp
+++ b/lib/ARCMigrate/ARCMT.cpp
@@ -88,7 +88,7 @@
 
 namespace {
 
-class CaptureDiagnosticClient : public DiagnosticClient {
+class CaptureDiagnosticClient : public DiagnosticConsumer {
   DiagnosticsEngine &Diags;
   CapturedDiagList &CapturedDiags;
 public:
@@ -214,7 +214,7 @@
 
 bool arcmt::checkForManualIssues(CompilerInvocation &origCI,
                                  StringRef Filename, InputKind Kind,
-                                 DiagnosticClient *DiagClient,
+                                 DiagnosticConsumer *DiagClient,
                                  bool emitPremigrationARCErrors,
                                  StringRef plistOut) {
   if (!origCI.getLangOpts().ObjC1)
@@ -271,7 +271,7 @@
 
   // After parsing of source files ended, we want to reuse the
   // diagnostics objects to emit further diagnostics.
-  // We call BeginSourceFile because DiagnosticClient requires that 
+  // We call BeginSourceFile because DiagnosticConsumer requires that 
   // diagnostics with source range information are emitted only in between
   // BeginSourceFile() and EndSourceFile().
   DiagClient->BeginSourceFile(Ctx.getLangOptions(), &Unit->getPreprocessor());
@@ -303,7 +303,7 @@
 
 static bool applyTransforms(CompilerInvocation &origCI,
                             StringRef Filename, InputKind Kind,
-                            DiagnosticClient *DiagClient,
+                            DiagnosticConsumer *DiagClient,
                             StringRef outputDir,
                             bool emitPremigrationARCErrors,
                             StringRef plistOut) {
@@ -347,14 +347,14 @@
 
 bool arcmt::applyTransformations(CompilerInvocation &origCI,
                                  StringRef Filename, InputKind Kind,
-                                 DiagnosticClient *DiagClient) {
+                                 DiagnosticConsumer *DiagClient) {
   return applyTransforms(origCI, Filename, Kind, DiagClient,
                          StringRef(), false, StringRef());
 }
 
 bool arcmt::migrateWithTemporaryFiles(CompilerInvocation &origCI,
                                       StringRef Filename, InputKind Kind,
-                                      DiagnosticClient *DiagClient,
+                                      DiagnosticConsumer *DiagClient,
                                       StringRef outputDir,
                                       bool emitPremigrationARCErrors,
                                       StringRef plistOut) {
@@ -366,7 +366,7 @@
 bool arcmt::getFileRemappings(std::vector<std::pair<std::string,std::string> > &
                                   remap,
                               StringRef outputDir,
-                              DiagnosticClient *DiagClient) {
+                              DiagnosticConsumer *DiagClient) {
   assert(!outputDir.empty());
 
   llvm::IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs());
@@ -468,7 +468,7 @@
 MigrationProcess::RewriteListener::~RewriteListener() { }
 
 MigrationProcess::MigrationProcess(const CompilerInvocation &CI,
-                                   DiagnosticClient *diagClient,
+                                   DiagnosticConsumer *diagClient,
                                    StringRef outputDir)
   : OrigCI(CI), DiagClient(diagClient) {
   if (!outputDir.empty()) {
@@ -524,7 +524,7 @@
 
   // After parsing of source files ended, we want to reuse the
   // diagnostics objects to emit further diagnostics.
-  // We call BeginSourceFile because DiagnosticClient requires that 
+  // We call BeginSourceFile because DiagnosticConsumer requires that 
   // diagnostics with source range information are emitted only in between
   // BeginSourceFile() and EndSourceFile().
   DiagClient->BeginSourceFile(Ctx.getLangOptions(), &Unit->getPreprocessor());
diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp
index 87a3d1c..b7f130a 100644
--- a/lib/Basic/Diagnostic.cpp
+++ b/lib/Basic/Diagnostic.cpp
@@ -35,7 +35,7 @@
 
 DiagnosticsEngine::DiagnosticsEngine(
                        const llvm::IntrusiveRefCntPtr<DiagnosticIDs> &diags,
-                       DiagnosticClient *client, bool ShouldOwnClient)
+                       DiagnosticConsumer *client, bool ShouldOwnClient)
   : Diags(diags), Client(client), OwnsDiagClient(ShouldOwnClient),
     SourceMgr(0) {
   ArgToStringFn = DummyArgToStringFn;
@@ -62,7 +62,7 @@
     delete Client;
 }
 
-void DiagnosticsEngine::setClient(DiagnosticClient *client,
+void DiagnosticsEngine::setClient(DiagnosticConsumer *client,
                                   bool ShouldOwnClient) {
   if (OwnsDiagClient && Client)
     delete Client;
@@ -245,7 +245,7 @@
          FE = storedDiag.fixit_end(); FI != FE; ++FI)
     FixItHints[i++] = *FI;
 
-  assert(Client && "DiagnosticClient not set!");
+  assert(Client && "DiagnosticConsumer not set!");
   Level DiagLevel = storedDiag.getLevel();
   DiagnosticInfo Info(this, storedDiag.getMessage());
   Client->HandleDiagnostic(DiagLevel, Info);
@@ -273,7 +273,7 @@
   FlushCounts();
 
   // Process the diagnostic, sending the accumulated information to the
-  // DiagnosticClient.
+  // DiagnosticConsumer.
   bool Emitted = DiagObj->ProcessDiag();
 
   // Clear out the current diagnostic object.
@@ -291,9 +291,9 @@
 }
 
 
-DiagnosticClient::~DiagnosticClient() {}
+DiagnosticConsumer::~DiagnosticConsumer() {}
 
-void DiagnosticClient::HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
+void DiagnosticConsumer::HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
                                         const DiagnosticInfo &Info) {
   if (!IncludeInDiagnosticCounts())
     return;
@@ -746,9 +746,9 @@
 
 /// IncludeInDiagnosticCounts - This method (whose default implementation
 ///  returns true) indicates whether the diagnostics handled by this
-///  DiagnosticClient should be included in the number of diagnostics
+///  DiagnosticConsumer should be included in the number of diagnostics
 ///  reported by DiagnosticsEngine.
-bool DiagnosticClient::IncludeInDiagnosticCounts() const { return true; }
+bool DiagnosticConsumer::IncludeInDiagnosticCounts() const { return true; }
 
 PartialDiagnostic::StorageAllocator::StorageAllocator() {
   for (unsigned I = 0; I != NumCached; ++I)
diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp
index 21f6afa..af9bb54 100644
--- a/lib/Frontend/ASTUnit.cpp
+++ b/lib/Frontend/ASTUnit.cpp
@@ -448,7 +448,7 @@
   }
 };
 
-class StoredDiagnosticClient : public DiagnosticClient {
+class StoredDiagnosticClient : public DiagnosticConsumer {
   SmallVectorImpl<StoredDiagnostic> &StoredDiags;
   
 public:
@@ -465,7 +465,7 @@
 class CaptureDroppedDiagnostics {
   DiagnosticsEngine &Diags;
   StoredDiagnosticClient Client;
-  DiagnosticClient *PreviousClient;
+  DiagnosticConsumer *PreviousClient;
 
 public:
   CaptureDroppedDiagnostics(bool RequestCapture, DiagnosticsEngine &Diags,
@@ -491,7 +491,7 @@
 void StoredDiagnosticClient::HandleDiagnostic(DiagnosticsEngine::Level Level,
                                               const DiagnosticInfo &Info) {
   // Default implementation (Warnings/errors count).
-  DiagnosticClient::HandleDiagnostic(Level, Info);
+  DiagnosticConsumer::HandleDiagnostic(Level, Info);
 
   StoredDiags.push_back(StoredDiagnostic(Level, Info));
 }
@@ -514,7 +514,7 @@
     // No diagnostics engine was provided, so create our own diagnostics object
     // with the default options.
     DiagnosticOptions DiagOpts;
-    DiagnosticClient *Client = 0;
+    DiagnosticConsumer *Client = 0;
     if (CaptureDiagnostics)
       Client = new StoredDiagnosticClient(AST.StoredDiagnostics);
     Diags = CompilerInstance::createDiagnostics(DiagOpts, ArgEnd- ArgBegin, 
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp
index ab65c3e..fcc9246 100644
--- a/lib/Frontend/CompilerInstance.cpp
+++ b/lib/Frontend/CompilerInstance.cpp
@@ -104,7 +104,7 @@
   (*OS) << '\n';
 
   // Chain in a diagnostic client which will log the diagnostics.
-  DiagnosticClient *Logger =
+  DiagnosticConsumer *Logger =
     new TextDiagnosticPrinter(*OS.take(), DiagOpts, /*OwnsOutputStream=*/true);
   Diags.setClient(new ChainedDiagnosticClient(Diags.takeClient(), Logger));
 }
@@ -140,7 +140,7 @@
 }
 
 void CompilerInstance::createDiagnostics(int Argc, const char* const *Argv,
-                                         DiagnosticClient *Client,
+                                         DiagnosticConsumer *Client,
                                          bool ShouldOwnClient) {
   Diagnostics = createDiagnostics(getDiagnosticOpts(), Argc, Argv, Client,
                                   ShouldOwnClient, &getCodeGenOpts());
@@ -149,7 +149,7 @@
 llvm::IntrusiveRefCntPtr<DiagnosticsEngine> 
 CompilerInstance::createDiagnostics(const DiagnosticOptions &Opts,
                                     int Argc, const char* const *Argv,
-                                    DiagnosticClient *Client,
+                                    DiagnosticConsumer *Client,
                                     bool ShouldOwnClient,
                                     const CodeGenOptions *CodeGenOpts) {
   llvm::IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs());
diff --git a/lib/Frontend/LogDiagnosticPrinter.cpp b/lib/Frontend/LogDiagnosticPrinter.cpp
index 00cd85d..1f64134 100644
--- a/lib/Frontend/LogDiagnosticPrinter.cpp
+++ b/lib/Frontend/LogDiagnosticPrinter.cpp
@@ -42,9 +42,9 @@
   // We emit all the diagnostics in EndSourceFile. However, we don't emit any
   // entry if no diagnostics were present.
   //
-  // Note that DiagnosticClient has no "end-of-compilation" callback, so we will
-  // miss any diagnostics which are emitted after and outside the translation
-  // unit processing.
+  // Note that DiagnosticConsumer has no "end-of-compilation" callback, so we
+  // will miss any diagnostics which are emitted after and outside the
+  // translation unit processing.
   if (Entries.empty())
     return;
 
@@ -96,7 +96,7 @@
 void LogDiagnosticPrinter::HandleDiagnostic(DiagnosticsEngine::Level Level,
                                             const DiagnosticInfo &Info) {
   // Default implementation (Warnings/errors count).
-  DiagnosticClient::HandleDiagnostic(Level, Info);
+  DiagnosticConsumer::HandleDiagnostic(Level, Info);
 
   // Initialize the main file name, if we haven't already fetched it.
   if (MainFilename.empty() && Info.hasSourceManager()) {
diff --git a/lib/Frontend/TextDiagnosticBuffer.cpp b/lib/Frontend/TextDiagnosticBuffer.cpp
index b615d71..75ecaaf 100644
--- a/lib/Frontend/TextDiagnosticBuffer.cpp
+++ b/lib/Frontend/TextDiagnosticBuffer.cpp
@@ -22,7 +22,7 @@
 void TextDiagnosticBuffer::HandleDiagnostic(DiagnosticsEngine::Level Level,
                                             const DiagnosticInfo &Info) {
   // Default implementation (Warnings/errors count).
-  DiagnosticClient::HandleDiagnostic(Level, Info);
+  DiagnosticConsumer::HandleDiagnostic(Level, Info);
 
   llvm::SmallString<100> Buf;
   Info.FormatDiagnostic(Buf);
diff --git a/lib/Frontend/TextDiagnosticPrinter.cpp b/lib/Frontend/TextDiagnosticPrinter.cpp
index 53f532e..1dc9d72 100644
--- a/lib/Frontend/TextDiagnosticPrinter.cpp
+++ b/lib/Frontend/TextDiagnosticPrinter.cpp
@@ -1062,7 +1062,7 @@
 void TextDiagnosticPrinter::HandleDiagnostic(DiagnosticsEngine::Level Level,
                                              const DiagnosticInfo &Info) {
   // Default implementation (Warnings/errors count).
-  DiagnosticClient::HandleDiagnostic(Level, Info);
+  DiagnosticConsumer::HandleDiagnostic(Level, Info);
 
   // Keeps track of the the starting position of the location
   // information (e.g., "foo.c:10:4:") that precedes the error
diff --git a/lib/Frontend/VerifyDiagnosticsClient.cpp b/lib/Frontend/VerifyDiagnosticsClient.cpp
index aaac282..c3a236f 100644
--- a/lib/Frontend/VerifyDiagnosticsClient.cpp
+++ b/lib/Frontend/VerifyDiagnosticsClient.cpp
@@ -35,7 +35,7 @@
     delete PrimaryClient;
 }
 
-// DiagnosticClient interface.
+// DiagnosticConsumer interface.
 
 void VerifyDiagnosticsClient::BeginSourceFile(const LangOptions &LangOpts,
                                              const Preprocessor *PP) {
@@ -483,7 +483,7 @@
 
   // Ensure any diagnostics go to the primary client.
   bool OwnsCurClient = Diags.ownsClient();
-  DiagnosticClient *CurClient = Diags.takeClient();
+  DiagnosticConsumer *CurClient = Diags.takeClient();
   Diags.setClient(PrimaryClient, false);
 
   // If we have a preprocessor, scan the source for expected diagnostic
diff --git a/lib/Rewrite/FixItRewriter.cpp b/lib/Rewrite/FixItRewriter.cpp
index 4ef7bc3..2d336a5 100644
--- a/lib/Rewrite/FixItRewriter.cpp
+++ b/lib/Rewrite/FixItRewriter.cpp
@@ -81,7 +81,7 @@
 void FixItRewriter::HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
                                      const DiagnosticInfo &Info) {
   // Default implementation (Warnings/errors count).
-  DiagnosticClient::HandleDiagnostic(DiagLevel, Info);
+  DiagnosticConsumer::HandleDiagnostic(DiagLevel, Info);
 
   Client->HandleDiagnostic(DiagLevel, Info);
 
diff --git a/lib/Rewrite/HTMLRewrite.cpp b/lib/Rewrite/HTMLRewrite.cpp
index fae44a3..ac5ca8c 100644
--- a/lib/Rewrite/HTMLRewrite.cpp
+++ b/lib/Rewrite/HTMLRewrite.cpp
@@ -443,7 +443,7 @@
 namespace {
 /// IgnoringDiagClient - This is a diagnostic client that just ignores all
 /// diags.
-class IgnoringDiagClient : public DiagnosticClient {
+class IgnoringDiagClient : public DiagnosticConsumer {
   void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
                         const DiagnosticInfo &Info) {
     // Just ignore it.