| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // Copyright (c) 2021-2025 ChilliBits. All rights reserved. | ||
| 2 | |||
| 3 | #include "CacheManager.h" | ||
| 4 | |||
| 5 | #include <SourceFile.h> | ||
| 6 | #include <util/FileUtil.h> | ||
| 7 | |||
| 8 | namespace spice::compiler { | ||
| 9 | |||
| 10 | ✗ | bool CacheManager::lookupSourceFile(const SourceFile *sourceFile) const { | |
| 11 | ✗ | const std::filesystem::path symbolTableFilePath = cacheDir / (sourceFile->cacheKey + ".bson"); | |
| 12 | ✗ | const std::filesystem::path objectFilePath = cacheDir / (sourceFile->cacheKey + ".o"); | |
| 13 | |||
| 14 | // Check if cache entry is available | ||
| 15 | ✗ | if (!exists(symbolTableFilePath) || !exists(objectFilePath)) | |
| 16 | ✗ | return false; | |
| 17 | |||
| 18 | // Load symbol table | ||
| 19 | |||
| 20 | // Set object file path | ||
| 21 | |||
| 22 | ✗ | return true; | |
| 23 | ✗ | } | |
| 24 | |||
| 25 | ✗ | void CacheManager::cacheSourceFile(const SourceFile * /*sourceFile*/) { | |
| 26 | // Cache symbol table | ||
| 27 | |||
| 28 | // Cache object file | ||
| 29 | ✗ | } | |
| 30 | |||
| 31 | } // namespace spice::compiler | ||
| 32 |