@@ -401,7 +401,7 @@ SupplementaryOutputPathsComputer::computeOutputPathsForOneInput(
401401 ID emitModuleOption;
402402 std::string moduleExtension;
403403 std::string mainOutputIfUsableForModule;
404- deriveModulePathParameters (emitModuleOption, moduleExtension,
404+ deriveModulePathParameters (outputFile, emitModuleOption, moduleExtension,
405405 mainOutputIfUsableForModule);
406406
407407 auto moduleOutputPath = determineSupplementaryOutputFilename (
@@ -458,7 +458,7 @@ SupplementaryOutputPathsComputer::determineSupplementaryOutputFilename(
458458};
459459
460460void SupplementaryOutputPathsComputer::deriveModulePathParameters (
461- options::ID &emitOption, std::string &extension,
461+ StringRef mainOutputFile, options::ID &emitOption, std::string &extension,
462462 std::string &mainOutputIfUsable) const {
463463
464464 bool isSIB = RequestedAction == FrontendOptions::ActionType::EmitSIB ||
@@ -477,7 +477,7 @@ void SupplementaryOutputPathsComputer::deriveModulePathParameters(
477477 isSIB ? file_types::TY_SIB : file_types::TY_SwiftModuleFile);
478478
479479 mainOutputIfUsable =
480- canUseMainOutputForModule && !OutputFiles.empty () ? OutputFiles[ 0 ] : " " ;
480+ canUseMainOutputForModule && !OutputFiles.empty () ? mainOutputFile : " " ;
481481}
482482
483483static SupplementaryOutputPaths
0 commit comments