@@ -310,6 +310,8 @@ SupplementaryOutputPathsComputer::getSupplementaryOutputPathsFromArguments()
310310
311311 auto objCHeaderOutput = getSupplementaryFilenamesFromArguments (
312312 options::OPT_emit_objc_header_path);
313+ auto cxxHeaderOutput =
314+ getSupplementaryFilenamesFromArguments (options::OPT_emit_cxx_header_path);
313315 auto moduleOutput =
314316 getSupplementaryFilenamesFromArguments (options::OPT_emit_module_path);
315317 auto moduleDocOutput =
@@ -339,8 +341,8 @@ SupplementaryOutputPathsComputer::getSupplementaryOutputPathsFromArguments()
339341 options::OPT_emit_module_semantic_info_path);
340342 auto optRecordOutput = getSupplementaryFilenamesFromArguments (
341343 options::OPT_save_optimization_record_path);
342- if (!objCHeaderOutput || !moduleOutput || !moduleDocOutput ||
343- !dependenciesFile || !referenceDependenciesFile ||
344+ if (!objCHeaderOutput || !cxxHeaderOutput || !moduleOutput ||
345+ !moduleDocOutput || ! dependenciesFile || !referenceDependenciesFile ||
344346 !serializedDiagnostics || !fixItsOutput || !loadedModuleTrace || !TBD ||
345347 !moduleInterfaceOutput || !privateModuleInterfaceOutput ||
346348 !moduleSourceInfoOutput || !moduleSummaryOutput || !abiDescriptorOutput ||
@@ -354,6 +356,7 @@ SupplementaryOutputPathsComputer::getSupplementaryOutputPathsFromArguments()
354356 for (unsigned i = 0 ; i < N; ++i) {
355357 SupplementaryOutputPaths sop;
356358 sop.ObjCHeaderOutputPath = (*objCHeaderOutput)[i];
359+ sop.CxxHeaderOutputPath = (*cxxHeaderOutput)[i];
357360 sop.ModuleOutputPath = (*moduleOutput)[i];
358361 sop.ModuleDocOutputPath = (*moduleDocOutput)[i];
359362 sop.DependenciesFilePath = (*dependenciesFile)[i];
@@ -439,6 +442,11 @@ SupplementaryOutputPathsComputer::computeOutputPathsForOneInput(
439442 file_types::TY_ObjCHeader, " " ,
440443 defaultSupplementaryOutputPathExcludingExtension);
441444
445+ auto cxxHeaderOutputPath = determineSupplementaryOutputFilename (
446+ OPT_emit_cxx_header, pathsFromArguments.CxxHeaderOutputPath ,
447+ file_types::TY_ObjCHeader, " " ,
448+ defaultSupplementaryOutputPathExcludingExtension);
449+
442450 auto loadedModuleTracePath = determineSupplementaryOutputFilename (
443451 OPT_emit_loaded_module_trace, pathsFromArguments.LoadedModuleTracePath ,
444452 file_types::TY_ModuleTrace, " " ,
@@ -493,6 +501,7 @@ SupplementaryOutputPathsComputer::computeOutputPathsForOneInput(
493501
494502 SupplementaryOutputPaths sop;
495503 sop.ObjCHeaderOutputPath = objcHeaderOutputPath;
504+ sop.CxxHeaderOutputPath = cxxHeaderOutputPath;
496505 sop.ModuleOutputPath = moduleOutputPath;
497506 sop.ModuleDocOutputPath = moduleDocOutputPath;
498507 sop.DependenciesFilePath = dependenciesFilePath;
@@ -578,6 +587,7 @@ createFromTypeToPathMap(const TypeToPathMap *map) {
578587 return paths;
579588 const std::pair<file_types::ID, std::string &> typesAndStrings[] = {
580589 {file_types::TY_ObjCHeader, paths.ObjCHeaderOutputPath },
590+ {file_types::TY_ObjCHeader, paths.CxxHeaderOutputPath },
581591 {file_types::TY_SwiftModuleFile, paths.ModuleOutputPath },
582592 {file_types::TY_SwiftModuleDocFile, paths.ModuleDocOutputPath },
583593 {file_types::TY_SwiftSourceInfoFile, paths.ModuleSourceInfoOutputPath },
@@ -606,17 +616,16 @@ createFromTypeToPathMap(const TypeToPathMap *map) {
606616Optional<std::vector<SupplementaryOutputPaths>>
607617SupplementaryOutputPathsComputer::readSupplementaryOutputFileMap () const {
608618 if (Arg *A = Args.getLastArg (
609- options::OPT_emit_objc_header_path,
610- options::OPT_emit_module_path,
611- options::OPT_emit_module_doc_path,
612- options::OPT_emit_dependencies_path,
613- options::OPT_emit_reference_dependencies_path,
614- options::OPT_serialize_diagnostics_path,
615- options::OPT_emit_loaded_module_trace_path,
616- options::OPT_emit_module_interface_path,
617- options::OPT_emit_private_module_interface_path,
618- options::OPT_emit_module_source_info_path,
619- options::OPT_emit_tbd_path)) {
619+ options::OPT_emit_objc_header_path, options::OPT_emit_cxx_header_path,
620+ options::OPT_emit_module_path, options::OPT_emit_module_doc_path,
621+ options::OPT_emit_dependencies_path,
622+ options::OPT_emit_reference_dependencies_path,
623+ options::OPT_serialize_diagnostics_path,
624+ options::OPT_emit_loaded_module_trace_path,
625+ options::OPT_emit_module_interface_path,
626+ options::OPT_emit_private_module_interface_path,
627+ options::OPT_emit_module_source_info_path,
628+ options::OPT_emit_tbd_path)) {
620629 Diags.diagnose (SourceLoc (),
621630 diag::error_cannot_have_supplementary_outputs,
622631 A->getSpelling (), " -supplementary-output-file-map" );
0 commit comments