This is an archive of the discontinued LLVM Phabricator instance.

[clang][modules][deps] Serialize inputs into PCMs using the "as requested" name
ClosedPublic

Authored by jansvoboda11 on Oct 10 2022, 6:42 PM.

Details

Summary

This patch changes the PCM serialization logic to refer to input files by their "requested" name. This fixes a bug where the dependency scanner reports the "final" file paths, which can result in failed explicit compiles due to the module.modulemap file not being surrounded by the expected framework directory structure.

Depends on D135634.

Diff Detail

Event Timeline

jansvoboda11 created this revision.Oct 10 2022, 6:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 10 2022, 6:42 PM
Herald added a subscriber: ributzka. · View Herald Transcript
jansvoboda11 requested review of this revision.Oct 10 2022, 6:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 10 2022, 6:42 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
This revision is now accepted and ready to land.Oct 11 2022, 1:58 PM

Rebase, update test description

benlangmuir added inline comments.Nov 11 2022, 9:22 AM
clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
457

Was this canonicalization necessary? If this is needed can we do it in the implicit module build so that it is serialized with the correct path? That seems better for both stability of the implicit module build and avoids re-canonicalizing the path every time it is scanned.

Rebase, remove unnecessary canonicalization

jansvoboda11 added inline comments.Dec 2 2022, 1:04 PM
clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
457

Good question. Canonicalization is not necessary for the test to pass, so I removed it. We can do it during serialization if we discover it's necessary.

benlangmuir accepted this revision.Dec 2 2022, 2:34 PM