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

main.seskar.compiler.lazy.extensions.LazyModuleExtension.kt Maven / Gradle / Ivy

There is a newer version: 3.32.0
Show newest version
package seskar.compiler.lazy.extensions

import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
import org.jetbrains.kotlin.ir.declarations.IrModuleFragment
import org.jetbrains.kotlin.platform.isJs
import seskar.compiler.lazy.backend.LazyModuleTransformer

internal class LazyModuleExtension : IrGenerationExtension {
    override fun generate(
        moduleFragment: IrModuleFragment,
        pluginContext: IrPluginContext,
    ) {
        pluginContext.platform
            ?.takeIf { it.isJs() }
            ?: return

        moduleFragment.transformChildren(LazyModuleTransformer(pluginContext), null)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy