diff --git a/lib/Macros/Sources/SwiftMacros/SwiftifyImportMacro.swift b/lib/Macros/Sources/SwiftMacros/SwiftifyImportMacro.swift index 726f1a78186cd..e588ca1e49ef6 100644 --- a/lib/Macros/Sources/SwiftMacros/SwiftifyImportMacro.swift +++ b/lib/Macros/Sources/SwiftMacros/SwiftifyImportMacro.swift @@ -389,10 +389,8 @@ func isMutablePointerType(_ type: TypeSyntax) -> Bool { protocol BoundsCheckedThunkBuilder { func buildFunctionCall(_ pointerArgs: [Int: ExprSyntax]) throws -> ExprSyntax func buildBoundsChecks() throws -> [CodeBlockItemSyntax.Item] - // The second component of the return value is true when only the return type of the - // function signature was changed. func buildFunctionSignature(_ argTypes: [Int: TypeSyntax?], _ returnType: TypeSyntax?) throws - -> (FunctionSignatureSyntax, Bool) + -> FunctionSignatureSyntax } func getParam(_ signature: FunctionSignatureSyntax, _ paramIndex: Int) -> FunctionParameterSyntax { @@ -420,7 +418,7 @@ struct FunctionCallBuilder: BoundsCheckedThunkBuilder { } func buildFunctionSignature(_ argTypes: [Int: TypeSyntax?], _ returnType: TypeSyntax?) throws - -> (FunctionSignatureSyntax, Bool) + -> FunctionSignatureSyntax { var newParams = base.signature.parameterClause.parameters.enumerated().filter { let type = argTypes[$0.offset] @@ -443,7 +441,7 @@ struct FunctionCallBuilder: BoundsCheckedThunkBuilder { if returnType != nil { sig = sig.with(\.returnClause!.type, returnType!) } - return (sig, (argTypes.count == 0 && returnType != nil)) + return sig } func buildFunctionCall(_ pointerArgs: [Int: ExprSyntax]) throws -> ExprSyntax { @@ -493,7 +491,7 @@ struct CxxSpanThunkBuilder: SpanBoundsThunkBuilder, ParamBoundsThunkBuilder { } func buildFunctionSignature(_ argTypes: [Int: TypeSyntax?], _ returnType: TypeSyntax?) throws - -> (FunctionSignatureSyntax, Bool) + -> FunctionSignatureSyntax { var types = argTypes types[index] = try newType @@ -543,7 +541,7 @@ struct CxxSpanReturnThunkBuilder: SpanBoundsThunkBuilder { } func buildFunctionSignature(_ argTypes: [Int: TypeSyntax?], _ returnType: TypeSyntax?) throws - -> (FunctionSignatureSyntax, Bool) + -> FunctionSignatureSyntax { assert(returnType == nil) return try base.buildFunctionSignature(argTypes, newType) @@ -680,7 +678,7 @@ struct CountedOrSizedReturnPointerThunkBuilder: PointerBoundsThunkBuilder { } func buildFunctionSignature(_ argTypes: [Int: TypeSyntax?], _ returnType: TypeSyntax?) throws - -> (FunctionSignatureSyntax, Bool) + -> FunctionSignatureSyntax { assert(returnType == nil) return try base.buildFunctionSignature(argTypes, newType) @@ -739,7 +737,7 @@ struct CountedOrSizedPointerThunkBuilder: ParamBoundsThunkBuilder, PointerBounds var generateSpan: Bool { nonescaping } func buildFunctionSignature(_ argTypes: [Int: TypeSyntax?], _ returnType: TypeSyntax?) throws - -> (FunctionSignatureSyntax, Bool) + -> FunctionSignatureSyntax { var types = argTypes types[index] = try newType @@ -1502,7 +1500,7 @@ public struct SwiftifyImportMacro: PeerMacro { { (prev, parsedArg) in parsedArg.getBoundsCheckedThunkBuilder(prev, funcDecl, skipTrivialCount) }) - let (newSignature, onlyReturnTypeChanged) = try builder.buildFunctionSignature([:], nil) + let newSignature = try builder.buildFunctionSignature([:], nil) let checks = skipTrivialCount ? [] as [CodeBlockItemSyntax] @@ -1520,13 +1518,12 @@ public struct SwiftifyImportMacro: PeerMacro { returnLifetimeAttribute + paramLifetimeAttributes(newSignature, funcDecl.attributes) let availabilityAttr = try getAvailability(newSignature, spanAvailability) let disfavoredOverload: [AttributeListSyntax.Element] = - (onlyReturnTypeChanged - ? [ - .attribute( - AttributeSyntax( - atSign: .atSignToken(), - attributeName: IdentifierTypeSyntax(name: "_disfavoredOverload"))) - ] : []) + [ + .attribute( + AttributeSyntax( + atSign: .atSignToken(), + attributeName: IdentifierTypeSyntax(name: "_disfavoredOverload"))) + ] let newFunc = funcDecl .with(\.signature, newSignature) diff --git a/test/Interop/C/swiftify-import/counted-by-noescape.swift b/test/Interop/C/swiftify-import/counted-by-noescape.swift index f0ffb4a660fa0..16f1e189a7366 100644 --- a/test/Interop/C/swiftify-import/counted-by-noescape.swift +++ b/test/Interop/C/swiftify-import/counted-by-noescape.swift @@ -13,34 +13,34 @@ import CountedByNoEscapeClang // CHECK: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) // CHECK-NEXT: @lifetime(_param1: copy _param1) -// CHECK-NEXT: @_alwaysEmitIntoClient public func anonymous(_ _param1: inout MutableSpan?) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func anonymous(_ _param1: inout MutableSpan?) // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) // CHECK-NEXT: @lifetime(p: copy p) -// CHECK-NEXT: @_alwaysEmitIntoClient public func complexExpr(_ len: Int32, _ offset: Int32, _ p: inout MutableSpan) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func complexExpr(_ len: Int32, _ offset: Int32, _ p: inout MutableSpan) // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) // CHECK-NEXT: @lifetime(p: copy p) -// CHECK-NEXT: @_alwaysEmitIntoClient public func nonnull(_ p: inout MutableSpan) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func nonnull(_ p: inout MutableSpan) // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) // CHECK-NEXT: @lifetime(p: copy p) -// CHECK-NEXT: @_alwaysEmitIntoClient public func nullUnspecified(_ p: inout MutableSpan) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func nullUnspecified(_ p: inout MutableSpan) // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) // CHECK-NEXT: @lifetime(p: copy p) -// CHECK-NEXT: @_alwaysEmitIntoClient public func nullable(_ p: inout MutableSpan?) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func nullable(_ p: inout MutableSpan?) // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) // CHECK-NEXT: @lifetime(copy p) // CHECK-NEXT: @lifetime(p: copy p) -// CHECK-NEXT: @_alwaysEmitIntoClient public func returnLifetimeBound(_ len1: Int32, _ p: inout MutableSpan) -> MutableSpan +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func returnLifetimeBound(_ len1: Int32, _ p: inout MutableSpan) -> MutableSpan // CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func returnPointer(_ len: Int32) -> UnsafeMutableBufferPointer // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) // CHECK-NEXT: @lifetime(p1: copy p1) // CHECK-NEXT: @lifetime(p2: copy p2) -// CHECK-NEXT: @_alwaysEmitIntoClient public func shared(_ len: Int32, _ p1: inout MutableSpan, _ p2: inout MutableSpan) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func shared(_ len: Int32, _ p1: inout MutableSpan, _ p2: inout MutableSpan) // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) // CHECK-NEXT: @lifetime(p: copy p) -// CHECK-NEXT: @_alwaysEmitIntoClient public func simple(_ p: inout MutableSpan) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func simple(_ p: inout MutableSpan) // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) // CHECK-NEXT: @lifetime(p: copy p) -// CHECK-NEXT: @_alwaysEmitIntoClient public func swiftAttr(_ p: inout MutableSpan) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func swiftAttr(_ p: inout MutableSpan) @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) @lifetime(p: copy p) diff --git a/test/Interop/C/swiftify-import/counted-by.swift b/test/Interop/C/swiftify-import/counted-by.swift index d77ce9d33475f..9c9f421ac1a92 100644 --- a/test/Interop/C/swiftify-import/counted-by.swift +++ b/test/Interop/C/swiftify-import/counted-by.swift @@ -10,24 +10,24 @@ import CountedByClang -// CHECK: @_alwaysEmitIntoClient public func bitshift(_ m: Int32, _ n: Int32, _ o: Int32, _ p: UnsafeMutableBufferPointer) -// CHECK-NEXT: @_alwaysEmitIntoClient public func bitwise(_ m: Int32, _ n: Int32, _ o: Int32, _ p: UnsafeMutableBufferPointer) -// CHECK-NEXT: @_alwaysEmitIntoClient public func complexExpr(_ len: Int{{.*}}, _ offset: Int{{.*}}, _ p: UnsafeMutableBufferPointer) -// CHECK-NEXT: @_alwaysEmitIntoClient public func constFloatCastedToInt(_ p: UnsafeMutableBufferPointer) -// CHECK-NEXT: @_alwaysEmitIntoClient public func constInt(_ p: UnsafeMutableBufferPointer) -// CHECK-NEXT: @_alwaysEmitIntoClient public func nonnull(_ p: UnsafeMutableBufferPointer) -// CHECK-NEXT: @_alwaysEmitIntoClient public func nullUnspecified(_ p: UnsafeMutableBufferPointer) -// CHECK-NEXT: @_alwaysEmitIntoClient public func nullable(_ p: UnsafeMutableBufferPointer?) -// CHECK-NEXT: @_alwaysEmitIntoClient public func offByOne(_ len: Int32, _ p: UnsafeMutableBufferPointer) -// CHECK-NEXT: @_alwaysEmitIntoClient public func offBySome(_ len: Int32, _ offset: Int32, _ p: UnsafeMutableBufferPointer) +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload public func bitshift(_ m: Int32, _ n: Int32, _ o: Int32, _ p: UnsafeMutableBufferPointer) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func bitwise(_ m: Int32, _ n: Int32, _ o: Int32, _ p: UnsafeMutableBufferPointer) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func complexExpr(_ len: Int{{.*}}, _ offset: Int{{.*}}, _ p: UnsafeMutableBufferPointer) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func constFloatCastedToInt(_ p: UnsafeMutableBufferPointer) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func constInt(_ p: UnsafeMutableBufferPointer) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func nonnull(_ p: UnsafeMutableBufferPointer) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func nullUnspecified(_ p: UnsafeMutableBufferPointer) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func nullable(_ p: UnsafeMutableBufferPointer?) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func offByOne(_ len: Int32, _ p: UnsafeMutableBufferPointer) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func offBySome(_ len: Int32, _ offset: Int32, _ p: UnsafeMutableBufferPointer) // CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func returnPointer(_ len: Int{{.*}}) -> UnsafeMutableBufferPointer -// CHECK-NEXT: @_alwaysEmitIntoClient public func scalar(_ m: Int32, _ n: Int32, _ p: UnsafeMutableBufferPointer) -// CHECK-NEXT: @_alwaysEmitIntoClient public func shared(_ len: Int{{.*}}, _ p1: UnsafeMutableBufferPointer, _ p2: UnsafeMutableBufferPointer) -// CHECK-NEXT: @_alwaysEmitIntoClient public func simple(_ p: UnsafeMutableBufferPointer) -// CHECK-NEXT: @_alwaysEmitIntoClient public func simpleFlipped(_ p: UnsafeMutableBufferPointer) -// CHECK-NEXT: @_alwaysEmitIntoClient public func sizeofParam(_ p: UnsafeMutableBufferPointer) -// CHECK-NEXT: @_alwaysEmitIntoClient public func sizeofType(_ p: UnsafeMutableBufferPointer) -// CHECK-NEXT: @_alwaysEmitIntoClient public func swiftAttr(_ p: UnsafeMutableBufferPointer) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func scalar(_ m: Int32, _ n: Int32, _ p: UnsafeMutableBufferPointer) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func shared(_ len: Int{{.*}}, _ p1: UnsafeMutableBufferPointer, _ p2: UnsafeMutableBufferPointer) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func simple(_ p: UnsafeMutableBufferPointer) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func simpleFlipped(_ p: UnsafeMutableBufferPointer) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func sizeofParam(_ p: UnsafeMutableBufferPointer) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func sizeofType(_ p: UnsafeMutableBufferPointer) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func swiftAttr(_ p: UnsafeMutableBufferPointer) @inlinable public func callComplexExpr(_ p: UnsafeMutableBufferPointer) { @@ -80,6 +80,18 @@ public func callSimple(_ p: UnsafeMutableBufferPointer) { simple(p) } +@inlinable +public func callSimpleIndirectOriginal(_ p: UnsafeMutablePointer) { + let f = simple + f(13, p) +} + +@inlinable +public func callSimpleIndirectOverload(_ p: UnsafeMutableBufferPointer) { + let f: (UnsafeMutableBufferPointer) -> Void = simple + f(p) +} + @inlinable public func callSimpleFlipped(_ p: UnsafeMutableBufferPointer) { simpleFlipped(p) @@ -88,4 +100,4 @@ public func callSimpleFlipped(_ p: UnsafeMutableBufferPointer) { @inlinable public func callSwiftAttr(_ p: UnsafeMutableBufferPointer) { swiftAttr(p) -} +} \ No newline at end of file diff --git a/test/Interop/C/swiftify-import/sized-by-noescape.swift b/test/Interop/C/swiftify-import/sized-by-noescape.swift index c2ff0a5647b3a..82b78dddfa3ed 100644 --- a/test/Interop/C/swiftify-import/sized-by-noescape.swift +++ b/test/Interop/C/swiftify-import/sized-by-noescape.swift @@ -10,22 +10,22 @@ import SizedByNoEscapeClang // CHECK: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) -// CHECK-NEXT: @_alwaysEmitIntoClient public func complexExpr(_ len: Int{{.*}}, _ offset: Int{{.*}}, _ p: RawSpan) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func complexExpr(_ len: Int{{.*}}, _ offset: Int{{.*}}, _ p: RawSpan) // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) -// CHECK-NEXT: @_alwaysEmitIntoClient public func nonnull(_ p: RawSpan) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func nonnull(_ p: RawSpan) // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) -// CHECK-NEXT: @_alwaysEmitIntoClient public func nullUnspecified(_ p: RawSpan) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func nullUnspecified(_ p: RawSpan) // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) -// CHECK-NEXT: @_alwaysEmitIntoClient public func nullable(_ p: RawSpan?) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func nullable(_ p: RawSpan?) // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) -// CHECK-NEXT: @_alwaysEmitIntoClient public func opaque(_ p: RawSpan) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func opaque(_ p: RawSpan) // CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func returnPointer(_ len: Int{{.*}}) -> UnsafeRawBufferPointer // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) -// CHECK-NEXT: @_alwaysEmitIntoClient public func shared(_ len: Int{{.*}}, _ p1: RawSpan, _ p2: RawSpan) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func shared(_ len: Int{{.*}}, _ p1: RawSpan, _ p2: RawSpan) // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) -// CHECK-NEXT: @_alwaysEmitIntoClient public func simple(_ p: RawSpan) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func simple(_ p: RawSpan) // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) -// CHECK-NEXT: @_alwaysEmitIntoClient public func swiftAttr(_ p: RawSpan) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func swiftAttr(_ p: RawSpan) @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) @inlinable diff --git a/test/Interop/C/swiftify-import/sized-by.swift b/test/Interop/C/swiftify-import/sized-by.swift index b9435f2d89ab9..70bc98634ab5c 100644 --- a/test/Interop/C/swiftify-import/sized-by.swift +++ b/test/Interop/C/swiftify-import/sized-by.swift @@ -9,15 +9,15 @@ // Check that ClangImporter correctly infers and expands @_SwiftifyImport macros for functions with __sized_by parameters. import SizedByClang -// CHECK: @_alwaysEmitIntoClient public func complexExpr(_ len: Int{{.*}}, _ offset: Int{{.*}}, _ p: UnsafeMutableRawBufferPointer) -// CHECK-NEXT: @_alwaysEmitIntoClient public func nonnull(_ p: UnsafeMutableRawBufferPointer) -// CHECK-NEXT: @_alwaysEmitIntoClient public func nullUnspecified(_ p: UnsafeMutableRawBufferPointer) -// CHECK-NEXT: @_alwaysEmitIntoClient public func nullable(_ p: UnsafeMutableRawBufferPointer?) -// CHECK-NEXT: @_alwaysEmitIntoClient public func opaque(_ p: UnsafeRawBufferPointer) +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload public func complexExpr(_ len: Int{{.*}}, _ offset: Int{{.*}}, _ p: UnsafeMutableRawBufferPointer) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func nonnull(_ p: UnsafeMutableRawBufferPointer) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func nullUnspecified(_ p: UnsafeMutableRawBufferPointer) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func nullable(_ p: UnsafeMutableRawBufferPointer?) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func opaque(_ p: UnsafeRawBufferPointer) // CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func returnPointer(_ len: Int{{.*}}) -> UnsafeMutableRawBufferPointer -// CHECK-NEXT: @_alwaysEmitIntoClient public func shared(_ len: Int{{.*}}, _ p1: UnsafeMutableRawBufferPointer, _ p2: UnsafeMutableRawBufferPointer) -// CHECK-NEXT: @_alwaysEmitIntoClient public func simple(_ p: UnsafeMutableRawBufferPointer) -// CHECK-NEXT: @_alwaysEmitIntoClient public func swiftAttr(_ p: UnsafeMutableRawBufferPointer) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func shared(_ len: Int{{.*}}, _ p1: UnsafeMutableRawBufferPointer, _ p2: UnsafeMutableRawBufferPointer) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func simple(_ p: UnsafeMutableRawBufferPointer) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func swiftAttr(_ p: UnsafeMutableRawBufferPointer) @inlinable public func callComplexExpr(_ p: UnsafeMutableRawBufferPointer) { diff --git a/test/Interop/Cxx/stdlib/std-span-interface.swift b/test/Interop/Cxx/stdlib/std-span-interface.swift index 9a9f761a708f1..e55b37d22c491 100644 --- a/test/Interop/Cxx/stdlib/std-span-interface.swift +++ b/test/Interop/Cxx/stdlib/std-span-interface.swift @@ -24,7 +24,7 @@ import CxxStdlib // CHECK: struct X { // CHECK-NEXT: init() // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) -// CHECK-NEXT: @_alwaysEmitIntoClient public mutating func methodWithSafeWrapper(_ s: Span) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public mutating func methodWithSafeWrapper(_ s: Span) // CHECK-NEXT: mutating func methodWithSafeWrapper(_ s: ConstSpanOfInt) // CHECK-NEXT: } // CHECK: struct SpanWithoutTypeAlias { @@ -34,59 +34,59 @@ import CxxStdlib // CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public mutating func bar() -> Span // CHECK-NEXT: mutating func bar() -> std.{{.*}}span<__cxxConst, _C{{.*}}_{{.*}}> // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) -// CHECK-NEXT: @_alwaysEmitIntoClient public mutating func foo(_ s: Span) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public mutating func foo(_ s: Span) // CHECK-NEXT: mutating func foo(_ s: std.{{.*}}span<__cxxConst, _C{{.*}}_{{.*}}>) // CHECK-NEXT: } // CHECK: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) // CHECK-NEXT: @lifetime(s: copy s) -// CHECK-NEXT: @_alwaysEmitIntoClient public func FuncWithMutableSafeWrapper(_ s: inout MutableSpan) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func FuncWithMutableSafeWrapper(_ s: inout MutableSpan) // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) // CHECK-NEXT: @lifetime(copy s) // CHECK-NEXT: @lifetime(s: copy s) -// CHECK-NEXT: @_alwaysEmitIntoClient public func FuncWithMutableSafeWrapper2(_ s: inout MutableSpan) -> MutableSpan +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func FuncWithMutableSafeWrapper2(_ s: inout MutableSpan) -> MutableSpan // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) // CHECK-NEXT: @lifetime(borrow v) // CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func FuncWithMutableSafeWrapper3(_ v: inout VecOfInt) -> MutableSpan // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) // CHECK-NEXT: @lifetime(copy p) // CHECK-NEXT: @lifetime(p: copy p) -// CHECK-NEXT: @_alwaysEmitIntoClient public func MixedFuncWithMutableSafeWrapper1(_ p: inout MutableSpan) -> MutableSpan +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func MixedFuncWithMutableSafeWrapper1(_ p: inout MutableSpan) -> MutableSpan // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) // CHECK-NEXT: @lifetime(borrow v) // CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func MixedFuncWithMutableSafeWrapper2(_ v: inout VecOfInt, _ len: Int32) -> MutableSpan // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) // CHECK-NEXT: @lifetime(s: copy s) -// CHECK-NEXT: @_alwaysEmitIntoClient public func MixedFuncWithMutableSafeWrapper3(_ s: inout MutableSpan, _ p: UnsafeMutableBufferPointer) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func MixedFuncWithMutableSafeWrapper3(_ s: inout MutableSpan, _ p: UnsafeMutableBufferPointer) // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) // CHECK-NEXT: @lifetime(s: copy s) // CHECK-NEXT: @lifetime(p: copy p) -// CHECK-NEXT: @_alwaysEmitIntoClient public func MixedFuncWithMutableSafeWrapper4(_ s: inout MutableSpan, _ p: inout MutableSpan) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func MixedFuncWithMutableSafeWrapper4(_ s: inout MutableSpan, _ p: inout MutableSpan) // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) // CHECK-NEXT: @lifetime(p: copy p) -// CHECK-NEXT: @_alwaysEmitIntoClient public func MixedFuncWithMutableSafeWrapper5(_ s: SpanOfInt, _ p: inout MutableSpan) -// CHECK-NEXT: @_alwaysEmitIntoClient public func MixedFuncWithMutableSafeWrapper6(_ s: SpanOfInt, _ p: UnsafeMutableBufferPointer) -// CHECK-NEXT: @_alwaysEmitIntoClient public func MixedFuncWithMutableSafeWrapper7(_ p: UnsafeMutableBufferPointer) -> SpanOfInt +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func MixedFuncWithMutableSafeWrapper5(_ s: SpanOfInt, _ p: inout MutableSpan) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func MixedFuncWithMutableSafeWrapper6(_ s: SpanOfInt, _ p: UnsafeMutableBufferPointer) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func MixedFuncWithMutableSafeWrapper7(_ p: UnsafeMutableBufferPointer) -> SpanOfInt // CHECK: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) -// CHECK-NEXT: @_alwaysEmitIntoClient public func funcWithSafeWrapper(_ s: Span) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func funcWithSafeWrapper(_ s: Span) // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) // CHECK-NEXT: @lifetime(copy s) -// CHECK-NEXT: @_alwaysEmitIntoClient public func funcWithSafeWrapper2(_ s: Span) -> Span +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func funcWithSafeWrapper2(_ s: Span) -> Span // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) // CHECK-NEXT: @lifetime(borrow v) // CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func funcWithSafeWrapper3(_ v: borrowing VecOfInt) -> Span // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) // CHECK-NEXT: @lifetime(copy p) -// CHECK-NEXT: @_alwaysEmitIntoClient public func mixedFuncWithSafeWrapper1(_ p: Span) -> Span +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func mixedFuncWithSafeWrapper1(_ p: Span) -> Span // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) // CHECK-NEXT: @lifetime(borrow v) // CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func mixedFuncWithSafeWrapper2(_ v: borrowing VecOfInt, _ len: Int32) -> Span // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) -// CHECK-NEXT: @_alwaysEmitIntoClient public func mixedFuncWithSafeWrapper3(_ s: Span, _ p: UnsafeMutableBufferPointer) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func mixedFuncWithSafeWrapper3(_ s: Span, _ p: UnsafeMutableBufferPointer) // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) -// CHECK-NEXT: @_alwaysEmitIntoClient public func mixedFuncWithSafeWrapper4(_ s: Span, _ p: Span) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func mixedFuncWithSafeWrapper4(_ s: Span, _ p: Span) // CHECK-NEXT: @available(visionOS 1.1, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) -// CHECK-NEXT: @_alwaysEmitIntoClient public func mixedFuncWithSafeWrapper5(_ s: ConstSpanOfInt, _ p: Span) -// CHECK-NEXT: @_alwaysEmitIntoClient public func mixedFuncWithSafeWrapper6(_ s: ConstSpanOfInt, _ p: UnsafeMutableBufferPointer) -// CHECK-NEXT: @_alwaysEmitIntoClient public func mixedFuncWithSafeWrapper7(_ p: UnsafeBufferPointer) -> ConstSpanOfInt +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func mixedFuncWithSafeWrapper5(_ s: ConstSpanOfInt, _ p: Span) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func mixedFuncWithSafeWrapper6(_ s: ConstSpanOfInt, _ p: UnsafeMutableBufferPointer) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func mixedFuncWithSafeWrapper7(_ p: UnsafeBufferPointer) -> ConstSpanOfInt diff --git a/test/Macros/SwiftifyImport/CountedBy/Anonymous.swift b/test/Macros/SwiftifyImport/CountedBy/Anonymous.swift index 8ee47af046761..7d8c00acbed7f 100644 --- a/test/Macros/SwiftifyImport/CountedBy/Anonymous.swift +++ b/test/Macros/SwiftifyImport/CountedBy/Anonymous.swift @@ -18,24 +18,24 @@ public func myFunc3(_: UnsafePointer, _ len: CInt) { public func myFunc4(_: UnsafeMutablePointer, _ len: CInt) { } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: public func myFunc(_ _param0: UnsafeBufferPointer) { // CHECK-NEXT: return unsafe myFunc(_param0.baseAddress!, CInt(exactly: _param0.count)!) // CHECK-NEXT: } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: public func myFunc2(_ p: UnsafeBufferPointer, _ _param2: CInt) { // CHECK-NEXT: return unsafe myFunc2(p.baseAddress!, CInt(exactly: p.count)!, _param2) // CHECK-NEXT: } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: public func myFunc3(_ _param0: Span) { // CHECK-NEXT: return unsafe _param0.withUnsafeBufferPointer { __param0Ptr in // CHECK-NEXT: return unsafe myFunc3(__param0Ptr.baseAddress!, CInt(exactly: __param0Ptr.count)!) // CHECK-NEXT: } // CHECK-NEXT: } -// CHECK: @_alwaysEmitIntoClient @lifetime(_param0: copy _param0) +// CHECK: @_alwaysEmitIntoClient @lifetime(_param0: copy _param0) @_disfavoredOverload // CHECK-NEXT: public func myFunc4(_ _param0: inout MutableSpan) { // CHECK-NEXT: return unsafe _param0.withUnsafeMutableBufferPointer { __param0Ptr in // CHECK-NEXT: return unsafe myFunc4(__param0Ptr.baseAddress!, CInt(exactly: __param0Ptr.count)!) diff --git a/test/Macros/SwiftifyImport/CountedBy/CountExpr.swift b/test/Macros/SwiftifyImport/CountedBy/CountExpr.swift index 92fe4889bdad1..066fde74e5edd 100644 --- a/test/Macros/SwiftifyImport/CountedBy/CountExpr.swift +++ b/test/Macros/SwiftifyImport/CountedBy/CountExpr.swift @@ -6,7 +6,7 @@ func myFunc(_ ptr: UnsafePointer, _ size: CInt, _ count: CInt) { } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func myFunc(_ ptr: UnsafeBufferPointer, _ size: CInt, _ count: CInt) { // CHECK-NEXT: let _ptrCount: some BinaryInteger = size * count // CHECK-NEXT: if ptr.count < _ptrCount || _ptrCount < 0 { diff --git a/test/Macros/SwiftifyImport/CountedBy/MultipleParams.swift b/test/Macros/SwiftifyImport/CountedBy/MultipleParams.swift index 6ad7bf0cc7824..884456407fd13 100644 --- a/test/Macros/SwiftifyImport/CountedBy/MultipleParams.swift +++ b/test/Macros/SwiftifyImport/CountedBy/MultipleParams.swift @@ -6,7 +6,7 @@ func myFunc(_ ptr: UnsafePointer, _ len: CInt, _ ptr2: UnsafePointer, _ len2: CInt) { } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func myFunc(_ ptr: UnsafeBufferPointer, _ ptr2: UnsafeBufferPointer) { // CHECK-NEXT: return unsafe myFunc(ptr.baseAddress!, CInt(exactly: ptr.count)!, ptr2.baseAddress!, CInt(exactly: ptr2.count)!) // CHECK-NEXT: } diff --git a/test/Macros/SwiftifyImport/CountedBy/Mutable.swift b/test/Macros/SwiftifyImport/CountedBy/Mutable.swift index 1df1df1329115..0154b947dcbb5 100644 --- a/test/Macros/SwiftifyImport/CountedBy/Mutable.swift +++ b/test/Macros/SwiftifyImport/CountedBy/Mutable.swift @@ -6,7 +6,7 @@ func myFunc(_ ptr: UnsafeMutablePointer, _ len: CInt) { } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func myFunc(_ ptr: UnsafeMutableBufferPointer) { // CHECK-NEXT: return unsafe myFunc(ptr.baseAddress!, CInt(exactly: ptr.count)!) // CHECK-NEXT: } diff --git a/test/Macros/SwiftifyImport/CountedBy/MutableSpan.swift b/test/Macros/SwiftifyImport/CountedBy/MutableSpan.swift index 62d4612f10fbc..184e18ce27b48 100644 --- a/test/Macros/SwiftifyImport/CountedBy/MutableSpan.swift +++ b/test/Macros/SwiftifyImport/CountedBy/MutableSpan.swift @@ -7,7 +7,7 @@ func myFunc(_ ptr: UnsafeMutablePointer, _ len: CInt) { } -// CHECK: @_alwaysEmitIntoClient @lifetime(ptr: copy ptr) +// CHECK: @_alwaysEmitIntoClient @lifetime(ptr: copy ptr) @_disfavoredOverload // CHECK-NEXT: func myFunc(_ ptr: inout MutableSpan) { // CHECK-NEXT: return unsafe ptr.withUnsafeMutableBufferPointer { _ptrPtr in // CHECK-NEXT: return unsafe myFunc(_ptrPtr.baseAddress!, CInt(exactly: _ptrPtr.count)!) diff --git a/test/Macros/SwiftifyImport/CountedBy/NamedParams.swift b/test/Macros/SwiftifyImport/CountedBy/NamedParams.swift index 6e450b8afa124..04b77ae64097c 100644 --- a/test/Macros/SwiftifyImport/CountedBy/NamedParams.swift +++ b/test/Macros/SwiftifyImport/CountedBy/NamedParams.swift @@ -26,32 +26,32 @@ func allNamed(ptr: UnsafePointer, len: CInt) { func allNamedOther(buf ptr: UnsafePointer, count len: CInt) { } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func ptrNamed(ptr: UnsafeBufferPointer) { // CHECK-NEXT: return unsafe ptrNamed(ptr: ptr.baseAddress!, CInt(exactly: ptr.count)!) // CHECK-NEXT: } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func ptrNamedOther(buf ptr: UnsafeBufferPointer) { // CHECK-NEXT: return unsafe ptrNamedOther(buf: ptr.baseAddress!, CInt(exactly: ptr.count)!) // CHECK-NEXT: } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func lenNamed(_ ptr: UnsafeBufferPointer) { // CHECK-NEXT: return unsafe lenNamed(ptr.baseAddress!, len: CInt(exactly: ptr.count)!) // CHECK-NEXT: } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func lenNamedOther(_ ptr: UnsafeBufferPointer) { // CHECK-NEXT: return unsafe lenNamedOther(ptr.baseAddress!, count: CInt(exactly: ptr.count)!) // CHECK-NEXT: } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func allNamed(ptr: UnsafeBufferPointer) { // CHECK-NEXT: return unsafe allNamed(ptr: ptr.baseAddress!, len: CInt(exactly: ptr.count)!) // CHECK-NEXT: } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func allNamedOther(buf ptr: UnsafeBufferPointer) { // CHECK-NEXT: return unsafe allNamedOther(buf: ptr.baseAddress!, count: CInt(exactly: ptr.count)!) // CHECK-NEXT: } diff --git a/test/Macros/SwiftifyImport/CountedBy/Nullable.swift b/test/Macros/SwiftifyImport/CountedBy/Nullable.swift index 590b23d3a4652..c40f5efb0d093 100644 --- a/test/Macros/SwiftifyImport/CountedBy/Nullable.swift +++ b/test/Macros/SwiftifyImport/CountedBy/Nullable.swift @@ -18,12 +18,12 @@ func myFunc3(_ ptr: UnsafeMutablePointer?, _ len: CInt, _ ptr2: UnsafeMuta func myFunc4(_ ptr: UnsafeMutablePointer?, _ len: CInt) -> UnsafeMutablePointer? { } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func myFunc(_ ptr: UnsafeBufferPointer?) { // CHECK-NEXT: return unsafe myFunc(ptr?.baseAddress, CInt(exactly: ptr?.count ?? 0)!) // CHECK-NEXT: } -// CHECK: @_alwaysEmitIntoClient @lifetime(ptr: copy ptr) +// CHECK: @_alwaysEmitIntoClient @lifetime(ptr: copy ptr) @_disfavoredOverload // CHECK-NEXT: func myFunc2(_ ptr: inout MutableSpan?) { // CHECK-NEXT: return { () in // CHECK-NEXT: return if ptr == nil { @@ -36,7 +36,7 @@ func myFunc4(_ ptr: UnsafeMutablePointer?, _ len: CInt) -> UnsafeMutablePo // CHECK-NEXT: }() // CHECK-NEXT: } -// CHECK: @_alwaysEmitIntoClient @lifetime(ptr: copy ptr) @lifetime(ptr2: copy ptr2) +// CHECK: @_alwaysEmitIntoClient @lifetime(ptr: copy ptr) @lifetime(ptr2: copy ptr2) @_disfavoredOverload // CHECK-NEXT: func myFunc3(_ ptr: inout MutableSpan?, _ ptr2: inout MutableSpan?) { // CHECK-NEXT: return { () in // CHECK-NEXT: return if ptr2 == nil { @@ -65,7 +65,7 @@ func myFunc4(_ ptr: UnsafeMutablePointer?, _ len: CInt) -> UnsafeMutablePo // CHECK-NEXT: }() // CHECK-NEXT: } -// CHECK: @_alwaysEmitIntoClient @lifetime(copy ptr) @lifetime(ptr: copy ptr) +// CHECK: @_alwaysEmitIntoClient @lifetime(copy ptr) @lifetime(ptr: copy ptr) @_disfavoredOverload // CHECK-NEXT: func myFunc4(_ ptr: inout MutableSpan?, _ len: CInt) -> MutableSpan? { // CHECK-NEXT: let _ptrCount: some BinaryInteger = len // CHECK-NEXT: if ptr?.count ?? 0 < _ptrCount || _ptrCount < 0 { diff --git a/test/Macros/SwiftifyImport/CountedBy/PointerReturn.swift b/test/Macros/SwiftifyImport/CountedBy/PointerReturn.swift index 260486de4e785..6c59879fe9e54 100644 --- a/test/Macros/SwiftifyImport/CountedBy/PointerReturn.swift +++ b/test/Macros/SwiftifyImport/CountedBy/PointerReturn.swift @@ -28,14 +28,14 @@ func lifetimeDependentBorrow(_ p: borrowing UnsafePointer, _ len1: CInt, _ // CHECK-NEXT: func nonEscaping(_ len: CInt) -> UnsafeBufferPointer { // CHECK-NEXT: return unsafe UnsafeBufferPointer (start: unsafe nonEscaping(len), count: Int(len)) -// CHECK: @_alwaysEmitIntoClient @lifetime(copy p) +// CHECK: @_alwaysEmitIntoClient @lifetime(copy p) @_disfavoredOverload // CHECK-NEXT: func lifetimeDependentCopy(_ p: Span, _ len2: CInt) -> Span { // CHECK-NEXT: return unsafe _swiftifyOverrideLifetime(Span (_unsafeStart: unsafe p.withUnsafeBufferPointer { _pPtr in // CHECK-NEXT: return unsafe lifetimeDependentCopy(_pPtr.baseAddress!, CInt(exactly: _pPtr.count)!, len2) // CHECK-NEXT: }, count: Int(len2)), copying: ()) // CHECK-NEXT: } -// CHECK: @_alwaysEmitIntoClient @lifetime(borrow p) +// CHECK: @_alwaysEmitIntoClient @lifetime(borrow p) @_disfavoredOverload // CHECK-NEXT: func lifetimeDependentBorrow(_ p: borrowing UnsafeBufferPointer, _ len2: CInt) -> Span { // CHECK-NEXT: return unsafe _swiftifyOverrideLifetime(Span (_unsafeStart: unsafe lifetimeDependentBorrow(p.baseAddress!, CInt(exactly: p.count)!, len2), count: Int(len2)), copying: ()) // CHECK-NEXT: } diff --git a/test/Macros/SwiftifyImport/CountedBy/QualifiedTypes.swift b/test/Macros/SwiftifyImport/CountedBy/QualifiedTypes.swift index 3a7139e92f133..4852fa0f3a9a8 100644 --- a/test/Macros/SwiftifyImport/CountedBy/QualifiedTypes.swift +++ b/test/Macros/SwiftifyImport/CountedBy/QualifiedTypes.swift @@ -10,12 +10,12 @@ func foo(_ ptr: Swift.UnsafePointer, _ len: Swift.Int) -> Swift.Void func bar(_ ptr: Swift.UnsafePointer, _ len: Swift.Int) -> () { } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func foo(_ ptr: Swift.UnsafeBufferPointer) -> Swift.Void { // CHECK-NEXT: return unsafe foo(ptr.baseAddress!, ptr.count) // CHECK-NEXT: } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func bar(_ ptr: Swift.UnsafeBufferPointer) -> () { // CHECK-NEXT: return unsafe bar(ptr.baseAddress!, ptr.count) // CHECK-NEXT: } diff --git a/test/Macros/SwiftifyImport/CountedBy/Return.swift b/test/Macros/SwiftifyImport/CountedBy/Return.swift index ceebe3e43ac81..f2925528696ac 100644 --- a/test/Macros/SwiftifyImport/CountedBy/Return.swift +++ b/test/Macros/SwiftifyImport/CountedBy/Return.swift @@ -6,7 +6,7 @@ func myFunc(_ ptr: UnsafePointer, _ len: CInt) -> CInt { } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func myFunc(_ ptr: UnsafeBufferPointer) -> CInt { // CHECK-NEXT: return unsafe myFunc(ptr.baseAddress!, CInt(exactly: ptr.count)!) // CHECK-NEXT: } diff --git a/test/Macros/SwiftifyImport/CountedBy/SharedCount.swift b/test/Macros/SwiftifyImport/CountedBy/SharedCount.swift index 71a084acb6f71..8e4e7f459b1ed 100644 --- a/test/Macros/SwiftifyImport/CountedBy/SharedCount.swift +++ b/test/Macros/SwiftifyImport/CountedBy/SharedCount.swift @@ -6,7 +6,7 @@ func myFunc(_ ptr: UnsafePointer, _ ptr2: UnsafePointer, _ len: CInt) { } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func myFunc(_ ptr: UnsafeBufferPointer, _ ptr2: UnsafeBufferPointer, _ len: CInt) { // CHECK-NEXT: let _ptrCount: some BinaryInteger = len // CHECK-NEXT: if ptr.count < _ptrCount || _ptrCount < 0 { diff --git a/test/Macros/SwiftifyImport/CountedBy/SimpleCount.swift b/test/Macros/SwiftifyImport/CountedBy/SimpleCount.swift index 3f252815fc557..66ae52203f0b9 100644 --- a/test/Macros/SwiftifyImport/CountedBy/SimpleCount.swift +++ b/test/Macros/SwiftifyImport/CountedBy/SimpleCount.swift @@ -6,7 +6,7 @@ func myFunc(_ ptr: UnsafePointer, _ len: CInt) { } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func myFunc(_ ptr: UnsafeBufferPointer) { // CHECK-NEXT: return unsafe myFunc(ptr.baseAddress!, CInt(exactly: ptr.count)!) // CHECK-NEXT: } diff --git a/test/Macros/SwiftifyImport/CountedBy/SimpleSpan.swift b/test/Macros/SwiftifyImport/CountedBy/SimpleSpan.swift index 59635e7ccf8a7..a0a3b310bf7da 100644 --- a/test/Macros/SwiftifyImport/CountedBy/SimpleSpan.swift +++ b/test/Macros/SwiftifyImport/CountedBy/SimpleSpan.swift @@ -7,7 +7,7 @@ func myFunc(_ ptr: UnsafePointer, _ len: CInt) { } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func myFunc(_ ptr: Span) { // CHECK-NEXT: return unsafe ptr.withUnsafeBufferPointer { _ptrPtr in // CHECK-NEXT: return unsafe myFunc(_ptrPtr.baseAddress!, CInt(exactly: _ptrPtr.count)!) diff --git a/test/Macros/SwiftifyImport/CountedBy/SimpleSpanWithReturn.swift b/test/Macros/SwiftifyImport/CountedBy/SimpleSpanWithReturn.swift index b4f5a9ae40d06..c9ac1c88d48e9 100644 --- a/test/Macros/SwiftifyImport/CountedBy/SimpleSpanWithReturn.swift +++ b/test/Macros/SwiftifyImport/CountedBy/SimpleSpanWithReturn.swift @@ -7,7 +7,7 @@ func myFunc(_ ptr: UnsafePointer, _ len: CInt) -> CInt { } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func myFunc(_ ptr: Span) -> CInt { // CHECK-NEXT: return unsafe ptr.withUnsafeBufferPointer { _ptrPtr in // CHECK-NEXT: return unsafe myFunc(_ptrPtr.baseAddress!, CInt(exactly: _ptrPtr.count)!) diff --git a/test/Macros/SwiftifyImport/CountedBy/SpanAndUnsafeBuffer.swift b/test/Macros/SwiftifyImport/CountedBy/SpanAndUnsafeBuffer.swift index 09fa7f41de45c..d314bae3cdd70 100644 --- a/test/Macros/SwiftifyImport/CountedBy/SpanAndUnsafeBuffer.swift +++ b/test/Macros/SwiftifyImport/CountedBy/SpanAndUnsafeBuffer.swift @@ -8,7 +8,7 @@ func myFunc(_ ptr1: UnsafePointer, _ len1: CInt, _ ptr2: UnsafePointer, _ len2: CInt) { } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func myFunc(_ ptr1: Span, _ ptr2: UnsafeBufferPointer) { // CHECK-NEXT: return unsafe ptr1.withUnsafeBufferPointer { _ptr1Ptr in // CHECK-NEXT: return unsafe myFunc(_ptr1Ptr.baseAddress!, CInt(exactly: _ptr1Ptr.count)!, ptr2.baseAddress!, CInt(exactly: ptr2.count)!) diff --git a/test/Macros/SwiftifyImport/CountedBy/Unwrapped.swift b/test/Macros/SwiftifyImport/CountedBy/Unwrapped.swift index 8677adf97a741..1b211b864ae67 100644 --- a/test/Macros/SwiftifyImport/CountedBy/Unwrapped.swift +++ b/test/Macros/SwiftifyImport/CountedBy/Unwrapped.swift @@ -6,7 +6,7 @@ func myFunc(_ ptr: UnsafePointer!, _ len: CInt) { } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func myFunc(_ ptr: UnsafeBufferPointer) { // CHECK-NEXT: return unsafe myFunc(ptr.baseAddress!, CInt(exactly: ptr.count)!) // CHECK-NEXT: } diff --git a/test/Macros/SwiftifyImport/CxxSpan/LifetimeboundSpan.swift b/test/Macros/SwiftifyImport/CxxSpan/LifetimeboundSpan.swift index 5c680129eb306..71c469bf855b7 100644 --- a/test/Macros/SwiftifyImport/CxxSpan/LifetimeboundSpan.swift +++ b/test/Macros/SwiftifyImport/CxxSpan/LifetimeboundSpan.swift @@ -57,7 +57,7 @@ func myFunc8(_ ptr: UnsafeRawPointer, _ span: SpanOfInt, _ count: CInt, _ size: func myFunc9(_ span: MutableSpanOfInt) -> MutableSpanOfInt { } -// CHECK: @_alwaysEmitIntoClient @lifetime(copy span) +// CHECK: @_alwaysEmitIntoClient @lifetime(copy span) @_disfavoredOverload // CHECK-NEXT: func myFunc(_ span: Span) -> Span { // CHECK-NEXT: return unsafe _swiftifyOverrideLifetime(Span(_unsafeCxxSpan: unsafe myFunc(SpanOfInt(span))), copying: ()) // CHECK-NEXT: } @@ -67,12 +67,12 @@ func myFunc9(_ span: MutableSpanOfInt) -> MutableSpanOfInt { // CHECK-NEXT: return unsafe _swiftifyOverrideLifetime(Span(_unsafeCxxSpan: unsafe myFunc2(vec)), copying: ()) // CHECK-NEXT: } -// CHECK: @_alwaysEmitIntoClient @lifetime(copy span1, copy span2) +// CHECK: @_alwaysEmitIntoClient @lifetime(copy span1, copy span2) @_disfavoredOverload // CHECK-NEXT: func myFunc3(_ span1: Span, _ span2: Span) -> Span { // CHECK-NEXT: return unsafe _swiftifyOverrideLifetime(Span(_unsafeCxxSpan: unsafe myFunc3(SpanOfInt(span1), SpanOfInt(span2))), copying: ()) // CHECK-NEXT: } -// CHECK: @_alwaysEmitIntoClient @lifetime(borrow vec, copy span) +// CHECK: @_alwaysEmitIntoClient @lifetime(borrow vec, copy span) @_disfavoredOverload // CHECK-NEXT: func myFunc4(_ vec: borrowing VecOfInt, _ span: Span) -> Span { // CHECK-NEXT: return unsafe _swiftifyOverrideLifetime(Span(_unsafeCxxSpan: unsafe myFunc4(vec, SpanOfInt(span))), copying: ()) // CHECK-NEXT: } @@ -82,7 +82,7 @@ func myFunc9(_ span: MutableSpanOfInt) -> MutableSpanOfInt { // CHECK-NEXT: return unsafe _swiftifyOverrideLifetime(Span(_unsafeCxxSpan: unsafe myFunc5()), copying: ()) // CHECK-NEXT: } -// CHECK: @_alwaysEmitIntoClient @lifetime(copy span) +// CHECK: @_alwaysEmitIntoClient @lifetime(copy span) @_disfavoredOverload // CHECK-NEXT: func myFunc6(_ span: Span, _ ptr: RawSpan, _ count: CInt, _ size: CInt) -> Span { // CHECK-NEXT: let _ptrCount: some BinaryInteger = count * size // CHECK-NEXT: if ptr.byteCount < _ptrCount || _ptrCount < 0 { @@ -93,7 +93,7 @@ func myFunc9(_ span: MutableSpanOfInt) -> MutableSpanOfInt { // CHECK-NEXT: }), copying: ()) // CHECK-NEXT: } -// CHECK: @_alwaysEmitIntoClient @lifetime(copy span) +// CHECK: @_alwaysEmitIntoClient @lifetime(copy span) @_disfavoredOverload // CHECK-NEXT: func myFunc7(_ span: Span, _ ptr: RawSpan, _ count: CInt, _ size: CInt) -> Span { // CHECK-NEXT: let _ptrCount: some BinaryInteger = count * size // CHECK-NEXT: if ptr.byteCount < _ptrCount || _ptrCount < 0 { @@ -104,7 +104,7 @@ func myFunc9(_ span: MutableSpanOfInt) -> MutableSpanOfInt { // CHECK-NEXT: }), copying: ()) // CHECK-NEXT: } -// CHECK: @_alwaysEmitIntoClient @lifetime(copy span) +// CHECK: @_alwaysEmitIntoClient @lifetime(copy span) @_disfavoredOverload // CHECK-NEXT: func myFunc8(_ ptr: RawSpan, _ span: Span, _ count: CInt, _ size: CInt) -> Span { // CHECK-NEXT: let _ptrCount: some BinaryInteger = count * size // CHECK-NEXT: if ptr.byteCount < _ptrCount || _ptrCount < 0 { @@ -115,7 +115,7 @@ func myFunc9(_ span: MutableSpanOfInt) -> MutableSpanOfInt { // CHECK-NEXT: }), copying: ()) // CHECK-NEXT: } -// CHECK: @_alwaysEmitIntoClient @lifetime(copy span) @lifetime(span: copy span) +// CHECK: @_alwaysEmitIntoClient @lifetime(copy span) @lifetime(span: copy span) @_disfavoredOverload // CHECK-NEXT: func myFunc9(_ span: inout MutableSpan) -> MutableSpan { // CHECK-NEXT: return unsafe _swiftifyOverrideLifetime(MutableSpan(_unsafeCxxSpan: unsafe span.withUnsafeMutableBufferPointer { _spanPtr in // CHECK-NEXT: return unsafe myFunc9(MutableSpanOfInt(_spanPtr)) diff --git a/test/Macros/SwiftifyImport/CxxSpan/NoEscapeSpan.swift b/test/Macros/SwiftifyImport/CxxSpan/NoEscapeSpan.swift index 84474ac42795c..6093902b4f716 100644 --- a/test/Macros/SwiftifyImport/CxxSpan/NoEscapeSpan.swift +++ b/test/Macros/SwiftifyImport/CxxSpan/NoEscapeSpan.swift @@ -25,26 +25,26 @@ func myFunc3(_ span: MutableSpanOfInt, _ secondSpan: SpanOfInt) { func myFunc4(_ span: MutableSpanOfInt, _ secondSpan: MutableSpanOfInt) { } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func myFunc(_ span: Span, _ secondSpan: SpanOfInt) { // CHECK-NEXT: return unsafe myFunc(SpanOfInt(span), secondSpan) // CHECK-NEXT: } -// CHECK: @_alwaysEmitIntoClient @lifetime(span: copy span) +// CHECK: @_alwaysEmitIntoClient @lifetime(span: copy span) @_disfavoredOverload // CHECK-NEXT: func myFunc2(_ span: inout MutableSpan, _ secondSpan: MutableSpanOfInt) { // CHECK-NEXT: return unsafe span.withUnsafeMutableBufferPointer { _spanPtr in // CHECK-NEXT: return unsafe myFunc2(MutableSpanOfInt(_spanPtr), secondSpan) // CHECK-NEXT: } // CHECK-NEXT: } -// CHECK: @_alwaysEmitIntoClient @lifetime(span: copy span) +// CHECK: @_alwaysEmitIntoClient @lifetime(span: copy span) @_disfavoredOverload // CHECK-NEXT: func myFunc3(_ span: inout MutableSpan, _ secondSpan: Span) { // CHECK-NEXT: return unsafe span.withUnsafeMutableBufferPointer { _spanPtr in // CHECK-NEXT: return unsafe myFunc3(MutableSpanOfInt(_spanPtr), SpanOfInt(secondSpan)) // CHECK-NEXT: } // CHECK-NEXT: } -// CHECK: @_alwaysEmitIntoClient @lifetime(span: copy span) @lifetime(secondSpan: copy secondSpan) +// CHECK: @_alwaysEmitIntoClient @lifetime(span: copy span) @lifetime(secondSpan: copy secondSpan) @_disfavoredOverload // CHECK-NEXT: func myFunc4(_ span: inout MutableSpan, _ secondSpan: inout MutableSpan) { // CHECK-NEXT: return unsafe secondSpan.withUnsafeMutableBufferPointer { _secondSpanPtr in // CHECK-NEXT: return unsafe span.withUnsafeMutableBufferPointer { _spanPtr in diff --git a/test/Macros/SwiftifyImport/MacroErrors/UnexpectedCountType.swift b/test/Macros/SwiftifyImport/MacroErrors/UnexpectedCountType.swift index 6a230425c477c..5042895b4b2a3 100644 --- a/test/Macros/SwiftifyImport/MacroErrors/UnexpectedCountType.swift +++ b/test/Macros/SwiftifyImport/MacroErrors/UnexpectedCountType.swift @@ -9,7 +9,7 @@ func myFunc(_ ptr: UnsafePointer, _ len: String) { } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func myFunc(_ ptr: UnsafeBufferPointer) { // CHECK-NEXT: myFunc(ptr.baseAddress!, String(exactly: ptr.count)!) // CHECK-NEXT: } diff --git a/test/Macros/SwiftifyImport/SizedBy/MultipleParams.swift b/test/Macros/SwiftifyImport/SizedBy/MultipleParams.swift index 912c9dbcd8822..b11e50781599e 100644 --- a/test/Macros/SwiftifyImport/SizedBy/MultipleParams.swift +++ b/test/Macros/SwiftifyImport/SizedBy/MultipleParams.swift @@ -6,7 +6,7 @@ func myFunc(_ ptr: UnsafeRawPointer, _ size: CInt, _ ptr2: UnsafeRawPointer, _ size2: CInt) { } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func myFunc(_ ptr: UnsafeRawBufferPointer, _ ptr2: UnsafeRawBufferPointer) { // CHECK-NEXT: return unsafe myFunc(ptr.baseAddress!, CInt(exactly: ptr.count)!, ptr2.baseAddress!, CInt(exactly: ptr2.count)!) // CHECK-NEXT: } diff --git a/test/Macros/SwiftifyImport/SizedBy/Mutable.swift b/test/Macros/SwiftifyImport/SizedBy/Mutable.swift index 1e8e9d9023d84..89f08d8626143 100644 --- a/test/Macros/SwiftifyImport/SizedBy/Mutable.swift +++ b/test/Macros/SwiftifyImport/SizedBy/Mutable.swift @@ -6,7 +6,7 @@ func myFunc(_ ptr: UnsafeMutableRawPointer, _ size: CInt) { } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func myFunc(_ ptr: UnsafeMutableRawBufferPointer) { // CHECK-NEXT: return unsafe myFunc(ptr.baseAddress!, CInt(exactly: ptr.count)!) // CHECK-NEXT: } diff --git a/test/Macros/SwiftifyImport/SizedBy/MutableRawSpan.swift b/test/Macros/SwiftifyImport/SizedBy/MutableRawSpan.swift index cdf33a0e3add6..5314f3f9f5d5d 100644 --- a/test/Macros/SwiftifyImport/SizedBy/MutableRawSpan.swift +++ b/test/Macros/SwiftifyImport/SizedBy/MutableRawSpan.swift @@ -7,7 +7,7 @@ func myFunc(_ ptr: UnsafeMutableRawPointer, _ size: CInt) { } -// CHECK: @_alwaysEmitIntoClient @lifetime(ptr: copy ptr) +// CHECK: @_alwaysEmitIntoClient @lifetime(ptr: copy ptr) @_disfavoredOverload // CHECK-NEXT: func myFunc(_ ptr: inout MutableRawSpan) { // CHECK-NEXT: return unsafe ptr.withUnsafeMutableBytes { _ptrPtr in // CHECK-NEXT: return unsafe myFunc(_ptrPtr.baseAddress!, CInt(exactly: _ptrPtr.count)!) diff --git a/test/Macros/SwiftifyImport/SizedBy/Nullable.swift b/test/Macros/SwiftifyImport/SizedBy/Nullable.swift index 6a8059725c4c6..71be3b8592955 100644 --- a/test/Macros/SwiftifyImport/SizedBy/Nullable.swift +++ b/test/Macros/SwiftifyImport/SizedBy/Nullable.swift @@ -6,7 +6,7 @@ func myFunc(_ ptr: UnsafeRawPointer?, _ size: CInt) { } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func myFunc(_ ptr: UnsafeRawBufferPointer?) { // CHECK-NEXT: return unsafe myFunc(ptr?.baseAddress, CInt(exactly: ptr?.count ?? 0)!) // CHECK-NEXT: } diff --git a/test/Macros/SwiftifyImport/SizedBy/Opaque.swift b/test/Macros/SwiftifyImport/SizedBy/Opaque.swift index f4067cc321b83..84cbc283adad2 100644 --- a/test/Macros/SwiftifyImport/SizedBy/Opaque.swift +++ b/test/Macros/SwiftifyImport/SizedBy/Opaque.swift @@ -26,29 +26,29 @@ func nullableSpan(_ ptr: OpaquePointer?, _ size: CInt) { func impNullableSpan(_ ptr: OpaquePointer!, _ size: CInt) { } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func nonnullUnsafeRawBufferPointer(_ ptr: UnsafeRawBufferPointer) { // CHECK-NEXT: return unsafe nonnullUnsafeRawBufferPointer(OpaquePointer(ptr.baseAddress!), CInt(exactly: ptr.count)!) // CHECK-NEXT: } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func nullableUnsafeRawBufferPointer(_ ptr: UnsafeRawBufferPointer?) { // CHECK-NEXT: return unsafe nullableUnsafeRawBufferPointer(OpaquePointer(ptr?.baseAddress), CInt(exactly: ptr?.count ?? 0)!) // CHECK-NEXT: } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func impNullableUnsafeRawBufferPointer(_ ptr: UnsafeRawBufferPointer) { // CHECK-NEXT: return unsafe impNullableUnsafeRawBufferPointer(OpaquePointer(ptr.baseAddress!), CInt(exactly: ptr.count)!) // CHECK-NEXT: } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func nonnullSpan(_ ptr: RawSpan) { // CHECK-NEXT: return unsafe ptr.withUnsafeBytes { _ptrPtr in // CHECK-NEXT: return unsafe nonnullSpan(OpaquePointer(_ptrPtr.baseAddress!), CInt(exactly: _ptrPtr.count)!) // CHECK-NEXT: } // CHECK-NEXT: } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func nullableSpan(_ ptr: RawSpan?) { // CHECK-NEXT: return { () in // CHECK-NEXT: return if ptr == nil { @@ -61,7 +61,7 @@ func impNullableSpan(_ ptr: OpaquePointer!, _ size: CInt) { // CHECK-NEXT: }() // CHECK-NEXT: } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func impNullableSpan(_ ptr: RawSpan) { // CHECK-NEXT: return unsafe ptr.withUnsafeBytes { _ptrPtr in // CHECK-NEXT: return unsafe impNullableSpan(OpaquePointer(_ptrPtr.baseAddress!), CInt(exactly: _ptrPtr.count)!) diff --git a/test/Macros/SwiftifyImport/SizedBy/Return.swift b/test/Macros/SwiftifyImport/SizedBy/Return.swift index 61dcbc9764861..b4e0f4f386986 100644 --- a/test/Macros/SwiftifyImport/SizedBy/Return.swift +++ b/test/Macros/SwiftifyImport/SizedBy/Return.swift @@ -6,7 +6,7 @@ func myFunc(_ ptr: UnsafeRawPointer, _ size: CInt) -> CInt { } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func myFunc(_ ptr: UnsafeRawBufferPointer) -> CInt { // CHECK-NEXT: return unsafe myFunc(ptr.baseAddress!, CInt(exactly: ptr.count)!) // CHECK-NEXT: } diff --git a/test/Macros/SwiftifyImport/SizedBy/SharedCount.swift b/test/Macros/SwiftifyImport/SizedBy/SharedCount.swift index 2d331b9c19805..f69093bfeed54 100644 --- a/test/Macros/SwiftifyImport/SizedBy/SharedCount.swift +++ b/test/Macros/SwiftifyImport/SizedBy/SharedCount.swift @@ -6,7 +6,7 @@ func myFunc(_ ptr: UnsafeRawPointer, _ ptr2: UnsafeRawPointer, _ size: CInt) { } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func myFunc(_ ptr: UnsafeRawBufferPointer, _ ptr2: UnsafeRawBufferPointer, _ size: CInt) { // CHECK-NEXT: let _ptrCount: some BinaryInteger = size // CHECK-NEXT: if ptr.count < _ptrCount || _ptrCount < 0 { diff --git a/test/Macros/SwiftifyImport/SizedBy/SimpleRawSpan.swift b/test/Macros/SwiftifyImport/SizedBy/SimpleRawSpan.swift index def3831b72cb6..4d9c122d136c4 100644 --- a/test/Macros/SwiftifyImport/SizedBy/SimpleRawSpan.swift +++ b/test/Macros/SwiftifyImport/SizedBy/SimpleRawSpan.swift @@ -7,7 +7,7 @@ func myFunc(_ ptr: UnsafeRawPointer, _ size: CInt) { } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func myFunc(_ ptr: RawSpan) { // CHECK-NEXT: return unsafe ptr.withUnsafeBytes { _ptrPtr in // CHECK-NEXT: return unsafe myFunc(_ptrPtr.baseAddress!, CInt(exactly: _ptrPtr.count)!) diff --git a/test/Macros/SwiftifyImport/SizedBy/SimpleRawSpanWithReturn.swift b/test/Macros/SwiftifyImport/SizedBy/SimpleRawSpanWithReturn.swift index 9cf85ba8ee776..1142f1c403627 100644 --- a/test/Macros/SwiftifyImport/SizedBy/SimpleRawSpanWithReturn.swift +++ b/test/Macros/SwiftifyImport/SizedBy/SimpleRawSpanWithReturn.swift @@ -7,7 +7,7 @@ func myFunc(_ ptr: UnsafeRawPointer, _ size: CInt) -> CInt { } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func myFunc(_ ptr: RawSpan) -> CInt { // CHECK-NEXT: return unsafe ptr.withUnsafeBytes { _ptrPtr in // CHECK-NEXT: return unsafe myFunc(_ptrPtr.baseAddress!, CInt(exactly: _ptrPtr.count)!) diff --git a/test/Macros/SwiftifyImport/SizedBy/SimpleSize.swift b/test/Macros/SwiftifyImport/SizedBy/SimpleSize.swift index 803d81e788d1f..6bbe4b5fedab3 100644 --- a/test/Macros/SwiftifyImport/SizedBy/SimpleSize.swift +++ b/test/Macros/SwiftifyImport/SizedBy/SimpleSize.swift @@ -6,7 +6,7 @@ func myFunc(_ ptr: UnsafeRawPointer, _ size: CInt) { } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func myFunc(_ ptr: UnsafeRawBufferPointer) { // CHECK-NEXT: return unsafe myFunc(ptr.baseAddress!, CInt(exactly: ptr.count)!) // CHECK-NEXT: } diff --git a/test/Macros/SwiftifyImport/SizedBy/SizeExpr.swift b/test/Macros/SwiftifyImport/SizedBy/SizeExpr.swift index 506ae8da2b687..2e26ad824acf0 100644 --- a/test/Macros/SwiftifyImport/SizedBy/SizeExpr.swift +++ b/test/Macros/SwiftifyImport/SizedBy/SizeExpr.swift @@ -6,7 +6,7 @@ func myFunc(_ ptr: UnsafeRawPointer, _ size: CInt, _ count: CInt) { } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func myFunc(_ ptr: UnsafeRawBufferPointer, _ size: CInt, _ count: CInt) { // CHECK-NEXT: let _ptrCount: some BinaryInteger = size * count // CHECK-NEXT: if ptr.count < _ptrCount || _ptrCount < 0 { diff --git a/test/Macros/SwiftifyImport/SizedBy/Unwrapped.swift b/test/Macros/SwiftifyImport/SizedBy/Unwrapped.swift index c18be3ae42f62..18edd32030913 100644 --- a/test/Macros/SwiftifyImport/SizedBy/Unwrapped.swift +++ b/test/Macros/SwiftifyImport/SizedBy/Unwrapped.swift @@ -6,7 +6,7 @@ func myFunc(_ ptr: UnsafeRawPointer!, _ len: CInt) { } -// CHECK: @_alwaysEmitIntoClient +// CHECK: @_alwaysEmitIntoClient @_disfavoredOverload // CHECK-NEXT: func myFunc(_ ptr: UnsafeRawBufferPointer) { // CHECK-NEXT: return unsafe myFunc(ptr.baseAddress!, CInt(exactly: ptr.count)!) // CHECK-NEXT: }