Skip to content

Commit f148b8d

Browse files
committed
[Swiftify] Always annotate overloads with @_disfavoredOverload (#81579)
Previously we would only add @_disfavoredOverload if the only type changed was the return type, because in any other case it is unambiguous which overload to call. However it is still ambiguous when storing the function as a value rather than calling the function, unless explicit type annotations are used. To avoid breaking any existing code, this patch adds @_disfavoredOverload to every overload generated by @_SwiftifyImport. rdar://151206394 (cherry picked from commit 0f312ad)
1 parent 5c735c9 commit f148b8d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+187
-178
lines changed

lib/Macros/Sources/SwiftMacros/SwiftifyImportMacro.swift

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -381,10 +381,8 @@ func isMutablePointerType(_ type: TypeSyntax) -> Bool {
381381
protocol BoundsCheckedThunkBuilder {
382382
func buildFunctionCall(_ pointerArgs: [Int: ExprSyntax]) throws -> ExprSyntax
383383
func buildBoundsChecks() throws -> [CodeBlockItemSyntax.Item]
384-
// The second component of the return value is true when only the return type of the
385-
// function signature was changed.
386384
func buildFunctionSignature(_ argTypes: [Int: TypeSyntax?], _ returnType: TypeSyntax?) throws
387-
-> (FunctionSignatureSyntax, Bool)
385+
-> FunctionSignatureSyntax
388386
}
389387

390388
func getParam(_ signature: FunctionSignatureSyntax, _ paramIndex: Int) -> FunctionParameterSyntax {
@@ -412,7 +410,7 @@ struct FunctionCallBuilder: BoundsCheckedThunkBuilder {
412410
}
413411

414412
func buildFunctionSignature(_ argTypes: [Int: TypeSyntax?], _ returnType: TypeSyntax?) throws
415-
-> (FunctionSignatureSyntax, Bool)
413+
-> FunctionSignatureSyntax
416414
{
417415
var newParams = base.signature.parameterClause.parameters.enumerated().filter {
418416
let type = argTypes[$0.offset]
@@ -430,7 +428,7 @@ struct FunctionCallBuilder: BoundsCheckedThunkBuilder {
430428
if returnType != nil {
431429
sig = sig.with(\.returnClause!.type, returnType!)
432430
}
433-
return (sig, (argTypes.count == 0 && returnType != nil))
431+
return sig
434432
}
435433

436434
func buildFunctionCall(_ pointerArgs: [Int: ExprSyntax]) throws -> ExprSyntax {
@@ -479,7 +477,7 @@ struct CxxSpanThunkBuilder: SpanBoundsThunkBuilder, ParamBoundsThunkBuilder {
479477
}
480478

481479
func buildFunctionSignature(_ argTypes: [Int: TypeSyntax?], _ returnType: TypeSyntax?) throws
482-
-> (FunctionSignatureSyntax, Bool)
480+
-> FunctionSignatureSyntax
483481
{
484482
var types = argTypes
485483
types[index] = try newType
@@ -529,7 +527,7 @@ struct CxxSpanReturnThunkBuilder: SpanBoundsThunkBuilder {
529527
}
530528

531529
func buildFunctionSignature(_ argTypes: [Int: TypeSyntax?], _ returnType: TypeSyntax?) throws
532-
-> (FunctionSignatureSyntax, Bool)
530+
-> FunctionSignatureSyntax
533531
{
534532
assert(returnType == nil)
535533
return try base.buildFunctionSignature(argTypes, newType)
@@ -669,7 +667,7 @@ struct CountedOrSizedReturnPointerThunkBuilder: PointerBoundsThunkBuilder {
669667
}
670668

671669
func buildFunctionSignature(_ argTypes: [Int: TypeSyntax?], _ returnType: TypeSyntax?) throws
672-
-> (FunctionSignatureSyntax, Bool)
670+
-> FunctionSignatureSyntax
673671
{
674672
assert(returnType == nil)
675673
return try base.buildFunctionSignature(argTypes, newType)
@@ -730,7 +728,7 @@ struct CountedOrSizedPointerThunkBuilder: ParamBoundsThunkBuilder, PointerBounds
730728
var generateSpan: Bool { nonescaping }
731729

732730
func buildFunctionSignature(_ argTypes: [Int: TypeSyntax?], _ returnType: TypeSyntax?) throws
733-
-> (FunctionSignatureSyntax, Bool)
731+
-> FunctionSignatureSyntax
734732
{
735733
var types = argTypes
736734
types[index] = try newType
@@ -1566,7 +1564,7 @@ public struct SwiftifyImportMacro: PeerMacro {
15661564
{ (prev, parsedArg) in
15671565
parsedArg.getBoundsCheckedThunkBuilder(prev, funcDecl, skipTrivialCount)
15681566
})
1569-
let (newSignature, onlyReturnTypeChanged) = try builder.buildFunctionSignature([:], nil)
1567+
let newSignature = try builder.buildFunctionSignature([:], nil)
15701568
let checks =
15711569
skipTrivialCount
15721570
? [] as [CodeBlockItemSyntax]
@@ -1584,13 +1582,12 @@ public struct SwiftifyImportMacro: PeerMacro {
15841582
returnLifetimeAttribute + paramLifetimeAttributes(newSignature, funcDecl.attributes)
15851583
let availabilityAttr = try getAvailability(newSignature, spanAvailability)
15861584
let disfavoredOverload: [AttributeListSyntax.Element] =
1587-
(onlyReturnTypeChanged
1588-
? [
1589-
.attribute(
1590-
AttributeSyntax(
1591-
atSign: .atSignToken(),
1592-
attributeName: IdentifierTypeSyntax(name: "_disfavoredOverload")))
1593-
] : [])
1585+
[
1586+
.attribute(
1587+
AttributeSyntax(
1588+
atSign: .atSignToken(),
1589+
attributeName: IdentifierTypeSyntax(name: "_disfavoredOverload")))
1590+
]
15941591
let newFunc =
15951592
funcDecl
15961593
.with(\.signature, newSignature)

test/Interop/C/swiftify-import/comments.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
// CHECK-NEXT:func blockDocComment(_ len: Int32, _ p: UnsafeMutablePointer<Int32>!)
2828

2929
// CHECK-NEXT:/// This is an auto-generated wrapper for safer interop
30-
// CHECK-NEXT:@_alwaysEmitIntoClient public func blockComment(_ p: UnsafeMutableBufferPointer<Int32>)
30+
// CHECK-NEXT:@_alwaysEmitIntoClient @_disfavoredOverload public func blockComment(_ p: UnsafeMutableBufferPointer<Int32>)
3131

3232
// CHECK-NEXT:/**
3333
// CHECK-NEXT: * block doc comment
@@ -37,10 +37,10 @@
3737
// CHECK-NEXT: * @param p some integers to play with
3838
// CHECK-NEXT: */
3939
// CHECK-NEXT:/// This is an auto-generated wrapper for safer interop
40-
// CHECK-NEXT:@_alwaysEmitIntoClient public func blockDocComment(_ p: UnsafeMutableBufferPointer<Int32>)
40+
// CHECK-NEXT:@_alwaysEmitIntoClient @_disfavoredOverload public func blockDocComment(_ p: UnsafeMutableBufferPointer<Int32>)
4141

4242
// CHECK-NEXT:/// This is an auto-generated wrapper for safer interop
43-
// CHECK-NEXT:@_alwaysEmitIntoClient public func lineComment(_ p: UnsafeMutableBufferPointer<Int32>)
43+
// CHECK-NEXT:@_alwaysEmitIntoClient @_disfavoredOverload public func lineComment(_ p: UnsafeMutableBufferPointer<Int32>)
4444

4545
// CHECK-NEXT:/// line doc comment
4646
// CHECK-NEXT:///
@@ -49,4 +49,4 @@
4949
// CHECK-NEXT:/// @param len the buffer length
5050
// CHECK-NEXT:/// @param p the buffer
5151
// CHECK-NEXT:/// This is an auto-generated wrapper for safer interop
52-
// CHECK-NEXT:@_alwaysEmitIntoClient public func lineDocComment(_ p: UnsafeMutableBufferPointer<Int32>)
52+
// CHECK-NEXT:@_alwaysEmitIntoClient @_disfavoredOverload public func lineDocComment(_ p: UnsafeMutableBufferPointer<Int32>)

test/Interop/C/swiftify-import/counted-by-lifetimebound.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import CountedByLifetimeboundClang
1515
// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
1616
// CHECK-NEXT: @lifetime(copy p)
1717
// CHECK-NEXT: @lifetime(p: copy p)
18-
// CHECK-NEXT: @_alwaysEmitIntoClient public func complexExpr(_ len: Int32, _ offset: Int32, _ len2: Int32, _ p: inout MutableSpan<Int32>) -> MutableSpan<Int32>
18+
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func complexExpr(_ len: Int32, _ offset: Int32, _ len2: Int32, _ p: inout MutableSpan<Int32>) -> MutableSpan<Int32>
1919

2020
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
2121
// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
@@ -26,31 +26,31 @@ import CountedByLifetimeboundClang
2626
// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
2727
// CHECK-NEXT: @lifetime(copy p)
2828
// CHECK-NEXT: @lifetime(p: copy p)
29-
// CHECK-NEXT: @_alwaysEmitIntoClient public func nonnull(_ len: Int32, _ p: inout MutableSpan<Int32>) -> MutableSpan<Int32>
29+
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func nonnull(_ len: Int32, _ p: inout MutableSpan<Int32>) -> MutableSpan<Int32>
3030

3131
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
3232
// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
3333
// CHECK-NEXT: @lifetime(copy p)
3434
// CHECK-NEXT: @lifetime(p: copy p)
35-
// CHECK-NEXT: @_alwaysEmitIntoClient public func nullUnspecified(_ len: Int32, _ p: inout MutableSpan<Int32>) -> MutableSpan<Int32>
35+
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func nullUnspecified(_ len: Int32, _ p: inout MutableSpan<Int32>) -> MutableSpan<Int32>
3636

3737
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
3838
// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
3939
// CHECK-NEXT: @lifetime(copy p)
4040
// CHECK-NEXT: @lifetime(p: copy p)
41-
// CHECK-NEXT: @_alwaysEmitIntoClient public func nullable(_ len: Int32, _ p: inout MutableSpan<Int32>?) -> MutableSpan<Int32>?
41+
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func nullable(_ len: Int32, _ p: inout MutableSpan<Int32>?) -> MutableSpan<Int32>?
4242

4343
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
4444
// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
4545
// CHECK-NEXT: @lifetime(copy p)
4646
// CHECK-NEXT: @lifetime(p: copy p)
47-
// CHECK-NEXT: @_alwaysEmitIntoClient public func shared(_ len: Int32, _ p: inout MutableSpan<Int32>) -> MutableSpan<Int32>
47+
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func shared(_ len: Int32, _ p: inout MutableSpan<Int32>) -> MutableSpan<Int32>
4848

4949
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
5050
// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
5151
// CHECK-NEXT: @lifetime(copy p)
5252
// CHECK-NEXT: @lifetime(p: copy p)
53-
// CHECK-NEXT: @_alwaysEmitIntoClient public func simple(_ len: Int32, _ p: inout MutableSpan<Int32>) -> MutableSpan<Int32>
53+
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func simple(_ len: Int32, _ p: inout MutableSpan<Int32>) -> MutableSpan<Int32>
5454

5555

5656
@available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)

test/Interop/C/swiftify-import/counted-by-noescape.swift

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,90 +14,90 @@ import CountedByNoEscapeClang
1414
// CHECK: /// This is an auto-generated wrapper for safer interop
1515
// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
1616
// CHECK-NEXT: @lifetime(_anonymous_param1: copy _anonymous_param1)
17-
// CHECK-NEXT: @_alwaysEmitIntoClient public func anonymous(_ _anonymous_param1: inout MutableSpan<Int32>?)
17+
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func anonymous(_ _anonymous_param1: inout MutableSpan<Int32>?)
1818

1919
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
2020
// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
2121
// CHECK-NEXT: @lifetime(func: copy func)
22-
// CHECK-NEXT: @_alwaysEmitIntoClient public func clash(func: inout MutableSpan<Int32>?, clash where: Int32)
22+
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func clash(func: inout MutableSpan<Int32>?, clash where: Int32)
2323

2424
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
2525
// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
2626
// CHECK-NEXT: @lifetime(_clash2_param1: copy _clash2_param1)
27-
// CHECK-NEXT: @_alwaysEmitIntoClient public func clash2(func _clash2_param1: inout MutableSpan<Int32>?, clash2 _clash2_param2: Int32)
27+
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func clash2(func _clash2_param1: inout MutableSpan<Int32>?, clash2 _clash2_param2: Int32)
2828

2929
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
3030
// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
3131
// CHECK-NEXT: @lifetime(p: copy p)
32-
// CHECK-NEXT: @_alwaysEmitIntoClient public func complexExpr(_ len: Int32, _ offset: Int32, _ p: inout MutableSpan<Int32>)
32+
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func complexExpr(_ len: Int32, _ offset: Int32, _ p: inout MutableSpan<Int32>)
3333

3434
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
3535
// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
3636
// CHECK-NEXT: @lifetime(_func_param1: copy _func_param1)
37-
// CHECK-NEXT: @_alwaysEmitIntoClient public func `func`(_ _func_param1: inout MutableSpan<Int32>?)
37+
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func `func`(_ _func_param1: inout MutableSpan<Int32>?)
3838

3939
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
4040
// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
4141
// CHECK-NEXT: @lifetime(borrow extension)
4242
// CHECK-NEXT: @lifetime(func: copy func)
43-
// CHECK-NEXT: @_alwaysEmitIntoClient public func funcRenamed(func: inout MutableSpan<Int32>?, extension: Int32, init: Int32, open: Int32, var: Int32, is: Int32, as: Int32, in: Int32, guard: Int32, where: Int32) -> UnsafeMutableRawPointer!
43+
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func funcRenamed(func: inout MutableSpan<Int32>?, extension: Int32, init: Int32, open: Int32, var: Int32, is: Int32, as: Int32, in: Int32, guard: Int32, where: Int32) -> UnsafeMutableRawPointer!
4444

4545
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
4646
// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
4747
// CHECK-NEXT: @lifetime(borrow _funcRenamedAnon_param2)
4848
// CHECK-NEXT: @lifetime(_funcRenamedAnon_param1: copy _funcRenamedAnon_param1)
49-
// CHECK-NEXT: @_alwaysEmitIntoClient public func funcRenamedAnon(func _funcRenamedAnon_param1: inout MutableSpan<Int32>?, extension _funcRenamedAnon_param2: Int32, init _funcRenamedAnon_param3: Int32, open _funcRenamedAnon_param4: Int32, var _funcRenamedAnon_param5: Int32, is _funcRenamedAnon_param6: Int32, as _funcRenamedAnon_param7: Int32, in _funcRenamedAnon_param8: Int32, guard _funcRenamedAnon_param9: Int32, where _funcRenamedAnon_param10: Int32) -> UnsafeMutableRawPointer!
49+
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func funcRenamedAnon(func _funcRenamedAnon_param1: inout MutableSpan<Int32>?, extension _funcRenamedAnon_param2: Int32, init _funcRenamedAnon_param3: Int32, open _funcRenamedAnon_param4: Int32, var _funcRenamedAnon_param5: Int32, is _funcRenamedAnon_param6: Int32, as _funcRenamedAnon_param7: Int32, in _funcRenamedAnon_param8: Int32, guard _funcRenamedAnon_param9: Int32, where _funcRenamedAnon_param10: Int32) -> UnsafeMutableRawPointer!
5050

5151
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
5252
// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
5353
// CHECK-NEXT: @lifetime(_in_param1: copy _in_param1)
54-
// CHECK-NEXT: @_alwaysEmitIntoClient public func `in`(func _in_param1: inout MutableSpan<Int32>?, in _in_param2: Int32)
54+
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func `in`(func _in_param1: inout MutableSpan<Int32>?, in _in_param2: Int32)
5555

5656
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
5757
// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
5858
// CHECK-NEXT: @lifetime(func: copy func)
59-
// CHECK-NEXT: @_alwaysEmitIntoClient public func keyword(_ func: inout MutableSpan<Int32>?, _ extension: Int32, _ init: Int32, _ open: Int32, _ var: Int32, _ is: Int32, _ as: Int32, _ in: Int32, _ guard: Int32, _ where: Int32)
59+
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func keyword(_ func: inout MutableSpan<Int32>?, _ extension: Int32, _ init: Int32, _ open: Int32, _ var: Int32, _ is: Int32, _ as: Int32, _ in: Int32, _ guard: Int32, _ where: Int32)
6060

6161
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
6262
// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
6363
// CHECK-NEXT: @lifetime(p: copy p)
64-
// CHECK-NEXT: @_alwaysEmitIntoClient public func keywordType(_ p: inout MutableSpan<actor?>, _ p2: actor) -> actor
64+
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func keywordType(_ p: inout MutableSpan<actor?>, _ p2: actor) -> actor
6565

6666
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
6767
// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
6868
// CHECK-NEXT: @lifetime(_lenName_param2: copy _lenName_param2)
69-
// CHECK-NEXT: @_alwaysEmitIntoClient public func lenName(_ _lenName_param0: Int32, _ _lenName_param1: Int32, _ _lenName_param2: inout MutableSpan<Int32>?)
69+
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func lenName(_ _lenName_param0: Int32, _ _lenName_param1: Int32, _ _lenName_param2: inout MutableSpan<Int32>?)
7070

7171
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
7272
// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
7373
// CHECK-NEXT: @lifetime(p: copy p)
74-
// CHECK-NEXT: @_alwaysEmitIntoClient public func nonnull(_ p: inout MutableSpan<Int32>)
74+
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func nonnull(_ p: inout MutableSpan<Int32>)
7575

7676
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
7777
// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
7878
// CHECK-NEXT: @lifetime(p: copy p)
79-
// CHECK-NEXT: @_alwaysEmitIntoClient public func nullUnspecified(_ p: inout MutableSpan<Int32>)
79+
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func nullUnspecified(_ p: inout MutableSpan<Int32>)
8080

8181
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
8282
// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
8383
// CHECK-NEXT: @lifetime(p: copy p)
84-
// CHECK-NEXT: @_alwaysEmitIntoClient public func nullable(_ p: inout MutableSpan<Int32>?)
84+
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func nullable(_ p: inout MutableSpan<Int32>?)
8585

8686
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
8787
// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
8888
// CHECK-NEXT: @lifetime(func: copy func)
89-
// CHECK-NEXT: @_alwaysEmitIntoClient public func open(func: inout MutableSpan<Int32>?, open where: Int32)
89+
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func open(func: inout MutableSpan<Int32>?, open where: Int32)
9090

9191
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
9292
// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
9393
// CHECK-NEXT: @lifetime(_pointerName_param1: copy _pointerName_param1)
94-
// CHECK-NEXT: @_alwaysEmitIntoClient public func pointerName(_ _pointerName_param1: inout MutableSpan<Int32>?)
94+
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func pointerName(_ _pointerName_param1: inout MutableSpan<Int32>?)
9595

9696
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
9797
// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
9898
// CHECK-NEXT: @lifetime(copy p)
9999
// CHECK-NEXT: @lifetime(p: copy p)
100-
// CHECK-NEXT: @_alwaysEmitIntoClient public func returnLifetimeBound(_ len1: Int32, _ p: inout MutableSpan<Int32>) -> MutableSpan<Int32>
100+
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func returnLifetimeBound(_ len1: Int32, _ p: inout MutableSpan<Int32>) -> MutableSpan<Int32>
101101

102102
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
103103
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func returnPointer(_ len: Int32) -> UnsafeMutableBufferPointer<Int32>
@@ -106,17 +106,17 @@ import CountedByNoEscapeClang
106106
// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
107107
// CHECK-NEXT: @lifetime(p1: copy p1)
108108
// CHECK-NEXT: @lifetime(p2: copy p2)
109-
// CHECK-NEXT: @_alwaysEmitIntoClient public func shared(_ len: Int32, _ p1: inout MutableSpan<Int32>, _ p2: inout MutableSpan<Int32>)
109+
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func shared(_ len: Int32, _ p1: inout MutableSpan<Int32>, _ p2: inout MutableSpan<Int32>)
110110

111111
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
112112
// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
113113
// CHECK-NEXT: @lifetime(p: copy p)
114-
// CHECK-NEXT: @_alwaysEmitIntoClient public func simple(_ p: inout MutableSpan<Int32>)
114+
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func simple(_ p: inout MutableSpan<Int32>)
115115

116116
// CHECK-NEXT: /// This is an auto-generated wrapper for safer interop
117117
// CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
118118
// CHECK-NEXT: @lifetime(p: copy p)
119-
// CHECK-NEXT: @_alwaysEmitIntoClient public func swiftAttr(_ p: inout MutableSpan<Int32>)
119+
// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func swiftAttr(_ p: inout MutableSpan<Int32>)
120120

121121
@available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *)
122122
@lifetime(p: copy p)

0 commit comments

Comments
 (0)