MCPcopy Create free account
hub / github.com/chipsalliance/Surelog / getCacheFileId

Method getCacheFileId

src/Cache/ParseCache.cpp:81–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79ParseCache::ParseCache(ParseFile* parser) : m_parse(parser) {}
80
81PathId ParseCache::getCacheFileId(PathId ppFileId) const {
82 if (!ppFileId) ppFileId = m_parse->getPpFileId();
83 if (!ppFileId) return BadPathId;
84
85 FileSystem* const fileSystem = FileSystem::getInstance();
86 CommandLineParser* clp =
87 m_parse->getCompileSourceFile()->getCommandLineParser();
88 SymbolTable* const symbolTable =
89 m_parse->getCompileSourceFile()->getSymbolTable();
90
91 const std::string_view libName = m_parse->getLibrary()->getName();
92
93 if (clp->parseOnly()) {
94 // If parseOnly flag is set, the Preprocessor doesn't actually generate
95 // an output file. Instead it uses the source itself i.e. from the original
96 // source location. Compute the "potential" Preprocessor output file so the
97 // cache file location would be correct.
98 ppFileId = fileSystem->getPpOutputFile(clp->fileunit(), ppFileId, libName,
99 symbolTable);
100 }
101
102 Precompiled* const prec = Precompiled::getSingleton();
103 const bool isPrecompiled = prec->isFilePrecompiled(ppFileId, symbolTable);
104
105 return fileSystem->getParseCacheFile(clp->fileunit(), ppFileId, libName,
106 isPrecompiled, symbolTable);
107}
108
109bool ParseCache::checkCacheIsValid(PathId cacheFileId,
110 const ::ParseCache::Reader& root) const {

Callers

nothing calls this directly

Calls 11

getPpFileIdMethod · 0.80
parseOnlyMethod · 0.80
fileunitMethod · 0.80
isFilePrecompiledMethod · 0.80
getCommandLineParserMethod · 0.45
getCompileSourceFileMethod · 0.45
getSymbolTableMethod · 0.45
getNameMethod · 0.45
getLibraryMethod · 0.45
getPpOutputFileMethod · 0.45
getParseCacheFileMethod · 0.45

Tested by

no test coverage detected