16 #ifndef LLVM_CLANG_SERIALIZATION_GLOBALMODULEINDEX_H
17 #define LLVM_CLANG_SERIALIZATION_GLOBALMODULEINDEX_H
19 #include "llvm/ADT/DenseMap.h"
20 #include "llvm/ADT/SmallPtrSet.h"
21 #include "llvm/ADT/SmallVector.h"
22 #include "llvm/ADT/StringMap.h"
23 #include "llvm/ADT/StringRef.h"
28 class BitstreamCursor;
37 class IdentifierIterator;
38 class PCHContainerOperations;
40 namespace serialization {
46 using llvm::StringRef;
47 using serialization::ModuleFile;
63 std::unique_ptr<llvm::MemoryBuffer> Buffer;
70 void *IdentifierIndex;
74 ModuleInfo() : File(), Size(), ModTime() { }
103 llvm::DenseMap<ModuleFile *, unsigned> ModulesByFile;
109 llvm::StringMap<unsigned> UnresolvedModules;
112 unsigned NumIdentifierLookups;
116 unsigned NumIdentifierLookupHits;
120 llvm::BitstreamCursor
Cursor);
148 static std::pair<GlobalModuleIndex *, ErrorCode>
168 typedef llvm::SmallPtrSet<ModuleFile *, 4>
HitSet;
void getKnownModules(SmallVectorImpl< ModuleFile * > &ModuleFiles)
Retrieve the set of modules that have up-to-date indexes.
Implements support for file system lookup, file system caching, and directory search management...
void getModuleDependencies(ModuleFile *File, SmallVectorImpl< ModuleFile * > &Dependencies)
Retrieve the set of module files on which the given module file directly depends. ...
void printStats()
Print statistics to standard error.
llvm::SmallPtrSet< ModuleFile *, 4 > HitSet
A set of module files in which we found a result.
IdentifierIterator * createIdentifierIterator() const
Returns an iterator for identifiers stored in the index table.
ErrorCode
An error code returned when trying to read an index.
static ErrorCode writeIndex(FileManager &FileMgr, const PCHContainerReader &PCHContainerRdr, StringRef Path)
Write a global index into the given.
An iterator that walks over all of the known identifiers in the lookup table.
A global index for a set of module files, providing information about the identifiers within those mo...
There was an unspecified I/O error reading or writing the index.
static std::pair< GlobalModuleIndex *, ErrorCode > readIndex(StringRef Path)
Read a global index file for the given directory.
Some other process is currently building the index; it is not available yet.
void dump()
Print debugging view to standard error.
bool lookupIdentifier(StringRef Name, HitSet &Hits)
Look for all of the module files with information about the given identifier, e.g., a global function, variable, or type with that name.
bool loadedModuleFile(ModuleFile *File)
Note that the given module file has been loaded.