diff --git a/generators/wasm/WasmIntrinsicGenerator.kt b/generators/wasm/WasmIntrinsicGenerator.kt index a8efa33ab14..e4e0353cc6d 100644 --- a/generators/wasm/WasmIntrinsicGenerator.kt +++ b/generators/wasm/WasmIntrinsicGenerator.kt @@ -92,6 +92,7 @@ fun wasmArrayForType( else -> "" } return """ + @Suppress("UNUSED_PARAMETER") @WasmArrayOf($klass::class, isNullable = $isNullable) internal class $name(size: Int) { @WasmOp(WasmOp.ARRAY_GET${getSuffix}) @@ -107,6 +108,7 @@ fun wasmArrayForType( implementedAsIntrinsic } + @Suppress("NOTHING_TO_INLINE") internal inline fun copyWasmArray(source: $name, destination: $name, sourceIndex: Int, destinationIndex: Int, length: Int) { wasm_array_copy<$name>(destination, destinationIndex, source, sourceIndex, length) } @@ -117,7 +119,8 @@ fun wasmArrayForType( set(i, init(i)) i++ } - } + } + """.trimIndent() } diff --git a/libraries/stdlib/wasm/src/generated/_WasmArrays.kt b/libraries/stdlib/wasm/src/generated/_WasmArrays.kt index e477752644a..0f79e00c2a0 100644 --- a/libraries/stdlib/wasm/src/generated/_WasmArrays.kt +++ b/libraries/stdlib/wasm/src/generated/_WasmArrays.kt @@ -9,6 +9,7 @@ package kotlin.wasm.internal // NOTE: THIS FILE IS AUTO-GENERATED by the generators/wasm/WasmIntrinsicGenerator.kt // +@Suppress("UNUSED_PARAMETER") @WasmArrayOf(Any::class, isNullable = true) internal class WasmAnyArray(size: Int) { @WasmOp(WasmOp.ARRAY_GET) @@ -24,6 +25,7 @@ internal class WasmAnyArray(size: Int) { implementedAsIntrinsic } +@Suppress("NOTHING_TO_INLINE") internal inline fun copyWasmArray(source: WasmAnyArray, destination: WasmAnyArray, sourceIndex: Int, destinationIndex: Int, length: Int) { wasm_array_copy(destination, destinationIndex, source, sourceIndex, length) } @@ -34,7 +36,9 @@ internal inline fun WasmAnyArray.fill(size: Int, init: (Int) -> Any?) { set(i, init(i)) i++ } -} +} + +@Suppress("UNUSED_PARAMETER") @WasmArrayOf(Byte::class, isNullable = false) internal class WasmByteArray(size: Int) { @WasmOp(WasmOp.ARRAY_GET_S) @@ -50,6 +54,7 @@ internal class WasmByteArray(size: Int) { implementedAsIntrinsic } +@Suppress("NOTHING_TO_INLINE") internal inline fun copyWasmArray(source: WasmByteArray, destination: WasmByteArray, sourceIndex: Int, destinationIndex: Int, length: Int) { wasm_array_copy(destination, destinationIndex, source, sourceIndex, length) } @@ -60,7 +65,9 @@ internal inline fun WasmByteArray.fill(size: Int, init: (Int) -> Byte) { set(i, init(i)) i++ } -} +} + +@Suppress("UNUSED_PARAMETER") @WasmArrayOf(Char::class, isNullable = false) internal class WasmCharArray(size: Int) { @WasmOp(WasmOp.ARRAY_GET_U) @@ -76,6 +83,7 @@ internal class WasmCharArray(size: Int) { implementedAsIntrinsic } +@Suppress("NOTHING_TO_INLINE") internal inline fun copyWasmArray(source: WasmCharArray, destination: WasmCharArray, sourceIndex: Int, destinationIndex: Int, length: Int) { wasm_array_copy(destination, destinationIndex, source, sourceIndex, length) } @@ -86,7 +94,9 @@ internal inline fun WasmCharArray.fill(size: Int, init: (Int) -> Char) { set(i, init(i)) i++ } -} +} + +@Suppress("UNUSED_PARAMETER") @WasmArrayOf(Short::class, isNullable = false) internal class WasmShortArray(size: Int) { @WasmOp(WasmOp.ARRAY_GET_S) @@ -102,6 +112,7 @@ internal class WasmShortArray(size: Int) { implementedAsIntrinsic } +@Suppress("NOTHING_TO_INLINE") internal inline fun copyWasmArray(source: WasmShortArray, destination: WasmShortArray, sourceIndex: Int, destinationIndex: Int, length: Int) { wasm_array_copy(destination, destinationIndex, source, sourceIndex, length) } @@ -112,7 +123,9 @@ internal inline fun WasmShortArray.fill(size: Int, init: (Int) -> Short) { set(i, init(i)) i++ } -} +} + +@Suppress("UNUSED_PARAMETER") @WasmArrayOf(Int::class, isNullable = false) internal class WasmIntArray(size: Int) { @WasmOp(WasmOp.ARRAY_GET) @@ -128,6 +141,7 @@ internal class WasmIntArray(size: Int) { implementedAsIntrinsic } +@Suppress("NOTHING_TO_INLINE") internal inline fun copyWasmArray(source: WasmIntArray, destination: WasmIntArray, sourceIndex: Int, destinationIndex: Int, length: Int) { wasm_array_copy(destination, destinationIndex, source, sourceIndex, length) } @@ -138,7 +152,9 @@ internal inline fun WasmIntArray.fill(size: Int, init: (Int) -> Int) { set(i, init(i)) i++ } -} +} + +@Suppress("UNUSED_PARAMETER") @WasmArrayOf(Long::class, isNullable = false) internal class WasmLongArray(size: Int) { @WasmOp(WasmOp.ARRAY_GET) @@ -154,6 +170,7 @@ internal class WasmLongArray(size: Int) { implementedAsIntrinsic } +@Suppress("NOTHING_TO_INLINE") internal inline fun copyWasmArray(source: WasmLongArray, destination: WasmLongArray, sourceIndex: Int, destinationIndex: Int, length: Int) { wasm_array_copy(destination, destinationIndex, source, sourceIndex, length) } @@ -164,7 +181,9 @@ internal inline fun WasmLongArray.fill(size: Int, init: (Int) -> Long) { set(i, init(i)) i++ } -} +} + +@Suppress("UNUSED_PARAMETER") @WasmArrayOf(Float::class, isNullable = false) internal class WasmFloatArray(size: Int) { @WasmOp(WasmOp.ARRAY_GET) @@ -180,6 +199,7 @@ internal class WasmFloatArray(size: Int) { implementedAsIntrinsic } +@Suppress("NOTHING_TO_INLINE") internal inline fun copyWasmArray(source: WasmFloatArray, destination: WasmFloatArray, sourceIndex: Int, destinationIndex: Int, length: Int) { wasm_array_copy(destination, destinationIndex, source, sourceIndex, length) } @@ -190,7 +210,9 @@ internal inline fun WasmFloatArray.fill(size: Int, init: (Int) -> Float) { set(i, init(i)) i++ } -} +} + +@Suppress("UNUSED_PARAMETER") @WasmArrayOf(Double::class, isNullable = false) internal class WasmDoubleArray(size: Int) { @WasmOp(WasmOp.ARRAY_GET) @@ -206,6 +228,7 @@ internal class WasmDoubleArray(size: Int) { implementedAsIntrinsic } +@Suppress("NOTHING_TO_INLINE") internal inline fun copyWasmArray(source: WasmDoubleArray, destination: WasmDoubleArray, sourceIndex: Int, destinationIndex: Int, length: Int) { wasm_array_copy(destination, destinationIndex, source, sourceIndex, length) } @@ -216,4 +239,5 @@ internal inline fun WasmDoubleArray.fill(size: Int, init: (Int) -> Double) { set(i, init(i)) i++ } -} +} +