|
hoshi-lang dev
Yet another programming language
|
#include <codegenObjectCache.hpp>
Public Member Functions | |
| CodegenObjectCache & | setCompilerCtx (const std::shared_ptr< compilerContext > &compilerCtx) |
| set the build config | |
| void | purge_and_update (const yoi::vec< yoi::wstr > &source_files) |
| purge the cache, add the entries that previously not in the cache, remove the entries that are not in the source_files | |
| yoi::indexT | register_entry (const yoi::wstr &abs_path_on_disk) |
| register a new entry to the cache | |
| void | update_last_modification (const yoi::wstr &abs_path_on_disk, yoi::indexT last_modification) |
| update the last modification time of an entry | |
| yoi::indexT | get_entry_index (const yoi::wstr &abs_path_on_disk) |
| get the entry from the cache | |
| CodegenObjectCacheEntry | get_entry (const yoi::wstr &abs_path_on_disk) |
| get the entry from the cache | |
| void | remove_entry (const yoi::wstr &abs_path_on_disk) |
| remove the entry from the cache | |
Public Attributes | |
| std::shared_ptr< compilerContext > | compilerCtx |
| std::map< yoi::wstr, CodegenObjectCacheEntry > | cache |
| std::set< yoi::indexT > | free_list |
| yoi::indexT | next_hash = 0 |
| std::mutex | cacheMutex |
Private Member Functions | |
| yoi::indexT | register_entry_unlocked (const yoi::wstr &abs_path_on_disk) |
Definition at line 61 of file codegenObjectCache.hpp.
| CodegenObjectCacheEntry get_entry | ( | const yoi::wstr & | abs_path_on_disk | ) |
get the entry from the cache
| abs_path_on_disk | the absolute path of the source file on the disk |
Definition at line 187 of file codegenObjectCache.cpp.
References CodegenObjectCache::cache, CodegenObjectCache::cacheMutex, and CodegenObjectCache::register_entry_unlocked().
Referenced by LLVMCodegen::generate().


| yoi::indexT get_entry_index | ( | const yoi::wstr & | abs_path_on_disk | ) |
get the entry from the cache
| abs_path_on_disk | the absolute path of the source file on the disk |
Definition at line 179 of file codegenObjectCache.cpp.
References CodegenObjectCache::cache, and CodegenObjectCache::cacheMutex.
purge the cache, add the entries that previously not in the cache, remove the entries that are not in the source_files
| source_files | the source files to check |
Definition at line 124 of file codegenObjectCache.cpp.
References CodegenObjectCache::cache, CodegenObjectCache::cacheMutex, CodegenObjectCache::free_list, and CodegenObjectCache::register_entry_unlocked().
Referenced by LLVMCodegen::LLVMCodegen().


| yoi::indexT register_entry | ( | const yoi::wstr & | abs_path_on_disk | ) |
register a new entry to the cache
| abs_path_on_disk | the absolute path of the source file on the disk |
Definition at line 174 of file codegenObjectCache.cpp.
References CodegenObjectCache::cacheMutex, and CodegenObjectCache::register_entry_unlocked().

|
private |
Definition at line 150 of file codegenObjectCache.cpp.
References CodegenObjectCache::cache, CodegenObjectCache::compilerCtx, yoi::consoleMutex, CodegenObjectCache::free_list, CodegenObjectCache::next_hash, CodegenObjectCacheEntry::setAbsPathOnDisk(), CodegenObjectCacheEntry::setHash(), CodegenObjectCacheEntry::setLastModification(), CodegenObjectCacheEntry::setObjectFilename(), and yoi::wstring2string().
Referenced by CodegenObjectCache::get_entry(), CodegenObjectCache::purge_and_update(), and CodegenObjectCache::register_entry().


| void remove_entry | ( | const yoi::wstr & | abs_path_on_disk | ) |
remove the entry from the cache
| abs_path_on_disk | the absolute path of the source file on the disk |
Definition at line 195 of file codegenObjectCache.cpp.
References CodegenObjectCache::cache, CodegenObjectCache::cacheMutex, and CodegenObjectCache::free_list.
| CodegenObjectCache & setCompilerCtx | ( | const std::shared_ptr< compilerContext > & | compilerCtx | ) |
set the build config
| build_config | the build config |
Definition at line 217 of file codegenObjectCache.cpp.
References CodegenObjectCache::compilerCtx.
Referenced by LLVMCodegen::LLVMCodegen().

| void update_last_modification | ( | const yoi::wstr & | abs_path_on_disk, |
| yoi::indexT | last_modification | ||
| ) |
update the last modification time of an entry
| abs_path_on_disk | the absolute path of the source file on the disk |
| last_modification | the last modification time |
Definition at line 201 of file codegenObjectCache.cpp.
References CodegenObjectCache::cache, and CodegenObjectCache::cacheMutex.
Referenced by LLVMCodegen::generate().

| std::map<yoi::wstr, CodegenObjectCacheEntry> cache |
Definition at line 64 of file codegenObjectCache.hpp.
Referenced by CodegenObjectCache::get_entry(), CodegenObjectCache::get_entry_index(), CodegenObjectCache::purge_and_update(), CodegenObjectCache::register_entry_unlocked(), CodegenObjectCache::remove_entry(), and CodegenObjectCache::update_last_modification().
|
mutable |
Definition at line 67 of file codegenObjectCache.hpp.
Referenced by CodegenObjectCache::get_entry(), CodegenObjectCache::get_entry_index(), CodegenObjectCache::purge_and_update(), CodegenObjectCache::register_entry(), CodegenObjectCache::remove_entry(), and CodegenObjectCache::update_last_modification().
| std::shared_ptr<compilerContext> compilerCtx |
Definition at line 63 of file codegenObjectCache.hpp.
Referenced by CodegenObjectCache::register_entry_unlocked(), and CodegenObjectCache::setCompilerCtx().
| std::set<yoi::indexT> free_list |
Definition at line 65 of file codegenObjectCache.hpp.
Referenced by CodegenObjectCache::purge_and_update(), CodegenObjectCache::register_entry_unlocked(), and CodegenObjectCache::remove_entry().
| yoi::indexT next_hash = 0 |
Definition at line 66 of file codegenObjectCache.hpp.
Referenced by CodegenObjectCache::register_entry_unlocked().