JVM IR: introduce CodegenFactory.convertToIr
The steps of psi2ir and JVM backend need to be separated in the API because in case of cyclic module dependencies (which are allowed in JPS) psi2ir should be run first on all sources, and then JVM backend on each module separately. `CodegenFactory.convertToIr` does nothing in the old backend. Also, move the ignoreErrors to GenerationState for simplicity.
This commit is contained in:
+5
-1
@@ -19,6 +19,7 @@ import org.jetbrains.kotlin.cli.common.messages.MessageCollectorBasedReporter
|
||||
import org.jetbrains.kotlin.cli.common.repl.LineId
|
||||
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
|
||||
import org.jetbrains.kotlin.codegen.ClassBuilderFactories
|
||||
import org.jetbrains.kotlin.codegen.CodegenFactory
|
||||
import org.jetbrains.kotlin.codegen.KotlinCodegenFacade
|
||||
import org.jetbrains.kotlin.codegen.state.GenerationState
|
||||
import org.jetbrains.kotlin.config.JVMConfigurationKeys
|
||||
@@ -200,7 +201,10 @@ open class KJvmReplCompilerBase<AnalyzerT : ReplCodeAnalyzerBase>(
|
||||
.codegenFactory(codegenFactory)
|
||||
.build()
|
||||
|
||||
generationState.codegenFactory.generateModule(generationState, generationState.files)
|
||||
codegenFactory.generateModule(
|
||||
generationState,
|
||||
codegenFactory.convertToIr(CodegenFactory.IrConversionInput.fromGenerationState(generationState)),
|
||||
)
|
||||
|
||||
return generationState
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user