All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.seskar.compiler.native.backend.NativeTransformer.kt Maven / Gradle / Ivy

There is a newer version: 3.32.0
Show newest version
package seskar.compiler.native.backend

import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
import org.jetbrains.kotlin.ir.IrStatement
import org.jetbrains.kotlin.ir.declarations.IrFunction
import org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid
import seskar.compiler.common.backend.annotation

internal class NativeTransformer(
    private val context: IrPluginContext,
) : IrElementTransformerVoid() {
    override fun visitFunction(declaration: IrFunction): IrStatement {
        val nativeAnnotation = declaration.nativeAnnotation()
        if (nativeAnnotation != null) {
            declaration.annotations += annotation(context, nativeAnnotation)
        }

        return declaration
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy