This is an archive of the discontinued LLVM Phabricator instance.

[clang] Unconditionally add autolink hints for frameworks.
ClosedPublic

Authored by ributzka on Mar 16 2023, 1:04 PM.

Details

Summary

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.

Diff Detail

Event Timeline

ributzka created this revision.Mar 16 2023, 1:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 16 2023, 1:04 PM
ributzka requested review of this revision.Mar 16 2023, 1:04 PM
ributzka changed the repository for this revision from rC Clang to rG LLVM Github Monorepo.
ributzka added a subscriber: cfe-commits.
Herald added a project: Restricted Project. · View Herald TranscriptMar 16 2023, 1:05 PM
pete accepted this revision.Mar 16 2023, 1:05 PM

LGTM

This revision is now accepted and ready to land.Mar 16 2023, 1:05 PM

Thanks for the prompt reviews