16 #ifndef LLVM_CLANG_FRONTEND_DIAGNOSTICRENDERER_H 17 #define LLVM_CLANG_FRONTEND_DIAGNOSTICRENDERER_H 23 #include "llvm/ADT/ArrayRef.h" 24 #include "llvm/ADT/IntrusiveRefCntPtr.h" 25 #include "llvm/ADT/PointerUnion.h" 26 #include "llvm/ADT/StringRef.h" 34 llvm::PointerUnion<const Diagnostic *, const StoredDiagnostic *>;
94 StringRef ModuleName) = 0;
96 StringRef ModuleName) = 0;
104 void emitBasicNote(StringRef Message);
109 void emitImportStackRecursively(
FullSourceLoc Loc, StringRef ModuleName);
154 StringRef ModuleName)
override;
157 StringRef ModuleName)
override;
159 virtual void emitNote(
FullSourceLoc Loc, StringRef Message) = 0;
164 #endif // LLVM_CLANG_FRONTEND_DIAGNOSTICRENDERER_H static DiagnosticBuilder Diag(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc TokLoc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, unsigned DiagID)
Produce a diagnostic highlighting some portion of a literal.
virtual void emitCodeContext(FullSourceLoc Loc, DiagnosticsEngine::Level Level, SmallVectorImpl< CharSourceRange > &Ranges, ArrayRef< FixItHint > Hints)=0
Represents a diagnostic in a form that can be retained until its corresponding source manager is dest...
void emitStoredDiagnostic(StoredDiagnostic &Diag)
llvm::PointerUnion< const Diagnostic *, const StoredDiagnostic * > DiagOrStoredDiag
const LangOptions & LangOpts
virtual void emitBuildingModuleLocation(FullSourceLoc Loc, PresumedLoc PLoc, StringRef ModuleName)=0
virtual ~DiagnosticRenderer()
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.
virtual void emitImportLocation(FullSourceLoc Loc, PresumedLoc PLoc, StringRef ModuleName)=0
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
void emitDiagnostic(FullSourceLoc Loc, DiagnosticsEngine::Level Level, StringRef Message, ArrayRef< CharSourceRange > Ranges, ArrayRef< FixItHint > FixItHints, DiagOrStoredDiag D=(Diagnostic *) nullptr)
Emit a diagnostic.
DiagnosticsEngine::Level LastLevel
The level of the last diagnostic emitted.
Defines the Diagnostic-related interfaces.
IntrusiveRefCntPtr< DiagnosticOptions > DiagOpts
DiagnosticNoteRenderer(const LangOptions &LangOpts, DiagnosticOptions *DiagOpts)
Represents an unpacked "presumed" location which can be presented to the user.
virtual void emitDiagnosticLoc(FullSourceLoc Loc, PresumedLoc PLoc, DiagnosticsEngine::Level Level, ArrayRef< CharSourceRange > Ranges)=0
virtual void emitDiagnosticMessage(FullSourceLoc Loc, PresumedLoc PLoc, DiagnosticsEngine::Level Level, StringRef Message, ArrayRef< CharSourceRange > Ranges, DiagOrStoredDiag Info)=0
Encodes a location in the source.
Subclass of DiagnosticRender that turns all subdiagostics into explicit notes.
Options for controlling the compiler diagnostics engine.
virtual void beginDiagnostic(DiagOrStoredDiag D, DiagnosticsEngine::Level Level)
DiagnosticRenderer(const LangOptions &LangOpts, DiagnosticOptions *DiagOpts)
SourceLocation LastLoc
The location of the previous diagnostic if known.
Dataflow Directional Tag Classes.
SourceLocation LastIncludeLoc
The location of the last include whose stack was printed if known.
virtual void endDiagnostic(DiagOrStoredDiag D, DiagnosticsEngine::Level Level)
virtual void emitIncludeLocation(FullSourceLoc Loc, PresumedLoc PLoc)=0
Defines the clang::SourceLocation class and associated facilities.
Level
The level of the diagnostic, after it has been through mapping.
A little helper class (which is basically a smart pointer that forwards info from DiagnosticsEngine) ...
A SourceLocation and its associated SourceManager.
This class handles loading and caching of source files into memory.