GCC Code Coverage Report


Directory: ../
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 10.0% 1 / 0 / 10
Functions: 33.3% 1 / 0 / 3
Branches: 0.0% 0 / 0 / 22

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