[all-commits] [llvm/llvm-project] 8f4ea3: [clang] Improve laziness of resolving module map h...

Adam Czachorowski via All-commits all-commits at lists.llvm.org
Tue Mar 1 07:02:45 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8f4ea36bfe4caf7d08f9778ee2a347b78f02bc0f
      https://github.com/llvm/llvm-project/commit/8f4ea36bfe4caf7d08f9778ee2a347b78f02bc0f
  Author: Adam Czachorowski <adamcz at google.com>
  Date:   2022-03-01 (Tue, 01 Mar 2022)

  Changed paths:
    M clang/include/clang/Lex/ModuleMap.h
    M clang/lib/Frontend/FrontendAction.cpp
    M clang/lib/Lex/ModuleMap.cpp
    M clang/lib/Serialization/ASTWriter.cpp

  Log Message:
  -----------
  [clang] Improve laziness of resolving module map headers.

clang has support for lazy headers in module maps - if size and/or
modtime and provided in the cppmap file, headers are only resolved when
an include directive for a file with that size/modtime is encoutered.

Before this change, the lazy resolution was all-or-nothing per module.
That means as soon as even one file in that module potentially matched
an include, all lazy files in that module were resolved. With this
change, only files with matching size/modtime will be resolved.

The goal is to avoid unnecessary stat() calls on non-included files,
which is especially valuable on networked file systems, with higher
latency.

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




More information about the All-commits mailing list