#include "clang/Serialization/GlobalModuleIndex.h"
#include "ASTReaderInternals.h"
#include "clang/Basic/FileManager.h"
#include "clang/Serialization/ASTBitCodes.h"
#include "clang/Serialization/ModuleFile.h"
#include "clang/Serialization/PCHContainerOperations.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Bitstream/BitstreamReader.h"
#include "llvm/Bitstream/BitstreamWriter.h"
#include "llvm/Support/DJB.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/LockFileManager.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/OnDiskHashTable.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/TimeProfiler.h"
#include "llvm/Support/raw_ostream.h"
#include <cstdio>
usingnamespaceclang;
usingnamespaceserialization;
namespace {
enum { … };
enum IndexRecordTypes { … };
}
static const char * const IndexFileName = …;
static const unsigned CurrentVersion = …;
namespace {
class IdentifierIndexReaderTrait { … };
IdentifierIndexTable;
}
GlobalModuleIndex::GlobalModuleIndex(
std::unique_ptr<llvm::MemoryBuffer> IndexBuffer,
llvm::BitstreamCursor Cursor)
: … { … }
GlobalModuleIndex::~GlobalModuleIndex() { … }
std::pair<GlobalModuleIndex *, llvm::Error>
GlobalModuleIndex::readIndex(StringRef Path) { … }
void GlobalModuleIndex::getModuleDependencies(
ModuleFile *File,
SmallVectorImpl<ModuleFile *> &Dependencies) { … }
bool GlobalModuleIndex::lookupIdentifier(StringRef Name, HitSet &Hits) { … }
bool GlobalModuleIndex::loadedModuleFile(ModuleFile *File) { … }
void GlobalModuleIndex::printStats() { … }
LLVM_DUMP_METHOD void GlobalModuleIndex::dump() { … }
namespace {
struct ModuleFileInfo { … };
struct ImportedModuleFileInfo { … };
class GlobalModuleIndexBuilder { … };
}
static void emitBlockID(unsigned ID, const char *Name,
llvm::BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record) { … }
static void emitRecordID(unsigned ID, const char *Name,
llvm::BitstreamWriter &Stream,
SmallVectorImpl<uint64_t> &Record) { … }
void
GlobalModuleIndexBuilder::emitBlockInfoBlock(llvm::BitstreamWriter &Stream) { … }
namespace {
class InterestingASTIdentifierLookupTrait
: public serialization::reader::ASTIdentifierLookupTraitBase { … };
}
llvm::Error GlobalModuleIndexBuilder::loadModuleFile(FileEntryRef File) { … }
namespace {
class IdentifierIndexWriterTrait { … };
}
bool GlobalModuleIndexBuilder::writeIndex(llvm::BitstreamWriter &Stream) { … }
llvm::Error
GlobalModuleIndex::writeIndex(FileManager &FileMgr,
const PCHContainerReader &PCHContainerRdr,
StringRef Path) { … }
namespace {
class GlobalIndexIdentifierIterator : public IdentifierIterator { … };
}
IdentifierIterator *GlobalModuleIndex::createIdentifierIterator() const { … }