[clang][modules] Only compute affecting module maps with implicit search #8560
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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