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>
19namespace serialized_diags {
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
132struct std::is_error_code_enum<
clang::serialized_diags::SDError>
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
A base class that handles reading serialized diagnostics from a file.
virtual std::error_code visitCategoryRecord(unsigned ID, StringRef Name)
Visit a category. This associates the category ID to a Name.
virtual std::error_code visitDiagFlagRecord(unsigned ID, StringRef Name)
Visit a flag. This associates the flag's ID to a Name.
SerializedDiagnosticReader()=default
virtual std::error_code visitStartOfDiagnostic()
Visit the start of a diagnostic block.
virtual std::error_code visitDiagnosticRecord(unsigned Severity, const Location &Location, unsigned Category, unsigned Flag, StringRef Message)
Visit a diagnostic.
virtual std::error_code visitSourceRangeRecord(const Location &Start, const Location &End)
Visit a source range.
virtual ~SerializedDiagnosticReader()=default
virtual std::error_code visitVersionRecord(unsigned Version)
Visit the version of the set of diagnostics.
virtual std::error_code visitFixitRecord(const Location &Start, const Location &End, StringRef Text)
Visit a fixit hint.
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.
std::error_code readDiagnostics(StringRef File)
Read the diagnostics in File.
virtual std::error_code visitEndOfDiagnostic()
Visit the end of a diagnostic block.
std::error_code make_error_code(SDError E)
const std::error_category & SDErrorCategory()
@ MalformedDiagnosticBlock
@ HandlerFailed
A generic error for subclass handlers that don't want or need to define their own error_category.
@ MalformedBlockInfoBlock
@ MalformedDiagnosticRecord
The JSON file list parser is used to communicate input to InstallAPI.
A location that is represented in the serialized diagnostics.
Location(unsigned FileID, unsigned Line, unsigned Col, unsigned Offset)