[clang][deps] Add module files for input dependencies earlier
authorBen Langmuir <blangmuir@apple.com>
Thu, 19 Jan 2023 17:31:31 +0000 (09:31 -0800)
committerBen Langmuir <blangmuir@apple.com>
Tue, 24 Jan 2023 16:45:20 +0000 (08:45 -0800)
commit43854fa263d2c96aa9e6c2bc5eafd66ac9727641
tree6ecee0586ac5f54945e6fe43048f1d182d23ea91
parent2b807336ad385e64a7d182d5fb67bdfe449707a3
[clang][deps] Add module files for input dependencies earlier

I originally thought we needed to add module file inputs for modular
deps at the same time as outputs because they depend on the
lookupModuleOutput callback, but this is not the case: they only depend
on the callback results for other modules, which have already been
computed by this point. So move them earlier so that they're set in the
CompilerInvocation at the same time as other inputs. This makes the
code easier to understand.

This change is effectively NFC, though it technically changes the module
exact value of the context hash.

Differential Revision: https://reviews.llvm.org/D142392
clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp