[cfe-commits] r140485 - in /cfe/trunk: include/clang/Frontend/ChainedDiagnosticClient.h include/clang/Frontend/ChainedDiagnosticConsumer.h lib/Frontend/CompilerInstance.cpp

David Blaikie dblaikie at gmail.com
Sun Sep 25 17:21:47 PDT 2011


Author: dblaikie
Date: Sun Sep 25 19:21:47 2011
New Revision: 140485

URL: http://llvm.org/viewvc/llvm-project?rev=140485&view=rev
Log:
Rename ChainedDiagnosticClient to ChainedDiagnosticConsumer as per issue 5397

Added:
    cfe/trunk/include/clang/Frontend/ChainedDiagnosticConsumer.h
      - copied, changed from r140479, cfe/trunk/include/clang/Frontend/ChainedDiagnosticClient.h
Removed:
    cfe/trunk/include/clang/Frontend/ChainedDiagnosticClient.h
Modified:
    cfe/trunk/lib/Frontend/CompilerInstance.cpp

Removed: cfe/trunk/include/clang/Frontend/ChainedDiagnosticClient.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/ChainedDiagnosticClient.h?rev=140484&view=auto
==============================================================================
--- cfe/trunk/include/clang/Frontend/ChainedDiagnosticClient.h (original)
+++ cfe/trunk/include/clang/Frontend/ChainedDiagnosticClient.h (removed)
@@ -1,61 +0,0 @@
-//===--- ChainedDiagnosticClient.h - Chain Diagnostic Clients ---*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CLANG_FRONTEND_CHAINEDDIAGNOSTICCLIENT_H
-#define LLVM_CLANG_FRONTEND_CHAINEDDIAGNOSTICCLIENT_H
-
-#include "clang/Basic/Diagnostic.h"
-#include "llvm/ADT/OwningPtr.h"
-
-namespace clang {
-class LangOptions;
-
-/// ChainedDiagnosticClient - Chain two diagnostic clients so that diagnostics
-/// go to the first client and then the second. The first diagnostic client
-/// should be the "primary" client, and will be used for computing whether the
-/// diagnostics should be included in counts.
-class ChainedDiagnosticClient : public DiagnosticConsumer {
-  llvm::OwningPtr<DiagnosticConsumer> Primary;
-  llvm::OwningPtr<DiagnosticConsumer> Secondary;
-
-public:
-  ChainedDiagnosticClient(DiagnosticConsumer *_Primary,
-                          DiagnosticConsumer *_Secondary) {
-    Primary.reset(_Primary);
-    Secondary.reset(_Secondary);
-  }
-
-  virtual void BeginSourceFile(const LangOptions &LO,
-                               const Preprocessor *PP) {
-    Primary->BeginSourceFile(LO, PP);
-    Secondary->BeginSourceFile(LO, PP);
-  }
-
-  virtual void EndSourceFile() {
-    Secondary->EndSourceFile();
-    Primary->EndSourceFile();
-  }
-
-  virtual bool IncludeInDiagnosticCounts() const {
-    return Primary->IncludeInDiagnosticCounts();
-  }
-
-  virtual void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
-                                const DiagnosticInfo &Info) {
-    // Default implementation (Warnings/errors count).
-    DiagnosticConsumer::HandleDiagnostic(DiagLevel, Info);
-
-    Primary->HandleDiagnostic(DiagLevel, Info);
-    Secondary->HandleDiagnostic(DiagLevel, Info);
-  }
-};
-
-} // end namspace clang
-
-#endif

Copied: cfe/trunk/include/clang/Frontend/ChainedDiagnosticConsumer.h (from r140479, cfe/trunk/include/clang/Frontend/ChainedDiagnosticClient.h)
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/ChainedDiagnosticConsumer.h?p2=cfe/trunk/include/clang/Frontend/ChainedDiagnosticConsumer.h&p1=cfe/trunk/include/clang/Frontend/ChainedDiagnosticClient.h&r1=140479&r2=140485&rev=140485&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/ChainedDiagnosticClient.h (original)
+++ cfe/trunk/include/clang/Frontend/ChainedDiagnosticConsumer.h Sun Sep 25 19:21:47 2011
@@ -1,4 +1,4 @@
-//===--- ChainedDiagnosticClient.h - Chain Diagnostic Clients ---*- C++ -*-===//
+//===- ChainedDiagnosticConsumer.h - Chain Diagnostic Clients ---*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_CLANG_FRONTEND_CHAINEDDIAGNOSTICCLIENT_H
-#define LLVM_CLANG_FRONTEND_CHAINEDDIAGNOSTICCLIENT_H
+#ifndef LLVM_CLANG_FRONTEND_CHAINEDDIAGNOSTICCONSUMER_H
+#define LLVM_CLANG_FRONTEND_CHAINEDDIAGNOSTICCONSUMER_H
 
 #include "clang/Basic/Diagnostic.h"
 #include "llvm/ADT/OwningPtr.h"
@@ -16,16 +16,16 @@
 namespace clang {
 class LangOptions;
 
-/// ChainedDiagnosticClient - Chain two diagnostic clients so that diagnostics
+/// ChainedDiagnosticConsumer - Chain two diagnostic clients so that diagnostics
 /// go to the first client and then the second. The first diagnostic client
 /// should be the "primary" client, and will be used for computing whether the
 /// diagnostics should be included in counts.
-class ChainedDiagnosticClient : public DiagnosticConsumer {
+class ChainedDiagnosticConsumer : public DiagnosticConsumer {
   llvm::OwningPtr<DiagnosticConsumer> Primary;
   llvm::OwningPtr<DiagnosticConsumer> Secondary;
 
 public:
-  ChainedDiagnosticClient(DiagnosticConsumer *_Primary,
+  ChainedDiagnosticConsumer(DiagnosticConsumer *_Primary,
                           DiagnosticConsumer *_Secondary) {
     Primary.reset(_Primary);
     Secondary.reset(_Secondary);

Modified: cfe/trunk/lib/Frontend/CompilerInstance.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInstance.cpp?rev=140485&r1=140484&r2=140485&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInstance.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInstance.cpp Sun Sep 25 19:21:47 2011
@@ -19,7 +19,7 @@
 #include "clang/Lex/HeaderSearch.h"
 #include "clang/Lex/Preprocessor.h"
 #include "clang/Lex/PTHManager.h"
-#include "clang/Frontend/ChainedDiagnosticClient.h"
+#include "clang/Frontend/ChainedDiagnosticConsumer.h"
 #include "clang/Frontend/FrontendAction.h"
 #include "clang/Frontend/FrontendActions.h"
 #include "clang/Frontend/FrontendDiagnostic.h"
@@ -106,7 +106,7 @@
   // Chain in a diagnostic client which will log the diagnostics.
   DiagnosticConsumer *Logger =
     new TextDiagnosticPrinter(*OS.take(), DiagOpts, /*OwnsOutputStream=*/true);
-  Diags.setClient(new ChainedDiagnosticClient(Diags.takeClient(), Logger));
+  Diags.setClient(new ChainedDiagnosticConsumer(Diags.takeClient(), Logger));
 }
 
 static void SetUpDiagnosticLog(const DiagnosticOptions &DiagOpts,
@@ -136,7 +136,7 @@
                                                           OwnsStream);
   if (CodeGenOpts)
     Logger->setDwarfDebugFlags(CodeGenOpts->DwarfDebugFlags);
-  Diags.setClient(new ChainedDiagnosticClient(Diags.takeClient(), Logger));
+  Diags.setClient(new ChainedDiagnosticConsumer(Diags.takeClient(), Logger));
 }
 
 void CompilerInstance::createDiagnostics(int Argc, const char* const *Argv,





More information about the cfe-commits mailing list