[all-commits] [llvm/llvm-project] 6504d8: [clang][modules] Deserialize included files lazily

Jan Svoboda via All-commits all-commits at lists.llvm.org
Thu Jul 13 15:00:26 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6504d87fc0c89fc584c2128355a14a07ed385c5b
      https://github.com/llvm/llvm-project/commit/6504d87fc0c89fc584c2128355a14a07ed385c5b
  Author: Jan Svoboda <jan_svoboda at apple.com>
  Date:   2023-07-13 (Thu, 13 Jul 2023)

  Changed paths:
    M clang/include/clang/Lex/Preprocessor.h
    M clang/include/clang/Serialization/ASTBitCodes.h
    M clang/include/clang/Serialization/ASTReader.h
    M clang/include/clang/Serialization/ASTWriter.h
    M clang/lib/Serialization/ASTReader.cpp
    M clang/lib/Serialization/ASTReaderInternals.h
    M clang/lib/Serialization/ASTWriter.cpp

  Log Message:
  -----------
  [clang][modules] Deserialize included files lazily

In D114095, `HeaderFileInfo::NumIncludes` was moved into `Preprocessor`. This still makes sense, because we want to track this on the granularity of submodules (D112915, 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.

Reviewed By: benlangmuir

Differential Revision: https://reviews.llvm.org/D155131




More information about the All-commits mailing list