@@ -668,17 +668,9 @@ static std::pair<CxxCompatMode, version::Version>
668668validateCxxInteropCompatibilityMode (StringRef mode) {
669669 if (mode == " off" )
670670 return {CxxCompatMode::off, {}};
671- if (mode == " default" )
671+ if (mode == " default" || mode == " upcoming-swift" || mode == " swift-6" ||
672+ mode == " swift-5.9" )
672673 return {CxxCompatMode::enabled, {}};
673- if (mode == " upcoming-swift" )
674- return {CxxCompatMode::enabled,
675- version::Version ({version::getUpcomingCxxInteropCompatVersion ()})};
676- if (mode == " swift-6" )
677- return {CxxCompatMode::enabled, version::Version ({6 })};
678- // Swift-5.9 corresponds to the Swift 5 language mode when
679- // Swift 5 is the default language version.
680- if (mode == " swift-5.9" )
681- return {CxxCompatMode::enabled, version::Version ({5 })};
682674 // Note: If this is updated, corresponding code in
683675 // InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl needs
684676 // to be updated also.
@@ -710,13 +702,6 @@ void LangOptions::setCxxInteropFromArgs(ArgList &Args,
710702 auto interopCompatMode = validateCxxInteropCompatibilityMode (A->getValue ());
711703 EnableCXXInterop |=
712704 (interopCompatMode.first == CxxCompatMode::enabled);
713- if (EnableCXXInterop) {
714- cxxInteropCompatVersion = interopCompatMode.second ;
715- // The default is tied to the current language version.
716- if (cxxInteropCompatVersion.empty ())
717- cxxInteropCompatVersion =
718- EffectiveLanguageVersion.asMajorVersion ();
719- }
720705
721706 if (interopCompatMode.first == CxxCompatMode::invalid)
722707 diagnoseCxxInteropCompatMode (A, Args, Diags);
@@ -726,11 +711,6 @@ void LangOptions::setCxxInteropFromArgs(ArgList &Args,
726711 Diags.diagnose (SourceLoc (), diag::enable_interop_flag_deprecated);
727712 Diags.diagnose (SourceLoc (), diag::swift_will_maintain_compat);
728713 EnableCXXInterop |= true ;
729- // Using the deprecated option only forces the 'swift-5.9' compat
730- // mode.
731- if (cxxInteropCompatVersion.empty ())
732- cxxInteropCompatVersion =
733- validateCxxInteropCompatibilityMode (" swift-5.9" ).second ;
734714 }
735715
736716 if (Arg *A = Args.getLastArg (options::OPT_formal_cxx_interoperability_mode)) {
0 commit comments