#include "Serialization.h"
#include "Headers.h"
#include "RIFF.h"
#include "index/MemIndex.h"
#include "index/SymbolLocation.h"
#include "index/SymbolOrigin.h"
#include "index/dex/Dex.h"
#include "support/Logger.h"
#include "support/Trace.h"
#include "clang/Tooling/CompilationDatabase.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Compression.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/raw_ostream.h"
#include <cstdint>
#include <vector>
namespace clang {
namespace clangd {
namespace {
class Reader { … };
void write32(uint32_t I, llvm::raw_ostream &OS) { … }
void writeVar(uint32_t I, llvm::raw_ostream &OS) { … }
class StringTableOut { … };
struct StringTableIn { … };
llvm::Expected<StringTableIn> readStringTable(llvm::StringRef Data) { … }
void writeLocation(const SymbolLocation &Loc, const StringTableOut &Strings,
llvm::raw_ostream &OS) { … }
SymbolLocation readLocation(Reader &Data,
llvm::ArrayRef<llvm::StringRef> Strings) { … }
IncludeGraphNode readIncludeGraphNode(Reader &Data,
llvm::ArrayRef<llvm::StringRef> Strings) { … }
void writeIncludeGraphNode(const IncludeGraphNode &IGN,
const StringTableOut &Strings,
llvm::raw_ostream &OS) { … }
void writeSymbol(const Symbol &Sym, const StringTableOut &Strings,
llvm::raw_ostream &OS) { … }
Symbol readSymbol(Reader &Data, llvm::ArrayRef<llvm::StringRef> Strings,
SymbolOrigin Origin) { … }
void writeRefs(const SymbolID &ID, llvm::ArrayRef<Ref> Refs,
const StringTableOut &Strings, llvm::raw_ostream &OS) { … }
std::pair<SymbolID, std::vector<Ref>>
readRefs(Reader &Data, llvm::ArrayRef<llvm::StringRef> Strings) { … }
void writeRelation(const Relation &R, llvm::raw_ostream &OS) { … }
Relation readRelation(Reader &Data) { … }
struct InternedCompileCommand { … };
void writeCompileCommand(const InternedCompileCommand &Cmd,
const StringTableOut &Strings,
llvm::raw_ostream &CmdOS) { … }
InternedCompileCommand
readCompileCommand(Reader CmdReader, llvm::ArrayRef<llvm::StringRef> Strings) { … }
constexpr static uint32_t Version = …;
llvm::Expected<IndexFileIn> readRIFF(llvm::StringRef Data,
SymbolOrigin Origin) { … }
template <class Callback>
void visitStrings(IncludeGraphNode &IGN, const Callback &CB) { … }
void writeRIFF(const IndexFileOut &Data, llvm::raw_ostream &OS) { … }
}
void writeYAML(const IndexFileOut &, llvm::raw_ostream &);
llvm::Expected<IndexFileIn> readYAML(llvm::StringRef, SymbolOrigin Origin);
llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const IndexFileOut &O) { … }
llvm::Expected<IndexFileIn> readIndexFile(llvm::StringRef Data,
SymbolOrigin Origin) { … }
std::unique_ptr<SymbolIndex> loadIndex(llvm::StringRef SymbolFilename,
SymbolOrigin Origin, bool UseDex) { … }
}
}