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

Ben Langmuir via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 12 15:52:44 PDT 2023


benlangmuir added a comment.

Now that it's not eagerly deserialized, should `Preprocessor::alreadyIncluded` call `HeaderInfo.getFileInfo(File)` to ensure the information is up to date?  Similarly, we expose the list of files in `Preprocessor::getIncludedFiles` -- is it okay if this list is incomplete?



================
Comment at: clang/lib/Serialization/ASTReader.cpp:1947
+    if (const FileEntry *FE = getFile(key))
+      Reader.getPreprocessor().getIncludedFiles().insert(FE);
+
----------------
`Reader.getPreprocessor().markIncluded`?


================
Comment at: clang/lib/Serialization/ASTWriter.cpp:2545
-    raw_svector_ostream Out(Buffer);
-    writeIncludedFiles(Out, PP);
-    RecordData::value_type Record[] = {PP_INCLUDED_FILES};
----------------
Can we remove `ASTWriter::writeIncludedFiles` now?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155131/new/

https://reviews.llvm.org/D155131



More information about the cfe-commits mailing list