This is an archive of the discontinued LLVM Phabricator instance.

[clang][modules][deps] Preserve module map load order
ClosedPublic

Authored by jansvoboda11 on Sep 19 2022, 6:09 PM.

Details

Summary

In ASTWriter, input files are sorted based on whether they are system or user. The current implementation used single std::queue with push_back and push_front. This resulted in the user files being reversed.

This patch fixes that by keeping the system/user distinction, but otherwise serializing files in the order they were loaded by the SourceManager. This is then used in the dependency scanner to report module map dependencies in the correct order.

Depends on D134224.

Diff Detail

Event Timeline

jansvoboda11 created this revision.Sep 19 2022, 6:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 19 2022, 6:09 PM
jansvoboda11 requested review of this revision.Sep 19 2022, 6:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 19 2022, 6:09 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
Bigcheese accepted this revision.Sep 22 2022, 11:21 AM

lgtm

clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
129

This is loop invariant and can be pulled out.

This revision is now accepted and ready to land.Sep 22 2022, 11:21 AM