16 #ifndef LLVM_CLANG_FRONTEND_TEXTDIAGNOSTIC_H
17 #define LLVM_CLANG_FRONTEND_TEXTDIAGNOSTIC_H
55 bool CLFallbackMode =
false);
74 StringRef Message,
unsigned CurrentColumn,
75 unsigned Columns,
bool ShowColors);
95 emitSnippetAndCaret(Loc, Level, Ranges, Hints, SM);
102 StringRef ModuleName,
106 StringRef ModuleName,
115 void emitSnippet(StringRef SourceLine);
void emitCodeContext(SourceLocation Loc, DiagnosticsEngine::Level Level, SmallVectorImpl< CharSourceRange > &Ranges, ArrayRef< FixItHint > Hints, const SourceManager &SM) override
void emitDiagnosticLoc(SourceLocation Loc, PresumedLoc PLoc, DiagnosticsEngine::Level Level, ArrayRef< CharSourceRange > Ranges, const SourceManager &SM) override
Print out the file/line/column information and include trace.
const LangOptions & LangOpts
void emitImportLocation(SourceLocation Loc, PresumedLoc PLoc, StringRef ModuleName, const SourceManager &SM) override
Class to encapsulate the logic for formatting and printing a textual diagnostic message.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Class to encapsulate the logic for formatting a diagnostic message.
TextDiagnostic(raw_ostream &OS, const LangOptions &LangOpts, DiagnosticOptions *DiagOpts)
~TextDiagnostic() override
IntrusiveRefCntPtr< DiagnosticOptions > DiagOpts
Represents an unpacked "presumed" location which can be presented to the user.
void emitDiagnosticMessage(SourceLocation Loc, PresumedLoc PLoc, DiagnosticsEngine::Level Level, StringRef Message, ArrayRef< CharSourceRange > Ranges, const SourceManager *SM, DiagOrStoredDiag D) override
llvm::PointerUnion< const Diagnostic *, const StoredDiagnostic * > DiagOrStoredDiag
Encodes a location in the source. The SourceManager can decode this to get at the full include stack...
Options for controlling the compiler diagnostics engine.
static void printDiagnosticLevel(raw_ostream &OS, DiagnosticsEngine::Level Level, bool ShowColors, bool CLFallbackMode=false)
Print the diagonstic level to a raw_ostream.
static void printDiagnosticMessage(raw_ostream &OS, bool IsSupplemental, StringRef Message, unsigned CurrentColumn, unsigned Columns, bool ShowColors)
Pretty-print a diagnostic message to a raw_ostream.
void emitIncludeLocation(SourceLocation Loc, PresumedLoc PLoc, const SourceManager &SM) override
void emitBuildingModuleLocation(SourceLocation Loc, PresumedLoc PLoc, StringRef ModuleName, const SourceManager &SM) override
Level
The level of the diagnostic, after it has been through mapping.
This class handles loading and caching of source files into memory.