Merge pull request #81908 from artemcm/FixImplicitBuildCXXInteropCycle

[C++Interop] Do not query C++ Standard Library Swift overlays when building Swift modules which were built without C++ interop
This commit is contained in:
Artem Chikin
2025-06-02 23:26:27 -07:00
committed by GitHub
8 changed files with 128 additions and 9 deletions

View File

@@ -1477,7 +1477,13 @@ void ModuleDependencyScanner::resolveSwiftOverlayDependenciesForModule(
// If the textual interface was built without C++ interop, do not query
// the C++ Standard Library Swift overlay for its compilation.
if (llvm::find(commandLine, "-formal-cxx-interoperability-mode=off") ==
//
// FIXME: We always declare the 'Darwin' module as formally having been built
// without C++Interop, for compatibility with prior versions. Once we are certain
// that we are only building against modules built with support of
// '-formal-cxx-interoperability-mode', this hard-coded check should be removed.
if (moduleID.ModuleName != "Darwin" &&
llvm::find(commandLine, "-formal-cxx-interoperability-mode=off") ==
commandLine.end()) {
for (const auto &clangDepName : allClangDependencies) {
// If this Clang module is a part of the C++ stdlib, and we haven't