IR: remove TranslationPluginContext.bindingContext
This removes another dependency of 'ir.tree' on 'frontend', and among other things, makes it possible to implement TranslationPluginContext for FIR in the future.
This commit is contained in:
@@ -36,7 +36,6 @@ import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.psi2ir.Psi2IrConfiguration
|
||||
import org.jetbrains.kotlin.psi2ir.Psi2IrTranslator
|
||||
import org.jetbrains.kotlin.psi2ir.PsiSourceManager
|
||||
import org.jetbrains.kotlin.resolve.BindingContext
|
||||
import org.jetbrains.kotlin.resolve.CleanableBindingContext
|
||||
|
||||
class JvmIrCodegenFactory(private val phaseConfig: PhaseConfig) : CodegenFactory {
|
||||
@@ -75,8 +74,6 @@ class JvmIrCodegenFactory(private val phaseConfig: PhaseConfig) : CodegenFactory
|
||||
val frontEndContext = object : TranslationPluginContext {
|
||||
override val moduleDescriptor: ModuleDescriptor
|
||||
get() = psi2irContext.moduleDescriptor
|
||||
override val bindingContext: BindingContext
|
||||
get() = psi2irContext.bindingContext
|
||||
override val symbolTable: ReferenceSymbolTable
|
||||
get() = symbolTable
|
||||
override val typeTranslator: TypeTranslator
|
||||
|
||||
+1
-4
@@ -8,12 +8,9 @@ package org.jetbrains.kotlin.ir.builders
|
||||
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
|
||||
import org.jetbrains.kotlin.ir.util.ReferenceSymbolTable
|
||||
import org.jetbrains.kotlin.ir.util.TypeTranslator
|
||||
import org.jetbrains.kotlin.resolve.BindingContext
|
||||
|
||||
interface TranslationPluginContext : IrGeneratorContext {
|
||||
|
||||
val moduleDescriptor: ModuleDescriptor
|
||||
val bindingContext: BindingContext
|
||||
val symbolTable: ReferenceSymbolTable
|
||||
val typeTranslator: TypeTranslator
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ fun generateKLib(
|
||||
|
||||
val expectDescriptorToSymbol = mutableMapOf<DeclarationDescriptor, IrSymbol>()
|
||||
val feContext = psi2IrContext.run {
|
||||
JsIrLinker.JsFePluginContext(moduleDescriptor, bindingContext, symbolTable, typeTranslator, irBuiltIns)
|
||||
JsIrLinker.JsFePluginContext(moduleDescriptor, symbolTable, typeTranslator, irBuiltIns)
|
||||
}
|
||||
val irLinker = JsIrLinker(
|
||||
psi2IrContext.moduleDescriptor,
|
||||
@@ -232,7 +232,7 @@ fun loadIr(
|
||||
val functionFactory = IrFunctionFactory(irBuiltIns, symbolTable)
|
||||
irBuiltIns.functionFactory = functionFactory
|
||||
val feContext = psi2IrContext.run {
|
||||
JsIrLinker.JsFePluginContext(moduleDescriptor, bindingContext, symbolTable, typeTranslator, irBuiltIns)
|
||||
JsIrLinker.JsFePluginContext(moduleDescriptor, symbolTable, typeTranslator, irBuiltIns)
|
||||
}
|
||||
val irLinker = JsIrLinker(psi2IrContext.moduleDescriptor, messageLogger, irBuiltIns, symbolTable, functionFactory, feContext, null)
|
||||
val deserializedModuleFragments = sortDependencies(allDependencies.getFullList(), depsDescriptors.descriptors).map {
|
||||
|
||||
-2
@@ -20,7 +20,6 @@ import org.jetbrains.kotlin.ir.util.TypeTranslator
|
||||
import org.jetbrains.kotlin.library.IrLibrary
|
||||
import org.jetbrains.kotlin.library.KotlinLibrary
|
||||
import org.jetbrains.kotlin.library.containsErrorCode
|
||||
import org.jetbrains.kotlin.resolve.BindingContext
|
||||
|
||||
class JsIrLinker(
|
||||
private val currentModule: ModuleDescriptor?, messageLogger: IrMessageLogger, builtIns: IrBuiltIns, symbolTable: SymbolTable,
|
||||
@@ -60,7 +59,6 @@ class JsIrLinker(
|
||||
|
||||
class JsFePluginContext(
|
||||
override val moduleDescriptor: ModuleDescriptor,
|
||||
override val bindingContext: BindingContext,
|
||||
override val symbolTable: ReferenceSymbolTable,
|
||||
override val typeTranslator: TypeTranslator,
|
||||
override val irBuiltIns: IrBuiltIns,
|
||||
|
||||
Reference in New Issue
Block a user