[PATCH] D155131: [clang][modules] Deserialize included files lazily

Jan Svoboda via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 12 15:33:08 PDT 2023


jansvoboda11 created this revision.
jansvoboda11 added reviewers: benlangmuir, vsapsai, Bigcheese.
Herald added a subscriber: ributzka.
Herald added a project: All.
jansvoboda11 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

In D114095 <https://reviews.llvm.org/D114095>, `HeaderFileInfo::NumIncludes` was moved into `Preprocessor`. This still makes sense, because we want to track this on the granularity of submodules (D112915 <https://reviews.llvm.org/D112915>, D114173 <https://reviews.llvm.org/D114173>), but the way this information is serialized is not ideal. In `ASTWriter`, the set of included files gets deserialized eagerly, issuing lots of calls to `FileManager::getFile()` for input files the PCM consumer might not be interested in.

This patch makes the information part of the header file info table, taking advantage of its lazy deserialization which typically happens when a file is about to be included.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D155131

Files:
  clang/include/clang/Serialization/ASTBitCodes.h
  clang/include/clang/Serialization/ASTReader.h
  clang/lib/Serialization/ASTReader.cpp
  clang/lib/Serialization/ASTReaderInternals.h
  clang/lib/Serialization/ASTWriter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155131.539772.patch
Type: text/x-patch
Size: 8193 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230712/c6400d41/attachment-0001.bin>


More information about the cfe-commits mailing list