clang 10.0.0git

Public Member Functions | List of all members
clang::ChainedDiagnosticConsumer Class Reference

ChainedDiagnosticConsumer - Chain two diagnostic clients so that diagnostics go to the first client and then the second. More...

`#include "clang/Frontend/ChainedDiagnosticConsumer.h"`

Inheritance diagram for clang::ChainedDiagnosticConsumer:
[legend]
Collaboration diagram for clang::ChainedDiagnosticConsumer:
[legend]

## Public Member Functions
| ChainedDiagnosticConsumer (std::unique_ptr< DiagnosticConsumer > Primary, std::unique_ptr< DiagnosticConsumer > Secondary)
| ChainedDiagnosticConsumer (DiagnosticConsumer *Primary, std::unique_ptr< DiagnosticConsumer > Secondary)
| Construct without taking ownership of `Primary`. More...
void | BeginSourceFile (const LangOptions &LO, const Preprocessor *PP) override
| Callback to inform the diagnostic client that processing of a source file is beginning. More...
void | EndSourceFile () override
| Callback to inform the diagnostic client that processing of a source file has ended. More...
void | finish () override
| Callback to inform the diagnostic client that processing of all source files has ended. More...
bool | IncludeInDiagnosticCounts () const override
| Indicates whether the diagnostics handled by this DiagnosticConsumer should be included in the number of diagnostics reported by DiagnosticsEngine. More...
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. More...
Public Member Functions inherited from clang::DiagnosticConsumer
| DiagnosticConsumer ()=default
virtual | ~DiagnosticConsumer ()
unsigned | getNumErrors () const
unsigned | getNumWarnings () const
virtual void | clear ()

## Additional Inherited Members
Protected Attributes inherited from clang::DiagnosticConsumer
unsigned | NumWarnings = 0
| Number of warnings reported. More...
unsigned | NumErrors = 0
| Number of errors reported. More...

## Detailed 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.

Definition at line 22 of file ChainedDiagnosticConsumer.h.

## Constructor & Destructor Documentation

## ◆ ChainedDiagnosticConsumer() [1/2]

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

Definition at line 29 of file ChainedDiagnosticConsumer.h.

## ◆ ChainedDiagnosticConsumer() [2/2]

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

Construct without taking ownership of `Primary`.

Definition at line 35 of file ChainedDiagnosticConsumer.h.

## Member Function Documentation

## ◆ BeginSourceFile()

void clang::ChainedDiagnosticConsumer::BeginSourceFile | ( | const LangOptions & | LangOpts,
|  | const Preprocessor * | PP
| ) |  |
| inline override virtual

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().

Parameters

  LangOpts | The language options for the source file being processed.
  PP | The preprocessor object being used for the source; this is optional, e.g., it may not be present when processing AST source files.

Reimplemented from clang::DiagnosticConsumer.

Definition at line 39 of file ChainedDiagnosticConsumer.h.

References clang::DiagnosticConsumer::BeginSourceFile().

## ◆ EndSourceFile()

void clang::ChainedDiagnosticConsumer::EndSourceFile | ( |  | ) |
| inline override virtual

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.

Reimplemented from clang::DiagnosticConsumer.

Definition at line 45 of file ChainedDiagnosticConsumer.h.

References clang::DiagnosticConsumer::EndSourceFile().

## ◆ finish()

void clang::ChainedDiagnosticConsumer::finish | ( |  | ) |
| inline override virtual

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

Reimplemented from clang::DiagnosticConsumer.

Definition at line 50 of file ChainedDiagnosticConsumer.h.

References clang::DiagnosticConsumer::finish().

## ◆ HandleDiagnostic()

void clang::ChainedDiagnosticConsumer::HandleDiagnostic | ( | DiagnosticsEngine::Level | DiagLevel,
|  | const Diagnostic & | Info
| ) |  |
| inline override virtual

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 59 of file ChainedDiagnosticConsumer.h.

References clang::DiagnosticConsumer::HandleDiagnostic().

## ◆ IncludeInDiagnosticCounts()

bool clang::ChainedDiagnosticConsumer::IncludeInDiagnosticCounts | ( |  | ) | const
| inline override virtual

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 55 of file ChainedDiagnosticConsumer.h.

References clang::DiagnosticConsumer::IncludeInDiagnosticCounts().

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

- include/clang/Frontend/ChainedDiagnosticConsumer.h
- lib/Frontend/ChainedDiagnosticConsumer.cpp