@@ -298,7 +298,6 @@ extension Swift2JavaTranslator {
298298
299299 // Constants
300300 printClassConstants ( printer: & printer)
301- printTypeMappingDecls ( & printer)
302301
303302 body ( & printer)
304303 }
@@ -310,7 +309,6 @@ extension Swift2JavaTranslator {
310309
311310 // Constants
312311 printClassConstants ( printer: & printer)
313- printTypeMappingDecls ( & printer)
314312
315313 printer. print (
316314 """
@@ -443,45 +441,6 @@ extension Swift2JavaTranslator {
443441 )
444442 }
445443
446- public func printTypeMappingDecls( _ printer: inout CodePrinter ) {
447- // TODO: use some dictionary for those
448- printer. print (
449- """
450- // TODO: rather than the C ones offer the Swift mappings
451- public static final ValueLayout.OfBoolean C_BOOL = ValueLayout.JAVA_BOOLEAN;
452- public static final ValueLayout.OfByte C_CHAR = ValueLayout.JAVA_BYTE;
453- public static final ValueLayout.OfShort C_SHORT = ValueLayout.JAVA_SHORT;
454- public static final ValueLayout.OfInt C_INT = ValueLayout.JAVA_INT;
455- public static final ValueLayout.OfLong C_LONG_LONG = ValueLayout.JAVA_LONG;
456- public static final ValueLayout.OfFloat C_FLOAT = ValueLayout.JAVA_FLOAT;
457- public static final ValueLayout.OfDouble C_DOUBLE = ValueLayout.JAVA_DOUBLE;
458- public static final AddressLayout C_POINTER = ValueLayout.ADDRESS
459- .withTargetLayout(MemoryLayout.sequenceLayout(java.lang.Long.MAX_VALUE, ValueLayout.JAVA_BYTE));
460- public static final ValueLayout.OfLong C_LONG = ValueLayout.JAVA_LONG;
461- """
462- )
463- printer. print ( " " )
464- printer. print (
465- """
466- public static final ValueLayout.OfBoolean SWIFT_BOOL = ValueLayout.JAVA_BOOLEAN;
467- public static final ValueLayout.OfByte SWIFT_INT8 = ValueLayout.JAVA_BYTE;
468- public static final ValueLayout.OfChar SWIFT_UINT16 = ValueLayout.JAVA_CHAR;
469- public static final ValueLayout.OfShort SWIFT_INT16 = ValueLayout.JAVA_SHORT;
470- public static final ValueLayout.OfInt SWIFT_INT32 = ValueLayout.JAVA_INT;
471- public static final ValueLayout.OfLong SWIFT_INT64 = ValueLayout.JAVA_LONG;
472- public static final ValueLayout.OfFloat SWIFT_FLOAT = ValueLayout.JAVA_FLOAT;
473- public static final ValueLayout.OfDouble SWIFT_DOUBLE = ValueLayout.JAVA_DOUBLE;
474- public static final AddressLayout SWIFT_POINTER = ValueLayout.ADDRESS;
475- // On the platform this was generated on, Int was Int64
476- public static final SequenceLayout SWIFT_BYTE_ARRAY = MemoryLayout.sequenceLayout(8, ValueLayout.JAVA_BYTE);
477- public static final ValueLayout.OfLong SWIFT_INT = SWIFT_INT64;
478- public static final ValueLayout.OfLong SWIFT_UINT = SWIFT_INT64;
479-
480- public static final AddressLayout SWIFT_SELF = SWIFT_POINTER;
481- """
482- )
483- }
484-
485444 public func printClassConstructors( _ printer: inout CodePrinter , _ decl: ImportedFunc ) {
486445 guard let parentName = decl. parent else {
487446 fatalError ( " init must be inside a parent type! Was: \( decl) " )
@@ -1054,7 +1013,7 @@ extension Swift2JavaTranslator {
10541013
10551014 let isIndirectReturn = decl. isIndirectReturn
10561015
1057- var parameterLayoutDescriptors : [ ForeignValueLayout ] = javaMemoryLayoutDescriptors (
1016+ let parameterLayoutDescriptors : [ ForeignValueLayout ] = javaMemoryLayoutDescriptors (
10581017 forParametersOf: decl,
10591018 paramPassingStyle: . pointer
10601019 )
0 commit comments