15#ifndef LLVM_CLANG_SERIALIZATION_GLOBALMODULEINDEX_H
16#define LLVM_CLANG_SERIALIZATION_GLOBALMODULEINDEX_H
18#include "llvm/ADT/DenseMap.h"
19#include "llvm/ADT/SmallPtrSet.h"
20#include "llvm/ADT/SmallVector.h"
21#include "llvm/ADT/StringMap.h"
22#include "llvm/ADT/StringRef.h"
23#include "llvm/Support/Error.h"
54class GlobalModuleIndex {
59 std::unique_ptr<llvm::MemoryBuffer> Buffer;
66 void *IdentifierIndex;
70 ModuleInfo() =
default;
73 ModuleFile *
File =
nullptr;
99 llvm::DenseMap<ModuleFile *, unsigned> ModulesByFile;
105 llvm::StringMap<unsigned> UnresolvedModules;
108 unsigned NumIdentifierLookups;
112 unsigned NumIdentifierLookupHits;
115 explicit GlobalModuleIndex(std::unique_ptr<llvm::MemoryBuffer> Buffer,
116 llvm::BitstreamCursor Cursor);
118 GlobalModuleIndex(
const GlobalModuleIndex &) =
delete;
119 GlobalModuleIndex &operator=(
const GlobalModuleIndex &) =
delete;
131 static std::pair<GlobalModuleIndex *, llvm::Error>
179 llvm::StringRef Path);
Implements support for file system lookup, file system caching, and directory search management.
bool loadedModuleFile(ModuleFile *File)
Note that the given module file has been loaded.
void printStats()
Print statistics to standard error.
llvm::SmallPtrSet< ModuleFile *, 4 > HitSet
A set of module files in which we found a result.
bool lookupIdentifier(llvm::StringRef Name, HitSet &Hits)
Look for all of the module files with information about the given identifier, e.g....
void getModuleDependencies(ModuleFile *File, llvm::SmallVectorImpl< ModuleFile * > &Dependencies)
Retrieve the set of module files on which the given module file directly depends.
IdentifierIterator * createIdentifierIterator() const
Returns an iterator for identifiers stored in the index table.
static std::pair< GlobalModuleIndex *, llvm::Error > readIndex(llvm::StringRef Path)
Read a global index file for the given directory.
void dump()
Print debugging view to standard error.
static llvm::Error writeIndex(FileManager &FileMgr, const PCHContainerReader &PCHContainerRdr, llvm::StringRef Path)
Write a global index into the given.
An iterator that walks over all of the known identifiers in the lookup table.
A registry of PCHContainerWriter and -Reader objects for different formats.
This abstract interface provides operations for unwrapping containers for serialized ASTs (precompile...
Information about a module that has been loaded by the ASTReader.
The JSON file list parser is used to communicate input to InstallAPI.
Diagnostic wrappers for TextAPI types for error reporting.