JVM_IR: call serialization for IR.

Serializer for IR is called when -Xserialize-ir flag is set.
This commit is contained in:
Georgy Bronnikov
2021-02-26 17:42:58 +03:00
committed by TeamCityServer
parent 9efd0d7589
commit b2617199bc
10 changed files with 85 additions and 11 deletions
@@ -499,6 +499,12 @@ default: `indy-with-constants` for JVM target 9 or greater, `inline` otherwise""
)
var typeEnhancementImprovementsInStrictMode: Boolean by FreezableVar(false)
@Argument(
value = "-Xserialize-ir",
description = "Save IR to metadata (EXPERIMENTAL)"
)
var serializeIr: Boolean by FreezableVar(false)
override fun configureAnalysisFlags(collector: MessageCollector, languageVersion: LanguageVersion): MutableMap<AnalysisFlag<*>, Any> {
val result = super.configureAnalysisFlags(collector, languageVersion)
result[JvmAnalysisFlags.strictMetadataVersionSemantics] = strictMetadataVersionSemantics
@@ -252,6 +252,8 @@ fun CompilerConfiguration.configureAdvancedJvmOptions(arguments: K2JVMCompilerAr
put(JVMConfigurationKeys.NO_RESET_JAR_TIMESTAMPS, arguments.noResetJarTimestamps)
put(JVMConfigurationKeys.NO_UNIFIED_NULL_CHECKS, arguments.noUnifiedNullChecks)
put(JVMConfigurationKeys.SERIALIZE_IR, arguments.serializeIr)
if (!JVMConstructorCallNormalizationMode.isSupportedValue(arguments.constructorCallNormalizationMode)) {
messageCollector.report(
ERROR,