This is an archive of the discontinued LLVM Phabricator instance.

[clang][modules] Track included files per submodule
Needs ReviewPublic

Authored by jansvoboda11 on Jul 17 2023, 11:39 AM.

Details

Summary

When building a module consisting of submodules, the preprocessor maintains a global set of included headers. This information gets serialized into the PCM file (specifically into the HeaderFileInfo table). After loading such PCM file, this information is deserialized into the state of the importing preprocessor. This happens even if the headers were included by (sub)modules that are not visible. This can incorrectly prevent imports of textual headers in the importing instance (see attached tests).

This patch fixes this bug splitting the set of included files per submodule. This is an alternative to D112915 and D104344.

Diff Detail

Event Timeline

jansvoboda11 created this revision.Jul 17 2023, 11:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 17 2023, 11:39 AM
jansvoboda11 requested review of this revision.Jul 17 2023, 11:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 17 2023, 11:40 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Note to self: lost the change that bumps PCM format version during a rebase. Make sure to increment the major version before committing.