class TextDiagnosticPrinter
Declaration
class TextDiagnosticPrinter : public DiagnosticConsumer { /* full declaration omitted */ };
Description
Abstract interface, implemented by clients of the front-end, which formats and prints fully processed diagnostics.
Declared at: clang/include/clang/Frontend/TextDiagnosticPrinter.h:27
Inherits from: DiagnosticConsumer
Member Variables
- private llvm::raw_ostream& OS
- private IntrusiveRefCntPtr<clang::DiagnosticOptions> DiagOpts
- private std::unique_ptr<TextDiagnostic> TextDiag
- Handle to the currently active text diagnostic emitter.
- private std::string Prefix
- A string to prefix to error messages.
- private unsigned int OwnsOutputStream
Inherited from DiagnosticConsumer:
Method Overview
- public void BeginSourceFile(const clang::LangOptions & LO, const clang::Preprocessor * PP)
- public void EndSourceFile()
- public void HandleDiagnostic(DiagnosticsEngine::Level Level, const clang::Diagnostic & Info)
- public TextDiagnosticPrinter(llvm::raw_ostream & os, clang::DiagnosticOptions * diags, bool OwnsOutputStream = false)
- public void setPrefix(std::string Value)
- public ~TextDiagnosticPrinter()
Inherited from DiagnosticConsumer:
- public BeginSourceFile
- public EndSourceFile
- public HandleDiagnostic
- public IncludeInDiagnosticCounts
- public clear
- public finish
- public getNumErrors
- public getNumWarnings
Methods
¶void BeginSourceFile(
const clang::LangOptions& LO,
const clang::Preprocessor* PP)
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/TextDiagnosticPrinter.h:49
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.
¶void EndSourceFile()
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/TextDiagnosticPrinter.h:50
¶void HandleDiagnostic(
DiagnosticsEngine::Level Level,
const clang::Diagnostic& Info)
void HandleDiagnostic(
DiagnosticsEngine::Level Level,
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/TextDiagnosticPrinter.h:51
Parameters
- DiagnosticsEngine::Level Level
- const clang::Diagnostic& Info
¶TextDiagnosticPrinter(
llvm::raw_ostream& os,
clang::DiagnosticOptions* diags,
bool OwnsOutputStream = false)
TextDiagnosticPrinter(
llvm::raw_ostream& os,
clang::DiagnosticOptions* diags,
bool OwnsOutputStream = false)
Declared at: clang/include/clang/Frontend/TextDiagnosticPrinter.h:40
Parameters
- llvm::raw_ostream& os
- clang::DiagnosticOptions* diags
- bool OwnsOutputStream = false
¶void setPrefix(std::string Value)
void setPrefix(std::string Value)
Description
setPrefix - Set the diagnostic printer prefix string, which will be printed at the start of any diagnostics. If empty, no prefix string is used.
Declared at: clang/include/clang/Frontend/TextDiagnosticPrinter.h:47
Parameters
- std::string Value
¶~TextDiagnosticPrinter()
~TextDiagnosticPrinter()
Declared at: clang/include/clang/Frontend/TextDiagnosticPrinter.h:42