JVM_IR: introduce modes for IR serialization
Instead of a Boolean flag -Xserialize-ir, use modes: none,inline,all. In "inline" mode, only information needed to deserialize bodies of inline functions is serialized. In the "all" mode, all declarations are serialized completely.
This commit is contained in:
committed by
TeamCityServer
parent
f760cd6736
commit
4caa71538d
@@ -145,8 +145,8 @@ public class JVMConfigurationKeys {
|
||||
public static final CompilerConfigurationKey<Boolean> NO_REFLECT =
|
||||
CompilerConfigurationKey.create("Don't automatically include kotlin-reflect.jar into the output if the output is a jar");
|
||||
|
||||
public static final CompilerConfigurationKey<Boolean> SERIALIZE_IR =
|
||||
CompilerConfigurationKey.create("Serialize IR to class metadata");
|
||||
public static final CompilerConfigurationKey<JvmSerializeIrMode> SERIALIZE_IR =
|
||||
CompilerConfigurationKey.create("What functions to serialize as IR to class metadata");
|
||||
|
||||
public static final CompilerConfigurationKey<Boolean> VALIDATE_IR =
|
||||
CompilerConfigurationKey.create("Validate IR");
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.config
|
||||
|
||||
enum class JvmSerializeIrMode(val description: String) {
|
||||
NONE("none"),
|
||||
INLINE("inline"),
|
||||
ALL("all");
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun fromStringOrNull(string: String) = values().find { it.description == string }
|
||||
|
||||
@JvmStatic
|
||||
fun fromString(string: String) = fromStringOrNull(string) ?: NONE
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user