IR: a flag to GeneratorExtensions to control IR deserialization

There is no need to search for IR embedded in toplevel classes when none
is expected (in npon-JVM backends or when -Xserialize-ir is not set).
This commit is contained in:
Georgy Bronnikov
2021-05-26 00:21:16 +03:00
committed by TeamCityServer
parent ec1c97c684
commit 1c4466951f
5 changed files with 17 additions and 7 deletions
@@ -306,7 +306,10 @@ object KotlinToJVMBytecodeCompiler {
)
.codegenFactory(
if (configuration.getBoolean(JVMConfigurationKeys.IR)) JvmIrCodegenFactory(
configuration.get(CLIConfigurationKeys.PHASE_CONFIG) ?: PhaseConfig(jvmPhases)
configuration.get(CLIConfigurationKeys.PHASE_CONFIG) ?: PhaseConfig(jvmPhases),
jvmGeneratorExtensions = JvmGeneratorExtensionsImpl(
irDeserializationEnabled = configuration.getBoolean(JVMConfigurationKeys.SERIALIZE_IR)
)
) else DefaultCodegenFactory
)
.withModule(module)