@@ -401,7 +401,7 @@ SupplementaryOutputPathsComputer::computeOutputPathsForOneInput(
401
401
ID emitModuleOption;
402
402
std::string moduleExtension;
403
403
std::string mainOutputIfUsableForModule;
404
- deriveModulePathParameters (emitModuleOption, moduleExtension,
404
+ deriveModulePathParameters (outputFile, emitModuleOption, moduleExtension,
405
405
mainOutputIfUsableForModule);
406
406
407
407
auto moduleOutputPath = determineSupplementaryOutputFilename (
@@ -458,7 +458,7 @@ SupplementaryOutputPathsComputer::determineSupplementaryOutputFilename(
458
458
};
459
459
460
460
void SupplementaryOutputPathsComputer::deriveModulePathParameters (
461
- options::ID &emitOption, std::string &extension,
461
+ StringRef mainOutputFile, options::ID &emitOption, std::string &extension,
462
462
std::string &mainOutputIfUsable) const {
463
463
464
464
bool isSIB = RequestedAction == FrontendOptions::ActionType::EmitSIB ||
@@ -477,7 +477,7 @@ void SupplementaryOutputPathsComputer::deriveModulePathParameters(
477
477
isSIB ? file_types::TY_SIB : file_types::TY_SwiftModuleFile);
478
478
479
479
mainOutputIfUsable =
480
- canUseMainOutputForModule && !OutputFiles.empty () ? OutputFiles[ 0 ] : " " ;
480
+ canUseMainOutputForModule && !OutputFiles.empty () ? mainOutputFile : " " ;
481
481
}
482
482
483
483
static SupplementaryOutputPaths
0 commit comments