[JS IR] use correct factory for new IR2JS

This commit is contained in:
Anton Bannykh
2021-12-01 16:48:39 +03:00
parent 038514ed65
commit 53fe540884
@@ -381,10 +381,16 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
else -> JsGenerationGranularity.WHOLE_PROGRAM
}
try {
val irFactory = when {
arguments.irDceDriven -> PersistentIrFactory()
arguments.irNewIr2Js -> IrFactoryImplForJsIC(WholeWorldStageController())
else -> IrFactoryImpl
}
val ir = compile(
module,
phaseConfig,
if (arguments.irDceDriven) PersistentIrFactory() else IrFactoryImpl,
irFactory,
dceRuntimeDiagnostic = RuntimeDiagnostic.resolve(
arguments.irDceRuntimeDiagnostic,
messageCollector