Revert "Merge pull request #83483 from Xazax-hun/turn-off-addressable"

Afteri #83712 landed, let's make another try enabling addressable
parameters by default.

This reverts commit 61d60eb6ad, reversing
changes made to 670f69eadc.
This commit is contained in:
Gabor Horvath
2025-08-15 15:28:12 +01:00
parent 0f963d7819
commit 2a9f6f89e3
7 changed files with 5 additions and 27 deletions

View File

@@ -502,7 +502,6 @@ EXPERIMENTAL_FEATURE(CoroutineAccessorsUnwindOnCallerError, false)
EXPERIMENTAL_FEATURE(AddressableParameters, true)
SUPPRESSIBLE_EXPERIMENTAL_FEATURE(AddressableTypes, true)
EXPERIMENTAL_FEATURE(AddressableInterop, true)
/// Allow custom availability domains to be defined and referenced.
EXPERIMENTAL_FEATURE(CustomAvailability, true)

View File

@@ -270,7 +270,6 @@ static bool usesFeatureAddressableTypes(Decl *d) {
return false;
}
UNINTERESTING_FEATURE(AddressableInterop)
UNINTERESTING_FEATURE(IsolatedAny2)
UNINTERESTING_FEATURE(GlobalActorIsolatedTypesUsability)
UNINTERESTING_FEATURE(ObjCImplementation)

View File

@@ -4052,9 +4052,7 @@ namespace {
func->setSelfIndex(selfIdx.value());
// FIXME: Make this work when SIL Opaque Values are enabled.
// Currently, addressable parameters and opaque values are at odds.
if (Impl.SwiftContext.LangOpts.hasFeature(
Feature::AddressableInterop) &&
!dc->getDeclaredInterfaceType()->hasReferenceSemantics() &&
if (!dc->getDeclaredInterfaceType()->hasReferenceSemantics() &&
!importedName.importAsMember() &&
!Impl.SwiftContext.SILOpts.EnableSILOpaqueValues)
func->getAttrs().add(new (Impl.SwiftContext)

View File

@@ -2725,8 +2725,7 @@ static ParamDecl *getParameterInfo(ClangImporter::Implementation *impl,
// subobject of the referenced storage. In those cases we need to prevent the
// Swift compiler to pass in a temporary copy to prevent dangling.
auto paramContext = param->getDeclContext();
if (impl->SwiftContext.LangOpts.hasFeature(Feature::AddressableInterop) &&
!param->getType().isNull() && param->getType()->isLValueReferenceType() &&
if (!param->getType().isNull() && param->getType()->isLValueReferenceType() &&
!swiftParamTy->isForeignReferenceType() &&
!(isa<clang::FunctionDecl>(paramContext) &&
cast<clang::FunctionDecl>(paramContext)->isOverloadedOperator()) &&

View File

@@ -1,6 +1,4 @@
// 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
// REQUIRES: swift_feature_AddressableInterop
// RUN: %target-swiftxx-frontend -module-name cxx_ir -I %S/Inputs/custom-modules -emit-ir -o - -primary-file %s -Xcc -fignore-exceptions | %FileCheck %s
import CXXInterop

View File

@@ -1,10 +1,9 @@
// RUN: rm -rf %t
// RUN: split-file %s %t
// 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
// 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
// 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
// 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
// REQUIRES: swift_feature_LifetimeDependence
// REQUIRES: swift_feature_AddressableInterop
//--- Inputs/module.modulemap
module Test {

View File

@@ -7,20 +7,6 @@
// REQUIRES: executable_test
// libstdc++11 declares a templated constructor of std::function with an rvalue-reference parameter,
// which aren't yet supported in Swift. Therefore initializing a std::function from Swift closures
// will not work on the platforms that are shipped with this version of libstdc++ (rdar://125816354).
// XFAIL: LinuxDistribution=ubuntu-24.04
// XFAIL: LinuxDistribution=ubuntu-22.04
// XFAIL: LinuxDistribution=rhel-9.3
// XFAIL: LinuxDistribution=rhel-9.4
// XFAIL: LinuxDistribution=rhel-9.5
// XFAIL: LinuxDistribution=rhel-9.6
// XFAIL: LinuxDistribution=fedora-39
// XFAIL: LinuxDistribution=fedora-41
// XFAIL: LinuxDistribution=debian-12
// XFAIL: LinuxDistribution=amzn-2023
import StdlibUnittest
import StdFunction
import CxxStdlib