class ChainedDiagnosticConsumer

Declaration

class ChainedDiagnosticConsumer : public DiagnosticConsumer { /* full declaration omitted */ };

Description

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.

Declared at: clang/include/clang/Frontend/ChainedDiagnosticConsumer.h:22

Inherits from: DiagnosticConsumer

Member Variables

private std::unique_ptr<DiagnosticConsumer> OwningPrimary
private clang::DiagnosticConsumer* Primary
private std::unique_ptr<DiagnosticConsumer> Secondary

Inherited from DiagnosticConsumer:

protected NumWarnings = 0
protected NumErrors = 0

Method Overview

Inherited from DiagnosticConsumer:

Methods

void BeginSourceFile(
    const clang::LangOptions& LO,
    const clang::Preprocessor* PP)

Description

Callback to inform the diagnostic client that processing of a source file is beginning. Note that diagnostics may be emitted outside the processing of a source file, for example during the parsing of command line options. However, diagnostics with source range information are required to only be emitted in between BeginSourceFile() and EndSourceFile().

Declared at: clang/include/clang/Frontend/ChainedDiagnosticConsumer.h:39

Parameters

const clang::LangOptions& LO
const clang::Preprocessor* PP
The preprocessor object being used for the source; this is optional, e.g., it may not be present when processing AST source files.

ChainedDiagnosticConsumer(
    std::unique_ptr<DiagnosticConsumer> Primary,
    std::unique_ptr<DiagnosticConsumer> Secondary)

Declared at: clang/include/clang/Frontend/ChainedDiagnosticConsumer.h:29

Parameters

std::unique_ptr<DiagnosticConsumer> Primary
std::unique_ptr<DiagnosticConsumer> Secondary

ChainedDiagnosticConsumer(
    clang::DiagnosticConsumer* Primary,
    std::unique_ptr<DiagnosticConsumer> Secondary)

Description

Construct without taking ownership of \c Primary.

Declared at: clang/include/clang/Frontend/ChainedDiagnosticConsumer.h:35

Parameters

clang::DiagnosticConsumer* Primary
std::unique_ptr<DiagnosticConsumer> Secondary

void EndSourceFile()

Description

Callback to inform the diagnostic client that processing of a source file has ended. The diagnostic client should assume that any objects made available via BeginSourceFile() are inaccessible.

Declared at: clang/include/clang/Frontend/ChainedDiagnosticConsumer.h:45

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

Description

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.

Declared at: clang/include/clang/Frontend/ChainedDiagnosticConsumer.h:59

Parameters

DiagnosticsEngine::Level DiagLevel
const clang::Diagnostic& Info

bool IncludeInDiagnosticCounts() const

Description

Indicates whether the diagnostics handled by this DiagnosticConsumer should be included in the number of diagnostics reported by DiagnosticsEngine. The default implementation returns true.

Declared at: clang/include/clang/Frontend/ChainedDiagnosticConsumer.h:55

virtual void anchor()

Declared at: clang/include/clang/Frontend/ChainedDiagnosticConsumer.h:23

void finish()

Description

Callback to inform the diagnostic client that processing of all source files has ended.

Declared at: clang/include/clang/Frontend/ChainedDiagnosticConsumer.h:50