@@ -29,7 +29,7 @@ extension Swift2JavaTranslator {
2929 enclosingType: try enclosingType. map { try SwiftType ( $0, symbolTable: symbolTable) } ,
3030 symbolTable: symbolTable
3131 )
32- return try CdeclLowering ( swiftStdlibTypes: swiftStdlibTypes) . lowerFunctionSignature ( signature, apiKind : . function )
32+ return try CdeclLowering ( swiftStdlibTypes: swiftStdlibTypes) . lowerFunctionSignature ( signature)
3333 }
3434
3535 /// Lower the given initializer to a C-compatible entrypoint,
@@ -46,7 +46,7 @@ extension Swift2JavaTranslator {
4646 symbolTable: symbolTable
4747 )
4848
49- return try CdeclLowering ( swiftStdlibTypes: swiftStdlibTypes) . lowerFunctionSignature ( signature, apiKind : . initializer )
49+ return try CdeclLowering ( swiftStdlibTypes: swiftStdlibTypes) . lowerFunctionSignature ( signature)
5050 }
5151
5252 /// Lower the given variable decl to a C-compatible entrypoint,
@@ -69,7 +69,7 @@ extension Swift2JavaTranslator {
6969 enclosingType: try enclosingType. map { try SwiftType ( $0, symbolTable: symbolTable) } ,
7070 symbolTable: symbolTable
7171 )
72- return try CdeclLowering ( swiftStdlibTypes: swiftStdlibTypes) . lowerFunctionSignature ( signature, apiKind : isSet ? . setter : . getter )
72+ return try CdeclLowering ( swiftStdlibTypes: swiftStdlibTypes) . lowerFunctionSignature ( signature)
7373 }
7474}
7575
@@ -82,8 +82,7 @@ struct CdeclLowering {
8282 ///
8383 /// Throws an error if this function cannot be lowered for any reason.
8484 func lowerFunctionSignature(
85- _ signature: SwiftFunctionSignature ,
86- apiKind: SwiftAPIKind
85+ _ signature: SwiftFunctionSignature
8786 ) throws -> LoweredFunctionSignature {
8887 // Lower the self parameter.
8988 let loweredSelf : LoweredParameter ? = switch signature. selfParameter {
@@ -111,7 +110,6 @@ struct CdeclLowering {
111110
112111 return LoweredFunctionSignature (
113112 original: signature,
114- apiKind: apiKind,
115113 selfParameter: loweredSelf,
116114 parameters: loweredParameters,
117115 result: loweredResult
@@ -487,8 +485,6 @@ extension LoweredResult {
487485public struct LoweredFunctionSignature : Equatable {
488486 var original : SwiftFunctionSignature
489487
490- var apiKind : SwiftAPIKind
491-
492488 var selfParameter : LoweredParameter ?
493489 var parameters : [ LoweredParameter ]
494490 var result : LoweredResult
@@ -520,10 +516,11 @@ public struct LoweredFunctionSignature: Equatable {
520516extension LoweredFunctionSignature {
521517 /// Produce the `@_cdecl` thunk for this lowered function signature that will
522518 /// call into the original function.
523- public func cdeclThunk(
519+ package func cdeclThunk(
524520 cName: String ,
525521 swiftAPIName: String ,
526- stdlibTypes: SwiftStandardLibraryTypes
522+ as apiKind: SwiftAPIKind ,
523+ stdlibTypes: SwiftStandardLibraryTypes ,
527524 ) -> FunctionDeclSyntax {
528525
529526 let cdeclParams = allLoweredParameters. map ( \. description) . joined ( separator: " , " )
@@ -563,7 +560,7 @@ extension LoweredFunctionSignature {
563560
564561 // Build callee expression.
565562 let callee : ExprSyntax = if let selfExpr {
566- if case . initializer = self . apiKind {
563+ if case . initializer = apiKind {
567564 // Don't bother to create explicit ${Self}.init expression.
568565 selfExpr
569566 } else {
0 commit comments