Skip to content

Commit b583656

Browse files
author
Gabor Horvath
committed
[6.1][cxx-interop] Renove escapability interop annotations
As this feature is still under design, we do not want users to depend on the semantics we ship in 6.1, so remove the annotations from the bridging header. This PR also removes the tests that rely on these annotations.
1 parent 1c572fa commit b583656

File tree

4 files changed

+0
-325
lines changed

4 files changed

+0
-325
lines changed

lib/ClangImporter/SwiftBridging/swift/bridging

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,6 @@
3939

4040
#define _CXX_INTEROP_STRINGIFY(_x) #_x
4141

42-
#define _CXX_INTEROP_CONCAT_(a,b,c,d,e,f,g,i,j,k,l,m,n,o,p,...) \
43-
#a "," #b "," #c "," #d "," #e "," #f "," #g "," #i "," #j "," #k "," \
44-
#l "," #m "," #n "," #o "," #p
45-
#define _CXX_INTEROP_CONCAT(...) \
46-
_CXX_INTEROP_CONCAT_(__VA_ARGS__,,,,,,,,,,,,,,,,,)
47-
4842
/// Specifies that a C++ `class` or `struct` is reference-counted using
4943
/// the given `retain` and `release` functions. This annotation lets Swift import
5044
/// such a type as reference counted type in Swift, taking advantage of Swift's
@@ -165,24 +159,6 @@
165159
#define SWIFT_NONCOPYABLE \
166160
__attribute__((swift_attr("~Copyable")))
167161

168-
/// Specifies that a specific c++ type such class or struct should be imported
169-
/// as a non-escapable Swift value type when the non-escapable language feature
170-
/// is enabled.
171-
#define SWIFT_NONESCAPABLE \
172-
__attribute__((swift_attr("~Escapable")))
173-
174-
/// Specifies that a specific c++ type such class or struct should be imported
175-
/// as a escapable Swift value. While this matches the default behavior,
176-
/// in safe mode interop mode it ensures that the type is not marked as
177-
/// unsafe.
178-
#define SWIFT_ESCAPABLE \
179-
__attribute__((swift_attr("Escapable")))
180-
181-
/// Specifies that a C++ `class` or `struct` should be imported as a escapable
182-
/// Swift value if all of the specified template arguments are escapable.
183-
#define SWIFT_ESCAPABLE_IF(...) \
184-
__attribute__((swift_attr("escapable_if:" _CXX_INTEROP_CONCAT(__VA_ARGS__))))
185-
186162
/// Specifies that the return value is passed as owned for C++ functions and
187163
/// methods returning types annotated as `SWIFT_SHARED_REFERENCE`
188164
#define SWIFT_RETURNS_RETAINED __attribute__((swift_attr("returns_retained")))
@@ -205,9 +181,6 @@
205181
#define SWIFT_MUTATING
206182
#define SWIFT_UNCHECKED_SENDABLE
207183
#define SWIFT_NONCOPYABLE
208-
#define SWIFT_NONESCAPABLE
209-
#define SWIFT_ESCAPABLE
210-
#define SWIFT_ESCAPABLE_IF(...)
211184
#define SWIFT_RETURNS_RETAINED
212185
#define SWIFT_RETURNS_UNRETAINED
213186

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

Lines changed: 0 additions & 100 deletions
This file was deleted.

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

Lines changed: 0 additions & 125 deletions
This file was deleted.

test/Interop/Cxx/class/safe-interop-mode.swift

Lines changed: 0 additions & 73 deletions
This file was deleted.

0 commit comments

Comments
 (0)