clang
8.0.0
|
Abstract interface, implemented by clients of the front-end, which formats and prints fully processed diagnostics. More...
#include "clang/Basic/Diagnostic.h"
Public Member Functions | |
DiagnosticConsumer ()=default | |
virtual | ~DiagnosticConsumer () |
unsigned | getNumErrors () const |
unsigned | getNumWarnings () const |
virtual void | clear () |
virtual void | BeginSourceFile (const LangOptions &LangOpts, const Preprocessor *PP=nullptr) |
Callback to inform the diagnostic client that processing of a source file is beginning. More... | |
virtual void | EndSourceFile () |
Callback to inform the diagnostic client that processing of a source file has ended. More... | |
virtual void | finish () |
Callback to inform the diagnostic client that processing of all source files has ended. More... | |
virtual bool | IncludeInDiagnosticCounts () const |
Indicates whether the diagnostics handled by this DiagnosticConsumer should be included in the number of diagnostics reported by DiagnosticsEngine. More... | |
virtual void | HandleDiagnostic (DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) |
Handle this diagnostic, reporting it to the user or capturing it to a log as needed. More... | |
Protected Attributes | |
unsigned | NumWarnings = 0 |
Number of warnings reported. More... | |
unsigned | NumErrors = 0 |
Number of errors reported. More... | |
Abstract interface, implemented by clients of the front-end, which formats and prints fully processed diagnostics.
Definition at line 1488 of file Diagnostic.h.
|
default |
|
virtualdefault |
Referenced by clang::DiagnosticsEngine::EmitCurrentDiagnostic().
|
inlinevirtual |
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().
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 in clang::VerifyDiagnosticConsumer, clang::LogDiagnosticPrinter, clang::TextDiagnosticPrinter, and clang::ChainedDiagnosticConsumer.
Definition at line 1512 of file Diagnostic.h.
Referenced by clang::arcmt::MigrationProcess::applyTransform(), clang::ChainedDiagnosticConsumer::BeginSourceFile(), clang::FrontendAction::BeginSourceFile(), clang::arcmt::checkForManualIssues(), clang::ASTUnit::enableSourceFileDiagnostics(), clang::ASTMergeAction::ExecuteAction(), and clang::arcmt::CapturedDiagList::hasErrors().
|
inlinevirtual |
Reimplemented in clang::ForwardingDiagnosticConsumer.
Definition at line 1499 of file Diagnostic.h.
Referenced by clang::FixItRecompile::BeginInvocation(), and clang::ForwardingDiagnosticConsumer::clear().
|
inlinevirtual |
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 in clang::VerifyDiagnosticConsumer, clang::LogDiagnosticPrinter, clang::TextDiagnosticPrinter, and clang::ChainedDiagnosticConsumer.
Definition at line 1520 of file Diagnostic.h.
Referenced by clang::arcmt::MigrationProcess::applyTransform(), clang::FrontendAction::BeginSourceFile(), clang::arcmt::checkForManualIssues(), clang::ChainedDiagnosticConsumer::EndSourceFile(), clang::FrontendAction::EndSourceFile(), clang::ASTMergeAction::ExecuteAction(), clang::arcmt::CapturedDiagList::hasErrors(), and clang::ASTUnit::~ASTUnit().
|
inlinevirtual |
Callback to inform the diagnostic client that processing of all source files has ended.
Reimplemented in clang::ChainedDiagnosticConsumer.
Definition at line 1524 of file Diagnostic.h.
Referenced by clang::ChainedDiagnosticConsumer::finish().
|
inline |
Definition at line 1497 of file Diagnostic.h.
Referenced by clang::arcmt::MigrationProcess::applyTransform().
|
inline |
Definition at line 1498 of file Diagnostic.h.
|
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 in clang::ForwardingDiagnosticConsumer, clang::VerifyDiagnosticConsumer, clang::FixItRewriter, clang::LogDiagnosticPrinter, clang::ChainedDiagnosticConsumer, clang::TextDiagnosticBuffer, and clang::TextDiagnosticPrinter.
Definition at line 533 of file Diagnostic.cpp.
References clang::DiagnosticsEngine::Error, and clang::DiagnosticsEngine::Warning.
Referenced by clang::tooling::CompilationDatabase::getAllCompileCommands(), clang::DiagnosticIDs::getNearestOption(), clang::TextDiagnosticPrinter::HandleDiagnostic(), clang::TextDiagnosticBuffer::HandleDiagnostic(), clang::ChainedDiagnosticConsumer::HandleDiagnostic(), clang::LogDiagnosticPrinter::HandleDiagnostic(), clang::FixItRewriter::HandleDiagnostic(), and clang::DiagnosticsEngine::Report().
|
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 in clang::ForwardingDiagnosticConsumer, clang::FixItRewriter, and clang::ChainedDiagnosticConsumer.
Definition at line 1116 of file Diagnostic.cpp.
References clang::ForwardingDiagnosticConsumer::~ForwardingDiagnosticConsumer().
Referenced by clang::DiagnosticIDs::getNearestOption(), clang::ChainedDiagnosticConsumer::IncludeInDiagnosticCounts(), and clang::DiagnosticsEngine::Report().
|
protected |
Number of errors reported.
Definition at line 1491 of file Diagnostic.h.
Referenced by clang::VerifyDiagnosticConsumer::UpdateParsedFileStatus().
|
protected |
Number of warnings reported.
Definition at line 1490 of file Diagnostic.h.