clang
3.7.0
|
#include <TextDiagnosticPrinter.h>
Public Member Functions | |
TextDiagnosticPrinter (raw_ostream &os, DiagnosticOptions *diags, bool OwnsOutputStream=false) | |
~TextDiagnosticPrinter () override | |
void | setPrefix (std::string Value) |
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 | HandleDiagnostic (DiagnosticsEngine::Level Level, const Diagnostic &Info) override |
Handle this diagnostic, reporting it to the user or capturing it to a log as needed. More... | |
![]() | |
DiagnosticConsumer () | |
unsigned | getNumErrors () const |
unsigned | getNumWarnings () const |
virtual void | clear () |
virtual | ~DiagnosticConsumer () |
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... | |
Additional Inherited Members | |
![]() | |
unsigned | NumWarnings |
Number of warnings reported. More... | |
unsigned | NumErrors |
Number of errors reported. More... | |
Definition at line 28 of file TextDiagnosticPrinter.h.
TextDiagnosticPrinter::TextDiagnosticPrinter | ( | raw_ostream & | os, |
DiagnosticOptions * | diags, | ||
bool | OwnsOutputStream = false |
||
) |
Definition at line 27 of file TextDiagnosticPrinter.cpp.
|
override |
Definition at line 34 of file TextDiagnosticPrinter.cpp.
|
overridevirtual |
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 from clang::DiagnosticConsumer.
Definition at line 39 of file TextDiagnosticPrinter.cpp.
Referenced by emitPremigrationErrors().
|
overridevirtual |
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 TextDiagnosticPrinter.cpp.
Referenced by emitPremigrationErrors().
|
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 112 of file TextDiagnosticPrinter.cpp.
References clang::Diagnostic::FormatDiagnostic(), clang::Diagnostic::getFixItHints(), clang::Diagnostic::getLocation(), clang::Diagnostic::getRanges(), clang::Diagnostic::getSourceManager(), clang::DiagnosticConsumer::HandleDiagnostic(), clang::Diagnostic::hasSourceManager(), clang::SourceLocation::isValid(), clang::TextDiagnostic::printDiagnosticLevel(), clang::TextDiagnostic::printDiagnosticMessage(), and printDiagnosticOptions().
|
inline |
setPrefix - Set the diagnostic printer prefix string, which will be printed at the start of any diagnostics. If empty, no prefix string is used.
Definition at line 48 of file TextDiagnosticPrinter.h.