9#ifndef LLVM_CLANG_SERIALIZATION_MODULECACHE_H
10#define LLVM_CLANG_SERIALIZATION_MODULECACHE_H
17#include <system_error>
33 virtual std::unique_ptr<llvm::AdvisoryLock>
49 virtual void maybePrune(StringRef Path, time_t PruneInterval,
50 time_t PruneAfter) = 0;
57 virtual std::error_code
write(StringRef Path,
58 llvm::MemoryBufferRef Buffer) = 0;
73void maybePruneImpl(StringRef Path, time_t PruneInterval, time_t PruneAfter);
76std::error_code
writeImpl(StringRef Path, llvm::MemoryBufferRef Buffer);
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
In-memory cache for modules.
The module cache used for compiling modules implicitly.
virtual std::error_code write(StringRef Path, llvm::MemoryBufferRef Buffer)=0
Write the PCM contents to the given path in the module cache.
virtual ~ModuleCache()=default
virtual const InMemoryModuleCache & getInMemoryModuleCache() const =0
virtual std::time_t getModuleTimestamp(StringRef ModuleFilename)=0
Returns the timestamp denoting the last time inputs of the module file were validated.
virtual InMemoryModuleCache & getInMemoryModuleCache()=0
Returns this process's view of the module cache.
virtual void updateModuleTimestamp(StringRef ModuleFilename)=0
Updates the timestamp denoting the last time inputs of the module file were validated.
virtual Expected< std::unique_ptr< llvm::MemoryBuffer > > read(StringRef FileName, off_t &Size, time_t &ModTime)=0
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 std::unique_ptr< llvm::AdvisoryLock > getLock(StringRef ModuleFilename)=0
Returns lock for the given module file. The lock is initially unlocked.
The JSON file list parser is used to communicate input to InstallAPI.
Expected< std::unique_ptr< llvm::MemoryBuffer > > readImpl(StringRef FileName, off_t &Size, time_t &ModTime)
Shared implementation of ModuleCache::read().
std::shared_ptr< ModuleCache > createCrossProcessModuleCache()
Creates new ModuleCache backed by a file system directory that may be operated on by multiple process...
void maybePruneImpl(StringRef Path, time_t PruneInterval, time_t PruneAfter)
Shared implementation of ModuleCache::maybePrune().
std::error_code writeImpl(StringRef Path, llvm::MemoryBufferRef Buffer)
Shared implementation of ModuleCache::write().
Diagnostic wrappers for TextAPI types for error reporting.