@@ -341,11 +341,14 @@ SupplementaryOutputPathsComputer::getSupplementaryOutputPathsFromArguments()
341341 options::OPT_emit_module_summary_path);
342342 auto abiDescriptorOutput = getSupplementaryFilenamesFromArguments (
343343 options::OPT_emit_abi_descriptor_path);
344+ auto optRecordOutput = getSupplementaryFilenamesFromArguments (
345+ options::OPT_save_optimization_record_path);
344346 if (!objCHeaderOutput || !moduleOutput || !moduleDocOutput ||
345347 !dependenciesFile || !referenceDependenciesFile ||
346348 !serializedDiagnostics || !fixItsOutput || !loadedModuleTrace || !TBD ||
347349 !moduleInterfaceOutput || !privateModuleInterfaceOutput ||
348- !moduleSourceInfoOutput || !moduleSummaryOutput || !abiDescriptorOutput) {
350+ !moduleSourceInfoOutput || !moduleSummaryOutput || !abiDescriptorOutput ||
351+ !optRecordOutput) {
349352 return None;
350353 }
351354 std::vector<SupplementaryOutputPaths> result;
@@ -368,6 +371,8 @@ SupplementaryOutputPathsComputer::getSupplementaryOutputPathsFromArguments()
368371 sop.ModuleSourceInfoOutputPath = (*moduleSourceInfoOutput)[i];
369372 sop.ModuleSummaryOutputPath = (*moduleSummaryOutput)[i];
370373 sop.ABIDescriptorOutputPath = (*abiDescriptorOutput)[i];
374+ sop.YAMLOptRecordPath = (*optRecordOutput)[i];
375+ sop.BitstreamOptRecordPath = (*optRecordOutput)[i];
371376 result.push_back (sop);
372377 }
373378 return result;
@@ -479,6 +484,15 @@ SupplementaryOutputPathsComputer::computeOutputPathsForOneInput(
479484 file_types::TY_SwiftModuleFile, mainOutputIfUsableForModule,
480485 defaultSupplementaryOutputPathExcludingExtension);
481486
487+ auto YAMLOptRecordPath = determineSupplementaryOutputFilename (
488+ OPT_save_optimization_record_path, pathsFromArguments.YAMLOptRecordPath ,
489+ file_types::TY_YAMLOptRecord, " " ,
490+ defaultSupplementaryOutputPathExcludingExtension);
491+ auto bitstreamOptRecordPath = determineSupplementaryOutputFilename (
492+ OPT_save_optimization_record_path, pathsFromArguments.BitstreamOptRecordPath ,
493+ file_types::TY_BitstreamOptRecord, " " ,
494+ defaultSupplementaryOutputPathExcludingExtension);
495+
482496 SupplementaryOutputPaths sop;
483497 sop.ObjCHeaderOutputPath = objcHeaderOutputPath;
484498 sop.ModuleOutputPath = moduleOutputPath;
@@ -494,6 +508,8 @@ SupplementaryOutputPathsComputer::computeOutputPathsForOneInput(
494508 sop.ModuleSourceInfoOutputPath = moduleSourceInfoOutputPath;
495509 sop.ModuleSummaryOutputPath = moduleSummaryOutputPath;
496510 sop.ABIDescriptorOutputPath = ABIDescriptorOutputPath;
511+ sop.YAMLOptRecordPath = YAMLOptRecordPath;
512+ sop.BitstreamOptRecordPath = bitstreamOptRecordPath;
497513 return sop;
498514}
499515
@@ -576,6 +592,8 @@ createFromTypeToPathMap(const TypeToPathMap *map) {
576592 {file_types::TY_SwiftModuleSummaryFile, paths.ModuleSummaryOutputPath },
577593 {file_types::TY_PrivateSwiftModuleInterfaceFile,
578594 paths.PrivateModuleInterfaceOutputPath },
595+ {file_types::TY_YAMLOptRecord, paths.YAMLOptRecordPath },
596+ {file_types::TY_BitstreamOptRecord, paths.BitstreamOptRecordPath },
579597 };
580598 for (const std::pair<file_types::ID, std::string &> &typeAndString :
581599 typesAndStrings) {
0 commit comments