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

Method restoreIncludeFileInfos

src/Cache/PPCache.cpp:542–572  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

540}
541
542void PPCache::restoreIncludeFileInfos(
543 SymbolTable& targetSymbols,
544 const ::capnp::List<::IncludeFileInfo>::Reader& sourceIncludeFileInfos,
545 const SymbolTable& sourceSymbols) {
546 FileSystem* const fileSystem = FileSystem::getInstance();
547
548 for (const ::IncludeFileInfo::Reader& sourceIncludeFileInfo :
549 sourceIncludeFileInfos) {
550 SymbolId sectionSymbolId = targetSymbols.copyFrom(
551 SymbolId(sourceIncludeFileInfo.getSectionSymbolId(), "<unknown"),
552 &sourceSymbols);
553 PathId sectionFileId = fileSystem->toPathId(
554 fileSystem->remap(sourceSymbols.getSymbol(SymbolId(
555 sourceIncludeFileInfo.getSectionFileId(), UnknownRawPath))),
556 &targetSymbols);
557 // std::cout << "read sectionFile: " << sectionFileName << " s:" <<
558 // incinfo->m_sectionStartLine() << " o:" << incinfo->m_originalLine() <<
559 // " t:" << incinfo->m_type() << "\n";
560 m_pp->addIncludeFileInfo(
561 static_cast<IncludeFileInfo::Context>(
562 sourceIncludeFileInfo.getContext()),
563 sourceIncludeFileInfo.getSectionStartLine(), sectionSymbolId,
564 sectionFileId, sourceIncludeFileInfo.getOriginalStartLine(),
565 sourceIncludeFileInfo.getOriginalStartColumn(),
566 sourceIncludeFileInfo.getOriginalEndLine(),
567 sourceIncludeFileInfo.getOriginalEndColumn(),
568 static_cast<IncludeFileInfo::Action>(sourceIncludeFileInfo.getAction()),
569 sourceIncludeFileInfo.getIndexClosing(),
570 sourceIncludeFileInfo.getIndexClosing());
571 }
572}
573
574bool PPCache::restore(PathId cacheFileId, bool errorsOnly,
575 int32_t recursionDepth) {

Callers

nothing calls this directly

Calls 4

toPathIdMethod · 0.80
remapMethod · 0.80
addIncludeFileInfoMethod · 0.80
getSymbolMethod · 0.45

Tested by

no test coverage detected