clang 22.0.0git
clang::ForwardingDiagnosticConsumer Class Reference

Diagnostic consumer that forwards diagnostics along to an existing, already-initialized diagnostic consumer. More...

#include "clang/Basic/Diagnostic.h"

Inheritance diagram for clang::ForwardingDiagnosticConsumer:
[legend]

Public Member Functions

 ForwardingDiagnosticConsumer (DiagnosticConsumer &Target)
 ~ForwardingDiagnosticConsumer () override
void HandleDiagnostic (DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) override
 Handle this diagnostic, reporting it to the user or capturing it to a log as needed.
void clear () override
bool IncludeInDiagnosticCounts () const override
 Indicates whether the diagnostics handled by this DiagnosticConsumer should be included in the number of diagnostics reported by DiagnosticsEngine.
Public Member Functions inherited from clang::DiagnosticConsumer
 DiagnosticConsumer ()=default
virtual ~DiagnosticConsumer ()
unsigned getNumErrors () const
unsigned getNumWarnings () const
virtual void BeginSourceFile (const LangOptions &LangOpts, const Preprocessor *PP=nullptr)
 Callback to inform the diagnostic client that processing of a source file is beginning.
virtual void EndSourceFile ()
 Callback to inform the diagnostic client that processing of a source file has ended.
virtual void finish ()
 Callback to inform the diagnostic client that processing of all source files has ended.

Additional Inherited Members

Protected Attributes inherited from clang::DiagnosticConsumer
unsigned NumWarnings = 0
 Number of warnings reported.
unsigned NumErrors = 0
 Number of errors reported.

Detailed Description

Diagnostic consumer that forwards diagnostics along to an existing, already-initialized diagnostic consumer.

Definition at line 1789 of file Diagnostic.h.

Constructor & Destructor Documentation

◆ ForwardingDiagnosticConsumer()

clang::ForwardingDiagnosticConsumer::ForwardingDiagnosticConsumer ( DiagnosticConsumer & Target)
inline

Definition at line 1793 of file Diagnostic.h.

References clang::DiagnosticConsumer::DiagnosticConsumer().

◆ ~ForwardingDiagnosticConsumer()

ForwardingDiagnosticConsumer::~ForwardingDiagnosticConsumer ( )
overridedefault

Member Function Documentation

◆ clear()

void ForwardingDiagnosticConsumer::clear ( )
overridevirtual

Reimplemented from clang::DiagnosticConsumer.

Definition at line 1493 of file Diagnostic.cpp.

References clang::DiagnosticConsumer::clear().

◆ HandleDiagnostic()

void ForwardingDiagnosticConsumer::HandleDiagnostic ( DiagnosticsEngine::Level DiagLevel,
const Diagnostic & Info )
overridevirtual

Handle this diagnostic, reporting it to the user or capturing it to a log as needed.

The default implementation just keeps track of the total number of warnings and errors.

Reimplemented from clang::DiagnosticConsumer.

Definition at line 1488 of file Diagnostic.cpp.

◆ IncludeInDiagnosticCounts()

bool ForwardingDiagnosticConsumer::IncludeInDiagnosticCounts ( ) const
overridevirtual

Indicates whether the diagnostics handled by this DiagnosticConsumer should be included in the number of diagnostics reported by DiagnosticsEngine.

IncludeInDiagnosticCounts - This method (whose default implementation returns true) indicates whether the diagnostics handled by this DiagnosticConsumer should be included in the number of diagnostics reported by DiagnosticsEngine.

The default implementation returns true.

Reimplemented from clang::DiagnosticConsumer.

Definition at line 1498 of file Diagnostic.cpp.


The documentation for this class was generated from the following files: