10 #ifndef LLVM_CLANG_FRONTEND_SERIALIZED_DIAGNOSTIC_READER_H_ 11 #define LLVM_CLANG_FRONTEND_SERIALIZED_DIAGNOSTIC_READER_H_ 14 #include "llvm/Bitcode/BitstreamReader.h" 15 #include "llvm/Support/ErrorOr.h" 18 namespace serialized_diags {
50 Location(
unsigned FileID,
unsigned Line,
unsigned Col,
unsigned Offset)
51 : FileID(FileID), Line(Line), Col(Col), Offset(Offset) {}
64 std::error_code readDiagnostics(StringRef File);
70 llvm::ErrorOr<Cursor> skipUntilRecordOrBlock(llvm::BitstreamCursor &Stream,
71 unsigned &BlockOrRecordId);
74 std::error_code readMetaBlock(llvm::BitstreamCursor &Stream);
77 std::error_code readDiagnosticBlock(llvm::BitstreamCursor &Stream);
82 return std::error_code();
88 return std::error_code();
92 return std::error_code();
95 virtual std::error_code
97 unsigned Category,
unsigned Flag, StringRef Message) {
98 return std::error_code();
104 return std::error_code();
107 virtual std::error_code
109 return std::error_code();
114 return std::error_code();
118 return std::error_code();
std::error_code make_error_code(SDError E)
virtual std::error_code visitStartOfDiagnostic()
Visit the start of a diagnostic block.
virtual ~SerializedDiagnosticReader()
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.
SerializedDiagnosticReader()
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.