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"
35class IdentifierIterator;
36class PCHContainerOperations;
37class PCHContainerReader;
39namespace serialization {
59 std::unique_ptr<llvm::MemoryBuffer> Buffer;
66 void *IdentifierIndex;
70 ModuleInfo() :
File(), Size(), ModTime() { }
99 llvm::DenseMap<ModuleFile *, unsigned> ModulesByFile;
105 llvm::StringMap<unsigned> UnresolvedModules;
108 unsigned NumIdentifierLookups;
112 unsigned NumIdentifierLookupHits;
116 llvm::BitstreamCursor Cursor);
131 static std::pair<GlobalModuleIndex *, llvm::Error>
185 llvm::StringRef Path);
Implements support for file system lookup, file system caching, and directory search management.
A global index for a set of module files, providing information about the identifiers within those mo...
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 getKnownModules(llvm::SmallVectorImpl< ModuleFile * > &ModuleFiles)
Retrieve the set of modules that have up-to-date indexes.
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.
This abstract interface provides operations for unwrapping containers for serialized ASTs (precompile...
Information about a module that has been loaded by the ASTReader.
YAML serialization mapping.