@@ -2014,12 +2014,8 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl(
2014
2014
GenericArgs.push_back (blocklist);
2015
2015
}
2016
2016
2017
- // For now, we only inherit the C++ interoperability mode in
2018
- // Explicit Module Builds.
2019
- if (langOpts.EnableCXXInterop &&
2020
- (frontendOpts.DisableImplicitModules ||
2021
- LoaderOpts.requestedAction ==
2022
- FrontendOptions::ActionType::ScanDependencies)) {
2017
+ // Inherit the C++ interoperability mode.
2018
+ if (langOpts.EnableCXXInterop ) {
2023
2019
// Modelled after a reverse of validateCxxInteropCompatibilityMode
2024
2020
genericSubInvocation.getLangOptions ().EnableCXXInterop = true ;
2025
2021
genericSubInvocation.getLangOptions ().cxxInteropCompatVersion =
@@ -2208,6 +2204,19 @@ InterfaceSubContextDelegateImpl::runInSubCompilerInstance(StringRef moduleName,
2208
2204
BuildArgs.push_back (" -module-name" );
2209
2205
BuildArgs.push_back (moduleName);
2210
2206
2207
+ // FIXME: Hack for Darwin.swiftmodule, which cannot be rebuilt with C++
2208
+ // interop enabled by the Swift CI because it uses an old host SDK.
2209
+ if (moduleName == " Darwin" ) {
2210
+ subInvocation.getLangOptions ().EnableCXXInterop = false ;
2211
+ subInvocation.getLangOptions ().cxxInteropCompatVersion = {};
2212
+ BuildArgs.erase (llvm::remove_if (BuildArgs,
2213
+ [](StringRef arg) -> bool {
2214
+ return arg.starts_with (
2215
+ " -cxx-interoperability-mode=" );
2216
+ }),
2217
+ BuildArgs.end ());
2218
+ }
2219
+
2211
2220
// Calculate output path of the module.
2212
2221
llvm::SmallString<256 > buffer;
2213
2222
StringRef CacheHash;
0 commit comments