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;
39 class PCHContainerReader;
41 namespace serialization {
47 using llvm::StringRef;
48 using serialization::ModuleFile;
64 std::unique_ptr<llvm::MemoryBuffer> Buffer;
71 void *IdentifierIndex;
75 ModuleInfo() : File(), Size(), ModTime() { }
104 llvm::DenseMap<ModuleFile *, unsigned> ModulesByFile;
110 llvm::StringMap<unsigned> UnresolvedModules;
113 unsigned NumIdentifierLookups;
117 unsigned NumIdentifierLookupHits;
121 llvm::BitstreamCursor
Cursor);
149 static std::pair<GlobalModuleIndex *, ErrorCode>
169 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.
class LLVM_ALIGNAS(8) DependentTemplateSpecializationType const IdentifierInfo * Name
Represents a template specialization type whose template cannot be resolved, e.g. ...
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.
This abstract interface provides operations for unwrapping containers for serialized ASTs (precompile...
static ErrorCode writeIndex(FileManager &FileMgr, const PCHContainerReader &PCHContainerRdr, StringRef Path)
Write a global index into the given.
void dump()
Print debugging view to standard error.
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.
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.