void ModuleDepCollector::addOutputPaths(CompilerInvocation &CI,
ModuleDeps &Deps) {
- // These are technically *inputs* to the compilation, but we populate them
- // here in order to make \c getModuleContextHash() independent of
- // \c lookupModuleOutput().
- addModuleFiles(CI, Deps.ClangModuleDeps);
-
CI.getFrontendOpts().OutputFile =
Consumer.lookupModuleOutput(Deps.ID, ModuleOutputKind::ModuleFile);
if (!CI.getDiagnosticOpts().DiagnosticSerializationFile.empty())
for (const auto &PrebuiltModule : Deps.PrebuiltModuleDeps)
CI.getFrontendOpts().ModuleFiles.push_back(PrebuiltModule.PCMFile);
+ // Add module file inputs from dependencies.
+ addModuleFiles(CI, Deps.ClangModuleDeps);
+
// Remove any macro definitions that are explicitly ignored.
if (!CI.getHeaderSearchOpts().ModulesIgnoreMacros.empty()) {
llvm::erase_if(