oc.compiler-plugin.0.8.0.source-code.PluginRegistrar.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of compiler-plugin Show documentation
Show all versions of compiler-plugin Show documentation
Adds some utilities to code, developed originally for Advent of Code solving
package com.sschr15.aoc.compiler.internal
import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
import org.jetbrains.kotlin.compiler.plugin.CompilerPluginRegistrar
import org.jetbrains.kotlin.config.CompilerConfiguration
import org.jetbrains.kotlin.fir.extensions.FirExtensionRegistrarAdapter
import org.jetbrains.kotlin.ir.declarations.IrModuleFragment
class PluginRegistrar : CompilerPluginRegistrar() {
override val supportsK2 = true
override fun ExtensionStorage.registerExtensions(configuration: CompilerConfiguration) {
// error("PAIN")
FirExtensionRegistrarAdapter.registerExtension(FirRegistrar(configuration))
IrGenerationExtension.registerExtension(object : IrGenerationExtension {
override fun generate(moduleFragment: IrModuleFragment, pluginContext: IrPluginContext) {
moduleFragment.transform(Memoizer(pluginContext), null)
moduleFragment.transform(OverflowChecker(pluginContext, configuration), null)
moduleFragment.transform(IrDestructuringFinder(pluginContext, configuration), null)
}
})
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy