Extract & use GenerationState.metadataVersion helper
This commit is contained in:
@@ -33,6 +33,7 @@ import org.jetbrains.kotlin.diagnostics.DiagnosticSink
|
|||||||
import org.jetbrains.kotlin.idea.MainFunctionDetector
|
import org.jetbrains.kotlin.idea.MainFunctionDetector
|
||||||
import org.jetbrains.kotlin.load.java.components.JavaDeprecationSettings
|
import org.jetbrains.kotlin.load.java.components.JavaDeprecationSettings
|
||||||
import org.jetbrains.kotlin.load.kotlin.incremental.components.IncrementalCache
|
import org.jetbrains.kotlin.load.kotlin.incremental.components.IncrementalCache
|
||||||
|
import org.jetbrains.kotlin.metadata.deserialization.BinaryVersion
|
||||||
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmMetadataVersion
|
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmMetadataVersion
|
||||||
import org.jetbrains.kotlin.modules.TargetId
|
import org.jetbrains.kotlin.modules.TargetId
|
||||||
import org.jetbrains.kotlin.name.FqName
|
import org.jetbrains.kotlin.name.FqName
|
||||||
@@ -346,9 +347,7 @@ class GenerationState private constructor(
|
|||||||
|
|
||||||
val disableOptimization = configuration.get(JVMConfigurationKeys.DISABLE_OPTIMIZATION, false)
|
val disableOptimization = configuration.get(JVMConfigurationKeys.DISABLE_OPTIMIZATION, false)
|
||||||
|
|
||||||
val metadataVersion =
|
val metadataVersion = metadataVersion(configuration)
|
||||||
configuration.get(CommonConfigurationKeys.METADATA_VERSION)
|
|
||||||
?: LANGUAGE_TO_METADATA_VERSION.getValue(languageVersionSettings.languageVersion)
|
|
||||||
|
|
||||||
val abiStability = configuration.get(JVMConfigurationKeys.ABI_STABILITY)
|
val abiStability = configuration.get(JVMConfigurationKeys.ABI_STABILITY)
|
||||||
|
|
||||||
@@ -460,6 +459,14 @@ class GenerationState private constructor(
|
|||||||
"in `GenerationState.LANGUAGE_TO_METADATA_VERSION`"
|
"in `GenerationState.LANGUAGE_TO_METADATA_VERSION`"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun metadataVersion(
|
||||||
|
configuration: CompilerConfiguration,
|
||||||
|
languageVersionSettings: LanguageVersionSettings = configuration.languageVersionSettings
|
||||||
|
): BinaryVersion {
|
||||||
|
return configuration.get(CommonConfigurationKeys.METADATA_VERSION)
|
||||||
|
?: LANGUAGE_TO_METADATA_VERSION.getValue(languageVersionSettings.languageVersion)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -609,9 +609,7 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
|
|||||||
// TODO: expect -> actual mapping
|
// TODO: expect -> actual mapping
|
||||||
val expectDescriptorToSymbol = mutableMapOf<DeclarationDescriptor, IrSymbol>()
|
val expectDescriptorToSymbol = mutableMapOf<DeclarationDescriptor, IrSymbol>()
|
||||||
|
|
||||||
val metadataVersion =
|
val metadataVersion = GenerationState.metadataVersion(configuration)
|
||||||
configuration.get(CommonConfigurationKeys.METADATA_VERSION)
|
|
||||||
?: GenerationState.LANGUAGE_TO_METADATA_VERSION.getValue(configuration.languageVersionSettings.languageVersion)
|
|
||||||
|
|
||||||
serializeModuleIntoKlib(
|
serializeModuleIntoKlib(
|
||||||
configuration[CommonConfigurationKeys.MODULE_NAME]!!,
|
configuration[CommonConfigurationKeys.MODULE_NAME]!!,
|
||||||
|
|||||||
+1
-2
@@ -92,8 +92,7 @@ fun makeLocalFirMetadataSerializerForMetadataSource(
|
|||||||
configuration.getBoolean(JVMConfigurationKeys.DISABLE_PARAM_ASSERTIONS),
|
configuration.getBoolean(JVMConfigurationKeys.DISABLE_PARAM_ASSERTIONS),
|
||||||
session.languageVersionSettings.apiVersion >= ApiVersion.KOTLIN_1_4 &&
|
session.languageVersionSettings.apiVersion >= ApiVersion.KOTLIN_1_4 &&
|
||||||
!configuration.getBoolean(JVMConfigurationKeys.NO_UNIFIED_NULL_CHECKS),
|
!configuration.getBoolean(JVMConfigurationKeys.NO_UNIFIED_NULL_CHECKS),
|
||||||
configuration.get(CommonConfigurationKeys.METADATA_VERSION)
|
GenerationState.metadataVersion(configuration, session.languageVersionSettings),
|
||||||
?: GenerationState.LANGUAGE_TO_METADATA_VERSION.getValue(session.languageVersionSettings.languageVersion),
|
|
||||||
session.languageVersionSettings.getFlag(JvmAnalysisFlags.jvmDefaultMode),
|
session.languageVersionSettings.getFlag(JvmAnalysisFlags.jvmDefaultMode),
|
||||||
stringTable
|
stringTable
|
||||||
)
|
)
|
||||||
|
|||||||
+1
-3
@@ -76,9 +76,7 @@ class Fir2IrJsResultsConverter(
|
|||||||
|
|
||||||
val icData = configuration.incrementalDataProvider?.getSerializedData(sourceFiles) ?: emptyList()
|
val icData = configuration.incrementalDataProvider?.getSerializedData(sourceFiles) ?: emptyList()
|
||||||
val expectDescriptorToSymbol = mutableMapOf<DeclarationDescriptor, IrSymbol>()
|
val expectDescriptorToSymbol = mutableMapOf<DeclarationDescriptor, IrSymbol>()
|
||||||
val metadataVersion =
|
val metadataVersion = GenerationState.metadataVersion(configuration, module.languageVersionSettings)
|
||||||
configuration.get(CommonConfigurationKeys.METADATA_VERSION)
|
|
||||||
?: GenerationState.LANGUAGE_TO_METADATA_VERSION.getValue(module.languageVersionSettings.languageVersion)
|
|
||||||
|
|
||||||
// At this point, checkers will already have been run by a previous test step. `runCheckers` returns the cached diagnostics map.
|
// At this point, checkers will already have been run by a previous test step. `runCheckers` returns the cached diagnostics map.
|
||||||
val diagnosticsMap = inputArtifact.partsForDependsOnModules.last().firAnalyzerFacade.runCheckers()
|
val diagnosticsMap = inputArtifact.partsForDependsOnModules.last().firAnalyzerFacade.runCheckers()
|
||||||
|
|||||||
Reference in New Issue
Block a user