Page MenuHomePhabricator

[clang][deps] Ensure deterministic order of TU '-fmodule-file=' arguments
Needs ReviewPublic

Authored by jansvoboda11 on Jun 7 2021, 6:09 AM.

Details

Summary

Translation units with multiple direct modular dependencies trigger a non-deterministic ordering in clang-scan-deps. This boils down to usage of std::unordered_map, which gets replaced by std::map in this patch.

Depends on D103526.

Diff Detail

Event Timeline

jansvoboda11 created this revision.Jun 7 2021, 6:09 AM
jansvoboda11 requested review of this revision.Jun 7 2021, 6:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 7 2021, 6:09 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

I'm not sure the performance problems with std::map will matter in practice here, but have you considered sorting before emission rather than relying on the data structure's iteration order? (It'd make it easy to switch to StringMap in the future.)