[cxx-interop] Allow Darwin overlay to be rebuilt with C++ interop enabled

This removes a workaround from the module interface loader, which was forcing Darwin to be rebuilt from their textual interfaces with C++ interop disabled, even if the current compilation explicitly enables it.

See also 3791ccb6.

rdar://142961112
This commit is contained in:
Egor Zhdan
2025-03-12 16:43:03 +00:00
parent 95ea0108ef
commit 4ce5a23034

View File

@@ -2102,11 +2102,9 @@ InterfaceSubContextDelegateImpl::runInSubCompilerInstance(StringRef moduleName,
BuildArgs.push_back("-module-name");
BuildArgs.push_back(moduleName);
// FIXME: Hack for Darwin.swiftmodule, which cannot be rebuilt with C++
// interop enabled by the Swift CI because it uses an old host SDK.
// FIXME: Hack for CoreGraphics.swiftmodule, which cannot be rebuilt because
// of a CF_OPTIONS bug (rdar://142762174).
if (moduleName == "Darwin" || moduleName == "CoreGraphics") {
if (moduleName == "CoreGraphics") {
subInvocation.getLangOptions().EnableCXXInterop = false;
subInvocation.getLangOptions().cxxInteropCompatVersion = {};
BuildArgs.erase(llvm::remove_if(BuildArgs,