WASM: NFC. Rename WasmPrimitive into WasmAutoboxed and add few comments.

This commit is contained in:
Igor Laevsky
2021-07-16 19:50:48 +03:00
committed by TeamCityServer
parent 59ad7e0e04
commit 9ccdffe8ad
7 changed files with 17 additions and 13 deletions
@@ -29,8 +29,8 @@ fun IrAnnotationContainer.hasWasmReinterpretAnnotation(): Boolean =
fun IrAnnotationContainer.hasWasmForeignAnnotation(): Boolean =
hasAnnotation(FqName("kotlin.wasm.internal.WasmForeign"))
fun IrAnnotationContainer.hasWasmPrimitiveAnnotation(): Boolean =
hasAnnotation(FqName("kotlin.wasm.internal.WasmPrimitive"))
fun IrAnnotationContainer.hasWasmAutoboxedAnnotation(): Boolean =
hasAnnotation(FqName("kotlin.wasm.internal.WasmAutoboxed"))
fun IrAnnotationContainer.getWasmImportAnnotation(): WasmImportPair? =
getAnnotation(FqName("kotlin.wasm.internal.WasmImport"))?.let {
@@ -32,7 +32,9 @@ class WasmInlineClassesUtils(private val wasmSymbols: WasmSymbols) : InlineClass
}
override fun isClassInlineLike(klass: IrClass): Boolean {
return klass.isInline || klass.hasWasmPrimitiveAnnotation()
// TODO: This hook is called from autoboxing lowering so we also handle autoboxing annotation here. In the future it's better
// to separate autoboxing from the inline class handling.
return klass.isInline || klass.hasWasmAutoboxedAnnotation()
}
override val boxIntrinsic: IrSimpleFunctionSymbol