IC mangling: Replace compiler hack with configuration flag

This commit is contained in:
Ilmir Usmanov
2020-11-14 00:47:17 +01:00
parent bc1b6fef1f
commit 2cd9016016
27 changed files with 108 additions and 30 deletions
@@ -412,6 +412,12 @@ class K2JVMCompilerArguments : CommonCompilerArguments() {
)
var useOldSpilledVarTypeAnalysis: Boolean by FreezableVar(false)
@Argument(
value = "-Xuse-14-inline-classes-mangling-scheme",
description = "Use 1.4 inline classes mangling scheme instead of 1.4.30 one"
)
var useOldInlineClassesManglingScheme: Boolean by FreezableVar(false)
override fun configureAnalysisFlags(collector: MessageCollector): MutableMap<AnalysisFlag<*>, Any> {
val result = super.configureAnalysisFlags(collector)
result[JvmAnalysisFlags.strictMetadataVersionSemantics] = strictMetadataVersionSemantics
@@ -87,6 +87,7 @@ class CliLightClassGenerationSupport(
ClassBuilderMode.LIGHT_CLASSES,
moduleName,
languageVersionSettings,
useOldInlineClassesManglingScheme = false,
jvmTarget = JvmTarget.JVM_1_8,
typePreprocessor = KotlinType::cleanFromAnonymousTypes,
namePreprocessor = ::tryGetPredefinedName
@@ -231,6 +231,7 @@ fun CompilerConfiguration.configureAdvancedJvmOptions(arguments: K2JVMCompilerAr
put(CLIConfigurationKeys.ALLOW_KOTLIN_PACKAGE, arguments.allowKotlinPackage)
put(JVMConfigurationKeys.USE_SINGLE_MODULE, arguments.singleModule)
put(JVMConfigurationKeys.USE_OLD_SPILLED_VAR_TYPE_ANALYSIS, arguments.useOldSpilledVarTypeAnalysis)
put(JVMConfigurationKeys.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME, arguments.useOldInlineClassesManglingScheme)
arguments.declarationsOutputPath?.let { put(JVMConfigurationKeys.DECLARATIONS_JSON_PATH, it) }
}