org.jetbrains.kotlin.backend.konan.KonanBackendContext.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-native-compiler-embeddable Show documentation
Show all versions of kotlin-native-compiler-embeddable Show documentation
Embeddable JAR of Kotlin/Native compiler
/*
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.backend.konan
import org.jetbrains.kotlin.backend.common.CommonBackendContext
import org.jetbrains.kotlin.backend.common.Mapping
import org.jetbrains.kotlin.backend.konan.driver.BasicPhaseContext
import org.jetbrains.kotlin.backend.konan.ir.KonanIr
import org.jetbrains.kotlin.backend.konan.ir.KonanSharedVariablesManager
import org.jetbrains.kotlin.builtins.konan.KonanBuiltIns
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
import org.jetbrains.kotlin.ir.declarations.IrFactory
import org.jetbrains.kotlin.ir.declarations.impl.IrFactoryImpl
internal abstract class KonanBackendContext(config: KonanConfig) : BasicPhaseContext(config), CommonBackendContext {
abstract override val builtIns: KonanBuiltIns
abstract override val ir: KonanIr
override val scriptMode: Boolean = false
override val sharedVariablesManager by lazy {
// Creating lazily because builtIns module seems to be incomplete during `link` test;
// TODO: investigate this.
KonanSharedVariablesManager(this)
}
override val internalPackageFqn = KonanFqNames.internalPackageName
override val mapping: Mapping = Mapping()
override val irFactory: IrFactory = IrFactoryImpl
override val messageCollector: MessageCollector
get() = super.messageCollector
}