chigraph  master
Systems programming language written for beginners in LLVM
DefaultModuleCache.hpp
1 
3 #ifndef CHI_DEFAULT_MODULE_CACHE_HPP
4 #define CHI_DEFAULT_MODULE_CACHE_HPP
5 
6 #include "chi/ModuleCache.hpp"
7 
8 namespace chi {
9 
14 
18  boost::filesystem::path cachePathForModule(const boost::filesystem::path& moduleName) const;
19 
21  Result cacheModule(const boost::filesystem::path& moduleName, llvm::Module& compiledModule,
22  std::time_t timeAtFileRead) override;
23 
25  void invalidateCache(const boost::filesystem::path& moduleName) override;
26 
28  std::time_t cacheUpdateTime(const boost::filesystem::path& moduleName) const override;
29 
31  std::unique_ptr<llvm::Module> retrieveFromCache(const boost::filesystem::path& moduleName,
32  std::time_t atLeastThisNew) override;
33 };
34 }
35 
36 #endif // CHI_DEFAULT_MODULE_CACHE_HPP
void invalidateCache(const boost::filesystem::path &moduleName) override
std::unique_ptr< llvm::Module > retrieveFromCache(const boost::filesystem::path &moduleName, std::time_t atLeastThisNew) override
Retrieve a module from the cache.
The class that handles the loading, creation, storing, and compilation of modules It also stores a LL...
Definition: Context.hpp:55
boost::filesystem::path cachePathForModule(const boost::filesystem::path &moduleName) const
Get the cache name for a module.
std::time_t cacheUpdateTime(const boost::filesystem::path &moduleName) const override
Get the time that a cache was updated.
This class provides an interface for creating module caches.
Definition: ModuleCache.hpp:16
Result cacheModule(const boost::filesystem::path &moduleName, llvm::Module &compiledModule, std::time_t timeAtFileRead) override
Cache a module.
The namespace where chigraph lives.
The result object, used for identifiying errors with good diagnostics.
Definition: Result.hpp:72
DefaultModuleCache(Context &ctx)
Default constrcutor.