JVM_IR: reorganize initialization of JvmGeneratorExtensionsImpl
CachedFields are now created at initialization. Therefore we need CompilerConfiguration as a constructor parameter.
This commit is contained in:
committed by
TeamCityServer
parent
7bbc04b6a2
commit
20b76d4149
+2
-1
@@ -198,10 +198,11 @@ open class KJvmReplCompilerBase<AnalyzerT : ReplCodeAnalyzerBase> protected cons
|
||||
snippetKtFile: KtFile,
|
||||
sourceFiles: List<KtFile>
|
||||
): GenerationState {
|
||||
val generatorExtensions = object : JvmGeneratorExtensionsImpl() {
|
||||
val generatorExtensions = object : JvmGeneratorExtensionsImpl(compilationState.environment.configuration) {
|
||||
override fun getPreviousScripts() = history.map { compilationState.symbolTable.referenceScript(it.item) }
|
||||
}
|
||||
val codegenFactory = JvmIrCodegenFactory(
|
||||
compilationState.environment.configuration,
|
||||
compilationState.environment.configuration.get(CLIConfigurationKeys.PHASE_CONFIG) ?: PhaseConfig(jvmPhases),
|
||||
compilationState.mangler, compilationState.symbolTable, generatorExtensions
|
||||
)
|
||||
|
||||
+2
-1
@@ -238,7 +238,8 @@ private fun generate(
|
||||
).codegenFactory(
|
||||
if (kotlinCompilerConfiguration.getBoolean(JVMConfigurationKeys.IR))
|
||||
JvmIrCodegenFactory(
|
||||
kotlinCompilerConfiguration.get(CLIConfigurationKeys.PHASE_CONFIG) ?: PhaseConfig(jvmPhases)
|
||||
kotlinCompilerConfiguration,
|
||||
kotlinCompilerConfiguration.get(CLIConfigurationKeys.PHASE_CONFIG) ?: PhaseConfig(jvmPhases),
|
||||
) else DefaultCodegenFactory
|
||||
).build().also {
|
||||
KotlinCodegenFacade.compileCorrectFiles(it)
|
||||
|
||||
Reference in New Issue
Block a user