[IR][JS] Drop JsIrFileSerializer.skipExpects parameter

^KT-61136
This commit is contained in:
Dmitriy Dolovov
2023-08-10 16:01:02 +02:00
committed by Space Team
parent b37bb0be16
commit 5991364028
5 changed files with 2 additions and 11 deletions
@@ -685,7 +685,6 @@ fun serializeModuleIntoKlib(
moduleFragment.irBuiltins, moduleFragment.irBuiltins,
expectDescriptorToSymbol, expectDescriptorToSymbol,
compatibilityMode, compatibilityMode,
skipExpects = !configuration.expectActualLinker,
normalizeAbsolutePaths = absolutePathNormalization, normalizeAbsolutePaths = absolutePathNormalization,
sourceBaseDirs = sourceBaseDirs, sourceBaseDirs = sourceBaseDirs,
configuration.languageVersionSettings, configuration.languageVersionSettings,
@@ -28,7 +28,6 @@ class JsIrFileSerializer(
declarationTable: DeclarationTable, declarationTable: DeclarationTable,
expectDescriptorToSymbol: MutableMap<DeclarationDescriptor, IrSymbol>, expectDescriptorToSymbol: MutableMap<DeclarationDescriptor, IrSymbol>,
compatibilityMode: CompatibilityMode, compatibilityMode: CompatibilityMode,
skipExpects: Boolean,
languageVersionSettings: LanguageVersionSettings, languageVersionSettings: LanguageVersionSettings,
bodiesOnlyForInlines: Boolean = false, bodiesOnlyForInlines: Boolean = false,
normalizeAbsolutePaths: Boolean, normalizeAbsolutePaths: Boolean,
@@ -40,7 +39,6 @@ class JsIrFileSerializer(
compatibilityMode, compatibilityMode,
languageVersionSettings, languageVersionSettings,
bodiesOnlyForInlines = bodiesOnlyForInlines, bodiesOnlyForInlines = bodiesOnlyForInlines,
skipExpects = skipExpects,
normalizeAbsolutePaths = normalizeAbsolutePaths, normalizeAbsolutePaths = normalizeAbsolutePaths,
sourceBaseDirs = sourceBaseDirs sourceBaseDirs = sourceBaseDirs
) { ) {
@@ -21,7 +21,6 @@ class JsIrModuleSerializer(
irBuiltIns: IrBuiltIns, irBuiltIns: IrBuiltIns,
private val expectDescriptorToSymbol: MutableMap<DeclarationDescriptor, IrSymbol>, private val expectDescriptorToSymbol: MutableMap<DeclarationDescriptor, IrSymbol>,
compatibilityMode: CompatibilityMode, compatibilityMode: CompatibilityMode,
val skipExpects: Boolean,
normalizeAbsolutePaths: Boolean, normalizeAbsolutePaths: Boolean,
sourceBaseDirs: Collection<String>, sourceBaseDirs: Collection<String>,
private val languageVersionSettings: LanguageVersionSettings, private val languageVersionSettings: LanguageVersionSettings,
@@ -39,7 +38,6 @@ class JsIrModuleSerializer(
DeclarationTable(globalDeclarationTable), DeclarationTable(globalDeclarationTable),
expectDescriptorToSymbol, expectDescriptorToSymbol,
compatibilityMode = compatibilityMode, compatibilityMode = compatibilityMode,
skipExpects = skipExpects,
normalizeAbsolutePaths = normalizeAbsolutePaths, normalizeAbsolutePaths = normalizeAbsolutePaths,
sourceBaseDirs = sourceBaseDirs, sourceBaseDirs = sourceBaseDirs,
languageVersionSettings = languageVersionSettings, languageVersionSettings = languageVersionSettings,
@@ -104,9 +104,7 @@ abstract class AbstractKlibIrTextTestCase : CodegenTestCase() {
val expected = irModule.dump(DumpIrTreeOptions(stableOrder = true, verboseErrorTypes = false)) val expected = irModule.dump(DumpIrTreeOptions(stableOrder = true, verboseErrorTypes = false))
val mppProject = val klibPath = serializeModule(irModule, bindingContext, stdlib, ignoreErrors, expectActualSymbols,)
myEnvironment.configuration.languageVersionSettings.getFeatureSupport(LanguageFeature.MultiPlatformProjects) == LanguageFeature.State.ENABLED
val klibPath = serializeModule(irModule, bindingContext, stdlib, ignoreErrors, expectActualSymbols, !mppProject)
val libs = loadKlibFromPath(listOf(runtimeKlibPath, klibPath)) val libs = loadKlibFromPath(listOf(runtimeKlibPath, klibPath))
val (stdlib2, klib) = libs val (stdlib2, klib) = libs
val deserializedIrModule = deserializeModule(stdlib2, klib) val deserializedIrModule = deserializeModule(stdlib2, klib)
@@ -144,14 +142,13 @@ abstract class AbstractKlibIrTextTestCase : CodegenTestCase() {
return serializePackageFragment(moduleDescriptor, memberScope, ktFile.packageFqName) return serializePackageFragment(moduleDescriptor, memberScope, ktFile.packageFqName)
} }
protected fun serializeModule(irModuleFragment: IrModuleFragment, bindingContext: BindingContext, stdlib: KotlinLibrary, containsErrorCode: Boolean, expectActualSymbols: MutableMap<DeclarationDescriptor, IrSymbol>, skipExpect: Boolean): String { protected fun serializeModule(irModuleFragment: IrModuleFragment, bindingContext: BindingContext, stdlib: KotlinLibrary, containsErrorCode: Boolean, expectActualSymbols: MutableMap<DeclarationDescriptor, IrSymbol>): String {
val ktFiles = myFiles.psiFiles val ktFiles = myFiles.psiFiles
val serializedIr = JsIrModuleSerializer( val serializedIr = JsIrModuleSerializer(
IrMessageLogger.None, IrMessageLogger.None,
irModuleFragment.irBuiltins, irModuleFragment.irBuiltins,
expectActualSymbols, expectActualSymbols,
CompatibilityMode.CURRENT, CompatibilityMode.CURRENT,
skipExpect,
false, false,
emptyList(), emptyList(),
myEnvironment.configuration.languageVersionSettings, myEnvironment.configuration.languageVersionSettings,
@@ -531,7 +531,6 @@ class GenerateIrRuntime {
module.irBuiltins, module.irBuiltins,
mutableMapOf(), mutableMapOf(),
CompatibilityMode.CURRENT, CompatibilityMode.CURRENT,
skipExpects = true,
normalizeAbsolutePaths = false, normalizeAbsolutePaths = false,
emptyList(), emptyList(),
configuration.languageVersionSettings, configuration.languageVersionSettings,