#include "CXLoadedDiagnostic.h"
#include "CXFile.h"
#include "CXString.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/LLVM.h"
#include "clang/Frontend/SerializedDiagnosticReader.h"
#include "clang/Frontend/SerializedDiagnostics.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Bitstream/BitstreamReader.h"
#include "llvm/Support/ErrorHandling.h"
usingnamespaceclang;
Strings;
namespace {
class CXLoadedDiagnosticSetImpl : public CXDiagnosticSetImpl { … };
}
CXLoadedDiagnostic::~CXLoadedDiagnostic() { … }
CXDiagnosticSeverity CXLoadedDiagnostic::getSeverity() const { … }
static CXSourceLocation makeLocation(const CXLoadedDiagnostic::Location *DLoc) { … }
CXSourceLocation CXLoadedDiagnostic::getLocation() const { … }
CXString CXLoadedDiagnostic::getSpelling() const { … }
CXString CXLoadedDiagnostic::getDiagnosticOption(CXString *Disable) const { … }
unsigned CXLoadedDiagnostic::getCategory() const { … }
CXString CXLoadedDiagnostic::getCategoryText() const { … }
unsigned CXLoadedDiagnostic::getNumRanges() const { … }
CXSourceRange CXLoadedDiagnostic::getRange(unsigned Range) const { … }
unsigned CXLoadedDiagnostic::getNumFixIts() const { … }
CXString CXLoadedDiagnostic::getFixIt(unsigned FixIt,
CXSourceRange *ReplacementRange) const { … }
void CXLoadedDiagnostic::decodeLocation(CXSourceLocation location,
CXFile *file,
unsigned int *line,
unsigned int *column,
unsigned int *offset) { … }
namespace {
class DiagLoader : serialized_diags::SerializedDiagnosticReader { … };
}
CXDiagnosticSet DiagLoader::load(const char *file) { … }
std::error_code
DiagLoader::readLocation(const serialized_diags::Location &SDLoc,
CXLoadedDiagnostic::Location &LoadedLoc) { … }
std::error_code
DiagLoader::readRange(const serialized_diags::Location &SDStart,
const serialized_diags::Location &SDEnd,
CXSourceRange &SR) { … }
std::error_code DiagLoader::visitStartOfDiagnostic() { … }
std::error_code DiagLoader::visitEndOfDiagnostic() { … }
std::error_code DiagLoader::visitCategoryRecord(unsigned ID, StringRef Name) { … }
std::error_code DiagLoader::visitDiagFlagRecord(unsigned ID, StringRef Name) { … }
std::error_code DiagLoader::visitFilenameRecord(unsigned ID, unsigned Size,
unsigned Timestamp,
StringRef Name) { … }
std::error_code
DiagLoader::visitSourceRangeRecord(const serialized_diags::Location &Start,
const serialized_diags::Location &End) { … }
std::error_code
DiagLoader::visitFixitRecord(const serialized_diags::Location &Start,
const serialized_diags::Location &End,
StringRef CodeToInsert) { … }
std::error_code DiagLoader::visitDiagnosticRecord(
unsigned Severity, const serialized_diags::Location &Location,
unsigned Category, unsigned Flag, StringRef Message) { … }
CXDiagnosticSet clang_loadDiagnostics(const char *file,
enum CXLoadDiag_Error *error,
CXString *errorString) { … }