Skip to content

Commit 37ae8a2

Browse files
authored
Merge pull request #83430 from Xazax-hun/revert-addressable-flag
Revert "[cxx-interop] Move addressable parameters in interop behind a flag"
2 parents 6c8da76 + 254f72f commit 37ae8a2

File tree

7 files changed

+5
-27
lines changed

7 files changed

+5
-27
lines changed

include/swift/Basic/Features.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,6 @@ EXPERIMENTAL_FEATURE(CoroutineAccessorsUnwindOnCallerError, false)
500500

501501
EXPERIMENTAL_FEATURE(AddressableParameters, true)
502502
SUPPRESSIBLE_EXPERIMENTAL_FEATURE(AddressableTypes, true)
503-
EXPERIMENTAL_FEATURE(AddressableInterop, true)
504503

505504
/// Allow custom availability domains to be defined and referenced.
506505
EXPERIMENTAL_FEATURE(CustomAvailability, true)

lib/AST/FeatureSet.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@ static bool usesFeatureAddressableTypes(Decl *d) {
270270
return false;
271271
}
272272

273-
UNINTERESTING_FEATURE(AddressableInterop)
274273
UNINTERESTING_FEATURE(IsolatedAny2)
275274
UNINTERESTING_FEATURE(GlobalActorIsolatedTypesUsability)
276275
UNINTERESTING_FEATURE(ObjCImplementation)

lib/ClangImporter/ImportDecl.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4045,9 +4045,7 @@ namespace {
40454045
func->setSelfIndex(selfIdx.value());
40464046
// FIXME: Make this work when SIL Opaque Values are enabled.
40474047
// Currently, addressable parameters and opaque values are at odds.
4048-
if (Impl.SwiftContext.LangOpts.hasFeature(
4049-
Feature::AddressableInterop) &&
4050-
!dc->getDeclaredInterfaceType()->hasReferenceSemantics() &&
4048+
if (!dc->getDeclaredInterfaceType()->hasReferenceSemantics() &&
40514049
!importedName.importAsMember() &&
40524050
!Impl.SwiftContext.SILOpts.EnableSILOpaqueValues)
40534051
func->getAttrs().add(new (Impl.SwiftContext)

lib/ClangImporter/ImportType.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2725,8 +2725,7 @@ static ParamDecl *getParameterInfo(ClangImporter::Implementation *impl,
27252725
// subobject of the referenced storage. In those cases we need to prevent the
27262726
// Swift compiler to pass in a temporary copy to prevent dangling.
27272727
auto paramContext = param->getDeclContext();
2728-
if (impl->SwiftContext.LangOpts.hasFeature(Feature::AddressableInterop) &&
2729-
!param->getType().isNull() && param->getType()->isLValueReferenceType() &&
2728+
if (!param->getType().isNull() && param->getType()->isLValueReferenceType() &&
27302729
!swiftParamTy->isForeignReferenceType() &&
27312730
!(isa<clang::FunctionDecl>(paramContext) &&
27322731
cast<clang::FunctionDecl>(paramContext)->isOverloadedOperator()) &&

test/ClangImporter/cxx_interop_ir.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// RUN: %target-swiftxx-frontend -module-name cxx_ir -I %S/Inputs/custom-modules -emit-ir -o - -primary-file %s -Xcc -fignore-exceptions -enable-experimental-feature AddressableInterop | %FileCheck %s
2-
3-
// REQUIRES: swift_feature_AddressableInterop
1+
// RUN: %target-swiftxx-frontend -module-name cxx_ir -I %S/Inputs/custom-modules -emit-ir -o - -primary-file %s -Xcc -fignore-exceptions | %FileCheck %s
42

53
import CXXInterop
64

test/Interop/Cxx/class/nonescapable-lifetimebound.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
// RUN: rm -rf %t
22
// RUN: split-file %s %t
3-
// RUN: %target-swift-frontend -I %swift_src_root/lib/ClangImporter/SwiftBridging -I %t/Inputs -emit-sil %t/test.swift -enable-experimental-feature AddressableInterop -enable-experimental-feature LifetimeDependence -cxx-interoperability-mode=default -diagnostic-style llvm 2>&1 | %FileCheck %s
4-
// RUN: %target-swift-frontend -I %swift_src_root/lib/ClangImporter/SwiftBridging -I %t/Inputs -emit-sil %t/test.swift -enable-experimental-feature AddressableInterop -cxx-interoperability-mode=default -diagnostic-style llvm 2>&1 | %FileCheck %s
3+
// RUN: %target-swift-frontend -I %swift_src_root/lib/ClangImporter/SwiftBridging -I %t/Inputs -emit-sil %t/test.swift -enable-experimental-feature LifetimeDependence -cxx-interoperability-mode=default -diagnostic-style llvm 2>&1 | %FileCheck %s
4+
// RUN: %target-swift-frontend -I %swift_src_root/lib/ClangImporter/SwiftBridging -I %t/Inputs -emit-sil %t/test.swift -cxx-interoperability-mode=default -diagnostic-style llvm 2>&1 | %FileCheck %s
55

66
// REQUIRES: swift_feature_LifetimeDependence
7-
// REQUIRES: swift_feature_AddressableInterop
87

98
//--- Inputs/module.modulemap
109
module Test {

test/Interop/Cxx/stdlib/use-std-function.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,6 @@
77

88
// REQUIRES: executable_test
99

10-
// libstdc++11 declares a templated constructor of std::function with an rvalue-reference parameter,
11-
// which aren't yet supported in Swift. Therefore initializing a std::function from Swift closures
12-
// will not work on the platforms that are shipped with this version of libstdc++ (rdar://125816354).
13-
// XFAIL: LinuxDistribution=ubuntu-24.04
14-
// XFAIL: LinuxDistribution=ubuntu-22.04
15-
// XFAIL: LinuxDistribution=rhel-9.3
16-
// XFAIL: LinuxDistribution=rhel-9.4
17-
// XFAIL: LinuxDistribution=rhel-9.5
18-
// XFAIL: LinuxDistribution=rhel-9.6
19-
// XFAIL: LinuxDistribution=fedora-39
20-
// XFAIL: LinuxDistribution=fedora-41
21-
// XFAIL: LinuxDistribution=debian-12
22-
// XFAIL: LinuxDistribution=amzn-2023
23-
2410
import StdlibUnittest
2511
import StdFunction
2612
import CxxStdlib

0 commit comments

Comments
 (0)