| 390 | } |
| 391 | |
| 392 | void 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 | |
| 419 | void PPCache::cacheIncludeFileInfos(::PPCache::Builder builder, |
| 420 | SymbolTable& targetSymbols, |