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

Method cacheLineTranslationInfos

src/Cache/PPCache.cpp:392–417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390}
391
392void PPCache::cacheLineTranslationInfos(::PPCache::Builder builder,
393 SymbolTable& targetSymbols,
394 const SymbolTable& sourceSymbols) {
395 FileSystem* const fileSystem = FileSystem::getInstance();
396
397 const std::vector<PreprocessFile::LineTranslationInfo>&
398 sourceLineTranslationInfos = m_pp->getLineTranslationInfo();
399 ::capnp::List<::LineTranslationInfo, ::capnp::Kind::STRUCT>::Builder
400 targetLineTranslationInfos =
401 builder.initLineTranslations(sourceLineTranslationInfos.size());
402
403 for (size_t i = 0, ni = sourceLineTranslationInfos.size(); i < ni; ++i) {
404 const PreprocessFile::LineTranslationInfo& sourceLineTranslationInfo =
405 sourceLineTranslationInfos[i];
406 ::LineTranslationInfo::Builder targetLineTranslationInfo =
407 targetLineTranslationInfos[i];
408 PathId pretendFileId = fileSystem->copy(
409 sourceLineTranslationInfo.m_pretendFileId, &targetSymbols);
410
411 targetLineTranslationInfo.setPretendFileId((RawPathId)pretendFileId);
412 targetLineTranslationInfo.setOriginalLine(
413 sourceLineTranslationInfo.m_originalLine);
414 targetLineTranslationInfo.setPretendLine(
415 sourceLineTranslationInfo.m_pretendLine);
416 }
417}
418
419void PPCache::cacheIncludeFileInfos(::PPCache::Builder builder,
420 SymbolTable& targetSymbols,

Callers

nothing calls this directly

Calls 1

copyMethod · 0.80

Tested by

no test coverage detected