This is an archive of the discontinued LLVM Phabricator instance.

[clang][modules] Avoid storing command-line macro definitions into implicitly built PCM files
ClosedPublic

Authored by jansvoboda11 on Aug 16 2023, 5:37 PM.

Details

Summary

With implicit modules, it's impossible to load a PCM file that was built using different command-line macro definitions. This is guaranteed by the fact that they contribute to the context hash. This means that we don't need to store those macros into PCM files for validation purposes. This patch avoids serializing them in those circumstances, since there's no other use for command-line macro definitions (besides "-module-file-info").

For a typical Apple project, this speeds up the dependency scan by 5.6% and shrinks the cache with scanning PCMs by 26%.

Diff Detail

Event Timeline

jansvoboda11 created this revision.Aug 16 2023, 5:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 16 2023, 5:37 PM
Herald added a subscriber: ributzka. · View Herald Transcript
jansvoboda11 requested review of this revision.Aug 16 2023, 5:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 16 2023, 5:37 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
benlangmuir accepted this revision.Aug 17 2023, 9:19 AM
benlangmuir added inline comments.
clang/test/Modules/module_file_info.m
45–49

CHECK-NOT: Predefined macros ?

This revision is now accepted and ready to land.Aug 17 2023, 9:19 AM