This is an archive of the discontinued LLVM Phabricator instance.

[clang][deps] Use top-level modules as precompiled dependencies
ClosedPublic

Authored by jansvoboda11 on Aug 24 2021, 10:39 AM.

Details

Summary

The ASTReader populates Module::PresumedModuleMapFile only for top-level modules, not submodules. To avoid generating empty -fmodule-map-file= arguments, make discovered modules depend on top-level precompiled modules. The granularity of submodules is not important here.

The documentation of Module::PresumedModuleMapFile says this field is non-empty only when building from preprocessed source. This means there can still be cases where the dependency scanner generates empty -fmodule-map-file= arguments. That's being addressed in separate patch: D108544.

Diff Detail

Event Timeline

jansvoboda11 requested review of this revision.Aug 24 2021, 10:39 AM
jansvoboda11 created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptAug 24 2021, 10:39 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
dexonsmith accepted this revision.Aug 24 2021, 3:44 PM

This LGTM.

The documentation of Module::PresumedModuleMapFile says this field is non-empty only when building from preprocessed source. This means there can still be cases where the dependency scanner generates empty -fmodule-map-file= arguments. That's being addressed in separate patch: D108544.

I think the documentation might be out of date since ab75597ddac52f24e9cbd794cded195262ef670e. I made a comment in D108544.

This revision is now accepted and ready to land.Aug 24 2021, 3:44 PM