zcov: / include/clang/Frontend/ChainedDiagnosticClient.h


Files: 1 Branches Taken: 0.0% 0 / 4
Generated: 2010-02-10 01:31 Branches Executed: 0.0% 0 / 4
Line Coverage: 0.0% 0 / 19


Programs: 2 Runs 3018


       1                 : //===--- ChainedDiagnosticClient.h - Chain Diagnostic Clients ---*- C++ -*-===//
       2                 : //
       3                 : //                     The LLVM Compiler Infrastructure
       4                 : //
       5                 : // This file is distributed under the University of Illinois Open Source
       6                 : // License. See LICENSE.TXT for details.
       7                 : //
       8                 : //===----------------------------------------------------------------------===//
       9                 : 
      10                 : #ifndef LLVM_CLANG_FRONTEND_CHAINEDDIAGNOSTICCLIENT_H
      11                 : #define LLVM_CLANG_FRONTEND_CHAINEDDIAGNOSTICCLIENT_H
      12                 : 
      13                 : #include "clang/Basic/Diagnostic.h"
      14                 : #include "llvm/ADT/OwningPtr.h"
      15                 : 
      16                 : namespace clang {
      17                 : class LangOptions;
      18                 : 
      19                 : /// ChainedDiagnosticClient - Chain two diagnostic clients so that diagnostics
      20                 : /// go to the first client and then the second. The first diagnostic client
      21                 : /// should be the "primary" client, and will be used for computing whether the
      22                 : /// diagnostics should be included in counts.
                        0: branch 3 not taken
                        0: branch 4 not taken
                        0: branch 9 not taken
                        0: branch 10 not taken
      23                0: class ChainedDiagnosticClient : public DiagnosticClient {
      24                 :   llvm::OwningPtr<DiagnosticClient> Primary;
      25                 :   llvm::OwningPtr<DiagnosticClient> Secondary;
      26                 : 
      27                 : public:
      28                 :   ChainedDiagnosticClient(DiagnosticClient *_Primary,
      29                0:                           DiagnosticClient *_Secondary) {
      30                0:     Primary.reset(_Primary);
      31                0:     Secondary.reset(_Secondary);
      32                0:   }
      33                 : 
      34                 :   virtual void BeginSourceFile(const LangOptions &LO,
      35                0:                                const Preprocessor *PP) {
      36                0:     Primary->BeginSourceFile(LO, PP);
      37                0:     Secondary->BeginSourceFile(LO, PP);
      38                0:   }
      39                 : 
      40                0:   virtual void EndSourceFile() {
      41                0:     Secondary->EndSourceFile();
      42                0:     Primary->EndSourceFile();
      43                0:   }
      44                 : 
      45                0:   virtual bool IncludeInDiagnosticCounts() const {
      46                0:     return Primary->IncludeInDiagnosticCounts();
      47                 :   }
      48                 : 
      49                 :   virtual void HandleDiagnostic(Diagnostic::Level DiagLevel,
      50                0:                                 const DiagnosticInfo &Info) {
      51                0:     Primary->HandleDiagnostic(DiagLevel, Info);
      52                0:     Secondary->HandleDiagnostic(DiagLevel, Info);
      53                0:   }
      54                 : };
      55                 : 
      56                 : } // end namspace clang
      57                 : 
      58                 : #endif

Generated: 2010-02-10 01:31 by zcov