![]() |
chigraph
master
Systems programming language written for beginners in LLVM
|
This class provides an interface for creating module caches. More...
#include <chi/ModuleCache.hpp>
Public Member Functions | |
ModuleCache (Context &ctx) | |
Create a module cache with a bound context. | |
ModuleCache (const ModuleCache &)=delete | |
ModuleCache (ModuleCache &&)=delete | |
virtual | ~ModuleCache ()=default |
Destructor. | |
virtual Result | cacheModule (const boost::filesystem::path &moduleName, llvm::Module &compiledModule, std::time_t timeAtFileRead)=0 |
Cache a module. More... | |
virtual std::time_t | cacheUpdateTime (const boost::filesystem::path &moduleName) const =0 |
Get the time that a cache was updated. More... | |
Context & | context () const |
Get the context this cache is bound to. More... | |
virtual void | invalidateCache (const boost::filesystem::path &moduleName)=0 |
Inavlidate the cache, ie. More... | |
ModuleCache & | operator= (const ModuleCache &)=delete |
ModuleCache & | operator= (ModuleCache &&)=delete |
virtual std::unique_ptr< llvm::Module > | retrieveFromCache (const boost::filesystem::path &moduleName, std::time_t atLeastThisNew)=0 |
Retrieve a module from the cache. More... | |
This class provides an interface for creating module caches.
Definition at line 16 of file ModuleCache.hpp.
|
pure virtual |
Cache a module.
moduleName | The name of the module to cache |
!moduleName.empty()
compiledModule | The IR that's been compiled from this module |
timeAtFileRead | The time to store as the cache time. Should be the time the module was read from disk |
Implemented in chi::DefaultModuleCache.
Referenced by chi::Context::compileModule(), and ModuleCache().
|
pure virtual |
Get the time that a cache was updated.
moduleName | The module to get the last update time for |
Implemented in chi::DefaultModuleCache.
Referenced by ModuleCache().
|
inline |
Get the context this cache is bound to.
Context
Definition at line 59 of file ModuleCache.hpp.
Referenced by chi::DefaultModuleCache::cachePathForModule(), and chi::DefaultModuleCache::retrieveFromCache().
|
pure virtual |
Inavlidate the cache, ie.
delete the cache file
moduleName | The name of the module to invalidate |
!moduleName.empty()
Implemented in chi::DefaultModuleCache.
Referenced by ModuleCache().
|
pure virtual |
Retrieve a module from the cache.
moduleName | The name of the module to retrieve |
!moduleName.empty()
atLeastThisNew | Make sure the cache is at least as new as this |
Implemented in chi::DefaultModuleCache.
Referenced by chi::Context::compileModule(), and ModuleCache().