clang API Documentation
#include <Diagnostic.h>


Public Member Functions | |
| DiagnosticConsumer () | |
| unsigned | getNumErrors () const |
| unsigned | getNumWarnings () const |
| virtual void | clear () |
| virtual | ~DiagnosticConsumer () |
| virtual void | BeginSourceFile (const LangOptions &LangOpts, const Preprocessor *PP=0) |
| virtual void | EndSourceFile () |
| virtual void | finish () |
| Callback to inform the diagnostic client that processing of all source files has ended. | |
| virtual bool | IncludeInDiagnosticCounts () const |
| virtual void | HandleDiagnostic (DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) |
| virtual DiagnosticConsumer * | clone (DiagnosticsEngine &Diags) const =0 |
| Clone the diagnostic consumer, producing an equivalent consumer that can be used in a different context. | |
Protected Attributes | |
| unsigned | NumWarnings |
| unsigned | NumErrors |
DiagnosticConsumer - This is an abstract interface implemented by clients of the front-end, which formats and prints fully processed diagnostics.
Definition at line 1145 of file Diagnostic.h.
| clang::DiagnosticConsumer::DiagnosticConsumer | ( | ) | [inline] |
Definition at line 1151 of file Diagnostic.h.
| DiagnosticConsumer::~DiagnosticConsumer | ( | ) | [virtual] |
Definition at line 405 of file Diagnostic.cpp.
| virtual void clang::DiagnosticConsumer::BeginSourceFile | ( | const LangOptions & | LangOpts, |
| const Preprocessor * | PP = 0 |
||
| ) | [inline, virtual] |
BeginSourceFile - 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().
Reimplemented in clang::VerifyDiagnosticConsumer, clang::LogDiagnosticPrinter, clang::TextDiagnosticPrinter, and clang::ChainedDiagnosticConsumer.
Definition at line 1170 of file Diagnostic.h.
Referenced by clang::arcmt::MigrationProcess::applyTransform(), clang::VerifyDiagnosticConsumer::BeginSourceFile(), clang::FrontendAction::BeginSourceFile(), clang::arcmt::checkForManualIssues(), and clang::ASTMergeAction::ExecuteAction().
| virtual void clang::DiagnosticConsumer::clear | ( | ) | [inline, virtual] |
Definition at line 1155 of file Diagnostic.h.
References NumErrors, and NumWarnings.
Referenced by clang::FixItRecompile::BeginInvocation().
| virtual DiagnosticConsumer* clang::DiagnosticConsumer::clone | ( | DiagnosticsEngine & | Diags | ) | const [pure virtual] |
Clone the diagnostic consumer, producing an equivalent consumer that can be used in a different context.
Implemented in clang::FixItRewriter, clang::VerifyDiagnosticConsumer, clang::LogDiagnosticPrinter, clang::ChainedDiagnosticConsumer, clang::TextDiagnosticPrinter, and clang::TextDiagnosticBuffer.
Referenced by clang::VerifyDiagnosticConsumer::clone(), clang::CompilerInstance::createDiagnostics(), and clang::ModuleMap::ModuleMap().
| virtual void clang::DiagnosticConsumer::EndSourceFile | ( | ) | [inline, virtual] |
EndSourceFile - 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
Reimplemented in clang::VerifyDiagnosticConsumer, clang::LogDiagnosticPrinter, clang::TextDiagnosticPrinter, and clang::ChainedDiagnosticConsumer.
Definition at line 1176 of file Diagnostic.h.
Referenced by clang::arcmt::MigrationProcess::applyTransform(), clang::FrontendAction::BeginSourceFile(), clang::arcmt::checkForManualIssues(), clang::VerifyDiagnosticConsumer::EndSourceFile(), clang::FrontendAction::EndSourceFile(), and clang::ASTMergeAction::ExecuteAction().
| virtual void clang::DiagnosticConsumer::finish | ( | ) | [inline, virtual] |
Callback to inform the diagnostic client that processing of all source files has ended.
Reimplemented in clang::ChainedDiagnosticConsumer.
Definition at line 1180 of file Diagnostic.h.
Referenced by clang::CompilerInstance::ExecuteAction().
| unsigned clang::DiagnosticConsumer::getNumErrors | ( | ) | const [inline] |
Definition at line 1153 of file Diagnostic.h.
References NumErrors.
Referenced by clang::arcmt::MigrationProcess::applyTransform(), and clang::CompilerInstance::ExecuteAction().
| unsigned clang::DiagnosticConsumer::getNumWarnings | ( | ) | const [inline] |
Definition at line 1154 of file Diagnostic.h.
References NumWarnings.
Referenced by clang::CompilerInstance::ExecuteAction().
| void DiagnosticConsumer::HandleDiagnostic | ( | DiagnosticsEngine::Level | DiagLevel, |
| const Diagnostic & | Info | ||
| ) | [virtual] |
HandleDiagnostic - Handle this diagnostic, reporting it to the user or capturing it to a log as needed.
Default implementation just keeps track of the total number of warnings and errors.
Reimplemented in clang::FixItRewriter, clang::VerifyDiagnosticConsumer, clang::LogDiagnosticPrinter, clang::ChainedDiagnosticConsumer, clang::TextDiagnosticPrinter, and clang::TextDiagnosticBuffer.
Definition at line 407 of file Diagnostic.cpp.
References clang::DiagnosticsEngine::Error, IncludeInDiagnosticCounts(), NumErrors, NumWarnings, and clang::DiagnosticsEngine::Warning.
Referenced by clang::FixItRewriter::HandleDiagnostic(), and clang::DiagnosticsEngine::Report().
| bool DiagnosticConsumer::IncludeInDiagnosticCounts | ( | ) | const [virtual] |
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.
Reimplemented in clang::FixItRewriter, and clang::ChainedDiagnosticConsumer.
Definition at line 862 of file Diagnostic.cpp.
Referenced by HandleDiagnostic(), clang::FixItRewriter::IncludeInDiagnosticCounts(), and clang::DiagnosticsEngine::Report().
unsigned clang::DiagnosticConsumer::NumErrors [protected] |
Definition at line 1148 of file Diagnostic.h.
Referenced by clear(), getNumErrors(), and HandleDiagnostic().
unsigned clang::DiagnosticConsumer::NumWarnings [protected] |
Definition at line 1147 of file Diagnostic.h.
Referenced by clear(), getNumWarnings(), and HandleDiagnostic().