Skip to content

[clang][modules] Only compute affecting module maps with implicit search #8560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

jansvoboda11
Copy link

@jansvoboda11 jansvoboda11 commented Apr 10, 2024

Cherry-pick of llvm#87849

Explanation:

When writing out a PCM, we compute the set of module maps that did affect the compilation and we strip the rest to make the output independent of them. The most common way to read a module map that is not affecting is with implicit module map search. The other option is to pass a bunch of unnecessary -fmodule-map-file=<path> arguments on the command-line, in which case the client should probably not give those to Clang anyway.

This makes serialization of explicit modules faster, mostly due to reduced file system traffic.

Risk: Low. This change only affects explicitly-built modules that have implicit module map search disabled and all known module map files are affecting anyway.

Testing: Existing test suite coverage exercises the relevant code-paths affected by this functional change.

Reviewed By: @benlangmuir @Bigcheese

…rch (llvm#87849)

When writing out a PCM, we compute the set of module maps that did
affect the compilation and we strip the rest to make the output
independent of them. The most common way to read a module map that is
not affecting is with implicit module map search. The other option is to
pass a bunch of unnecessary `-fmodule-map-file=<path>` arguments on the
command-line, in which case the client should probably not give those to
Clang anyway.

This makes serialization of explicit modules faster, mostly due to
reduced file system traffic.

(cherry picked from commit 51786eb)
@jansvoboda11
Copy link
Author

@swift-ci please test

@jansvoboda11 jansvoboda11 requested a review from artemcm April 10, 2024 16:51
@artemcm artemcm requested a review from nkcsgexi April 10, 2024 16:52
@artemcm
Copy link

artemcm commented Apr 10, 2024

This change LGTM, but for the 6.0 Swift release cherry-picks, could you please follow the PR description template as in e.g. swiftlang/swift#72933?

@jansvoboda11 jansvoboda11 changed the title [clang][modules] Only compute affecting module maps with implicit search (#87849) [clang][modules] Only compute affecting module maps with implicit search Apr 10, 2024
@nkcsgexi nkcsgexi merged commit 7496505 into swift/release/6.0 Apr 10, 2024
@jansvoboda11 jansvoboda11 deleted the jan_svoboda/affecting-mm-only-with-search branch April 10, 2024 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants