|
clang 24.0.0git
|
The module cache used for compiling modules implicitly. More...
#include "clang/Serialization/ModuleCache.h"
Public Member Functions | |
| ModuleCache (AtomicLineLogger &Logger) | |
| virtual const ModuleCacheDirectory * | getDirectoryPtr (StringRef Path) |
| Returns an opaque pointer representing the module cache directory. | |
| virtual std::unique_ptr< llvm::AdvisoryLock > | getLock (StringRef ModuleFilename)=0 |
| Returns lock for the given module file. The lock is initially unlocked. | |
| virtual std::time_t | getModuleTimestamp (StringRef ModuleFilename)=0 |
| Returns the timestamp denoting the last time inputs of the module file were validated. | |
| virtual void | updateModuleTimestamp (StringRef ModuleFilename)=0 |
| Updates the timestamp denoting the last time inputs of the module file were validated. | |
| virtual std::optional< bool > | isDirectoryInvalidated (StringRef Directory) |
Whether the build system reported that Directory changed before the build session started, or std::nullopt if this cache can't tell and the file system has to be checked instead. | |
| virtual void | maybePrune (StringRef Path, time_t PruneInterval, time_t PruneAfter)=0 |
| Prune module files that haven't been accessed in a long time. | |
| virtual InMemoryModuleCache & | getInMemoryModuleCache ()=0 |
| Returns this process's view of the module cache. | |
| virtual const InMemoryModuleCache & | getInMemoryModuleCache () const =0 |
| virtual llvm::ErrorOr< std::unique_ptr< llvm::MemoryBuffer > > | write (StringRef Path, std::unique_ptr< llvm::MemoryBuffer > Buffer, off_t &Size, time_t &ModTime)=0 |
| Write the PCM contents to the given path in the module cache. | |
| virtual Expected< std::unique_ptr< llvm::MemoryBuffer > > | read (StringRef FileName, off_t &Size, time_t &ModTime)=0 |
| virtual | ~ModuleCache ()=default |
| AtomicLineLogger & | getLogger () |
Protected Attributes | |
| AtomicLineLogger & | Logger |
| A logger to record timestamp read/write and file read/write. | |
The module cache used for compiling modules implicitly.
This centralizes the operations the compiler might want to perform on the cache.
Definition at line 41 of file ModuleCache.h.
|
inlineexplicit |
Definition at line 54 of file ModuleCache.h.
References Logger.
|
virtualdefault |
|
virtual |
Returns an opaque pointer representing the module cache directory.
This returns the same pointer regardless of the path spelling, as long as it resolves to the same file system entity. This also resolves links in the path. This may return nullptr if the module cache does not exist.
Definition at line 26 of file ModuleCache.cpp.
|
pure virtual |
|
pure virtual |
Returns this process's view of the module cache.
Referenced by clang::serialization::ModuleManager::addModule(), compileModuleImpl(), createASTReader(), and clang::ASTReader::readASTFileControlBlock().
|
pure virtual |
Returns lock for the given module file. The lock is initially unlocked.
Referenced by compileModuleBehindLockOrRead().
|
inline |
Definition at line 107 of file ModuleCache.h.
References Logger.
Referenced by clang::CompilerInstance::compileModule().
|
pure virtual |
Returns the timestamp denoting the last time inputs of the module file were validated.
|
inlinevirtual |
Whether the build system reported that Directory changed before the build session started, or std::nullopt if this cache can't tell and the file system has to be checked instead.
Definition at line 81 of file ModuleCache.h.
|
pure virtual |
Prune module files that haven't been accessed in a long time.
|
pure virtual |
References clang::FileName.
|
pure virtual |
Updates the timestamp denoting the last time inputs of the module file were validated.
Referenced by compileModuleImpl().
|
pure virtual |
Write the PCM contents to the given path in the module cache.
Takes ownership of Buffer, so that it can be freed as soon as possible.
Returns a buffer with the written contents, which readers in this process should use instead of their own copy.
Referenced by compileModuleImpl().
|
protected |
A logger to record timestamp read/write and file read/write.
Definition at line 51 of file ModuleCache.h.
Referenced by getLogger(), and ModuleCache().