9 #ifndef LLVM_CLANG_FRONTEND_SERIALIZEDDIAGNOSTICREADER_H 10 #define LLVM_CLANG_FRONTEND_SERIALIZEDDIAGNOSTICREADER_H 13 #include "llvm/Bitstream/BitstreamReader.h" 14 #include "llvm/ADT/StringRef.h" 15 #include "llvm/Support/ErrorOr.h" 16 #include <system_error> 19 namespace serialized_diags {
52 Location(
unsigned FileID,
unsigned Line,
unsigned Col,
unsigned Offset)
53 : FileID(FileID), Line(Line), Col(Col), Offset(Offset) {}
66 std::error_code readDiagnostics(StringRef File);
72 llvm::ErrorOr<Cursor> skipUntilRecordOrBlock(llvm::BitstreamCursor &Stream,
73 unsigned &BlockOrRecordId);
76 std::error_code readMetaBlock(llvm::BitstreamCursor &Stream);
79 std::error_code readDiagnosticBlock(llvm::BitstreamCursor &Stream);
99 virtual std::error_code
101 unsigned Category,
unsigned Flag, StringRef Message) {
113 virtual std::error_code
138 #endif // LLVM_CLANG_FRONTEND_SERIALIZEDDIAGNOSTICREADER_H
std::error_code make_error_code(SDError E)
virtual std::error_code visitStartOfDiagnostic()
Visit the start of a diagnostic block.
Severity
Enum values that allow the client to map NOTEs, WARNINGs, and EXTENSIONs to either Ignore (nothing)...
Location(unsigned FileID, unsigned Line, unsigned Col, unsigned Offset)
A generic error for subclass handlers that don't want or need to define their own error_category...
virtual std::error_code visitSourceRangeRecord(const Location &Start, const Location &End)
Visit a source range.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
virtual std::error_code visitDiagFlagRecord(unsigned ID, StringRef Name)
Visit a flag. This associates the flag's ID to a Name.
virtual std::error_code visitVersionRecord(unsigned Version)
Visit the version of the set of diagnostics.
Dataflow Directional Tag Classes.
A base class that handles reading serialized diagnostics from a file.
virtual std::error_code visitFixitRecord(const Location &Start, const Location &End, StringRef Text)
Visit a fixit hint.
A location that is represented in the serialized diagnostics.
virtual std::error_code visitCategoryRecord(unsigned ID, StringRef Name)
Visit a category. This associates the category ID to a Name.
virtual std::error_code visitFilenameRecord(unsigned ID, unsigned Size, unsigned Timestamp, StringRef Name)
Visit a filename. This associates the file's ID to a Name.
const std::error_category & SDErrorCategory()
virtual std::error_code visitEndOfDiagnostic()
Visit the end of a diagnostic block.
virtual std::error_code visitDiagnosticRecord(unsigned Severity, const Location &Location, unsigned Category, unsigned Flag, StringRef Message)
Visit a diagnostic.