[all-commits] [llvm/llvm-project] 29e2a4: [clang] Unconditionally add autolink hints for fra...

Juergen Ributzka via All-commits all-commits at lists.llvm.org
Thu Mar 16 15:31:46 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 29e2a4eff8f62d12754f31f90d70e9a346bc2075
      https://github.com/llvm/llvm-project/commit/29e2a4eff8f62d12754f31f90d70e9a346bc2075
  Author: Juergen Ributzka <juergen at ributzka.de>
  Date:   2023-03-16 (Thu, 16 Mar 2023)

  Changed paths:
    M clang/lib/Lex/ModuleMap.cpp
    M clang/test/Modules/use-exportas-for-link.m

  Log Message:
  -----------
  [clang] Unconditionally add autolink hints for frameworks.

Clang infers framework autolink hints when parsing a modulemap. In order to do
so, it checks if the module is a framework and if there is a framework binary
or TBD file in the SDK. Only when Clang finds the filei, then the autolink hint
is added to the module metadata.

During a project build many clang processes perform this check, which causes
many stat calls - even for modules/frameworks that are not even used.

The linker is already resilient to non-existing framework links that come from
the autolink metadata, so there is no need for Clang to do this check.

Instead the autolink hints are now added unconditionally and the linker only
needs to do the check once. This reduces the overall number of stat calls.

This fixes rdar://106578342.

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




More information about the All-commits mailing list