IR: use IrFactory in SymbolTable

This commit is contained in:
Alexander Udalov
2020-07-13 17:48:07 +02:00
parent c6a127e87e
commit db4cbe7103
23 changed files with 92 additions and 62 deletions
@@ -52,6 +52,7 @@ import org.jetbrains.kotlin.fir.resolve.providers.impl.FirProviderImpl
import org.jetbrains.kotlin.fir.resolve.transformers.FirTotalResolveProcessor
import org.jetbrains.kotlin.ir.backend.jvm.jvmResolveLibraries
import org.jetbrains.kotlin.ir.backend.jvm.serialization.JvmManglerDesc
import org.jetbrains.kotlin.ir.declarations.impl.IrFactoryImpl
import org.jetbrains.kotlin.load.kotlin.PackagePartProvider
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.resolve.AnalyzingUtils
@@ -144,10 +145,11 @@ object GenerationUtils {
Fir2IrConverter.createModuleFragment(
session, resolveTransformer.scopeSession, firFiles,
configuration.languageVersionSettings,
signaturer = IdSignatureDescriptor(JvmManglerDesc()),
IdSignatureDescriptor(JvmManglerDesc()),
// TODO: differentiate JVM resolve from other targets, such as JS resolve.
generatorExtensions = JvmGeneratorExtensions(),
mangler = FirJvmKotlinMangler(session)
JvmGeneratorExtensions(),
FirJvmKotlinMangler(session),
IrFactoryImpl,
)
val dummyBindingContext = NoScopeRecordCliBindingTrace().bindingContext
@@ -26,6 +26,7 @@ import org.jetbrains.kotlin.config.languageVersionSettings
import org.jetbrains.kotlin.ir.backend.js.lower.serialization.ir.JsManglerDesc
import org.jetbrains.kotlin.ir.declarations.IrFile
import org.jetbrains.kotlin.ir.declarations.IrModuleFragment
import org.jetbrains.kotlin.ir.declarations.impl.IrFactoryImpl
import org.jetbrains.kotlin.ir.util.NameProvider
import org.jetbrains.kotlin.ir.util.SymbolTable
import org.jetbrains.kotlin.ir.util.generateTypicalIrProviderList
@@ -141,7 +142,7 @@ abstract class AbstractIrGeneratorTestCase : CodegenTestCase() {
val context = psi2ir.createGeneratorContext(
moduleDescriptor,
bindingContext,
SymbolTable(IdSignatureDescriptor(JsManglerDesc), NameProvider.DEFAULT),
SymbolTable(IdSignatureDescriptor(JsManglerDesc), IrFactoryImpl, NameProvider.DEFAULT),
generatorExtensions
)
val irProviders = generateTypicalIrProviderList(
@@ -28,6 +28,7 @@ import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor
import org.jetbrains.kotlin.descriptors.findClassAcrossModuleDependencies
import org.jetbrains.kotlin.ir.backend.js.lower.serialization.ir.JsManglerDesc
import org.jetbrains.kotlin.ir.declarations.*
import org.jetbrains.kotlin.ir.declarations.impl.IrFactoryImpl
import org.jetbrains.kotlin.ir.expressions.*
import org.jetbrains.kotlin.ir.symbols.IrSymbol
import org.jetbrains.kotlin.ir.util.*
@@ -68,7 +69,7 @@ abstract class AbstractIrTextTestCase : AbstractIrGeneratorTestCase() {
val stubGenerator = DeclarationStubGenerator(
irModule.descriptor,
SymbolTable(signaturer), // TODO
SymbolTable(signaturer, IrFactoryImpl), // TODO
myEnvironment.configuration.languageVersionSettings
)