Backend: remove psi files from generation state
pass them explicitly to all destinations. This is a step in attempt to abstract dependencies on PSI in the GenerationState and related places.
This commit is contained in:
+2
-3
@@ -165,11 +165,11 @@ open class KJvmReplCompilerBase<AnalyzerT : ReplCodeAnalyzerBase>(
|
||||
ClassBuilderFactories.BINARIES,
|
||||
compilationState.analyzerEngine.module,
|
||||
compilationState.analyzerEngine.trace.bindingContext,
|
||||
sourceFiles,
|
||||
compilationState.environment.configuration
|
||||
).build().also { generationState ->
|
||||
generationState.scriptSpecific.earlierScriptsForReplInterpreter = state.history.map { it.item }
|
||||
generationState.beforeCompile()
|
||||
generationState.oldBEInitTrace(sourceFiles)
|
||||
}
|
||||
KotlinCodegenFacade.generatePackage(generationState, snippetKtFile.script!!.containingKtFile.packageFqName, sourceFiles)
|
||||
|
||||
@@ -194,14 +194,13 @@ open class KJvmReplCompilerBase<AnalyzerT : ReplCodeAnalyzerBase>(
|
||||
ClassBuilderFactories.BINARIES,
|
||||
compilationState.analyzerEngine.module,
|
||||
compilationState.analyzerEngine.trace.bindingContext,
|
||||
sourceFiles,
|
||||
compilationState.environment.configuration
|
||||
)
|
||||
.build()
|
||||
|
||||
codegenFactory.generateModule(
|
||||
generationState,
|
||||
codegenFactory.convertToIr(CodegenFactory.IrConversionInput.fromGenerationState(generationState)),
|
||||
codegenFactory.convertToIr(CodegenFactory.IrConversionInput.fromGenerationStateAndFiles(generationState, sourceFiles)),
|
||||
)
|
||||
|
||||
return generationState
|
||||
|
||||
+1
-1
@@ -244,12 +244,12 @@ private fun generate(
|
||||
ClassBuilderFactories.BINARIES,
|
||||
analysisResult.moduleDescriptor,
|
||||
analysisResult.bindingContext,
|
||||
sourceFiles,
|
||||
kotlinCompilerConfiguration
|
||||
).diagnosticReporter(
|
||||
diagnosticsReporter
|
||||
).build().also {
|
||||
KotlinCodegenFacade.compileCorrectFiles(
|
||||
sourceFiles,
|
||||
it,
|
||||
if (kotlinCompilerConfiguration.getBoolean(JVMConfigurationKeys.IR))
|
||||
JvmIrCodegenFactory(
|
||||
|
||||
+1
-1
@@ -96,12 +96,12 @@ open class GenericReplCompiler(
|
||||
ClassBuilderFactories.BINARIES,
|
||||
compilerState.analyzerEngine.module,
|
||||
compilerState.analyzerEngine.trace.bindingContext,
|
||||
listOf(psiFile),
|
||||
compilerConfiguration
|
||||
).build()
|
||||
|
||||
generationState.scriptSpecific.earlierScriptsForReplInterpreter = compilerState.history.map { it.item }
|
||||
generationState.beforeCompile()
|
||||
generationState.oldBEInitTrace(listOf(psiFile))
|
||||
KotlinCodegenFacade.generatePackage(
|
||||
generationState,
|
||||
psiFile.script!!.containingKtFile.packageFqName,
|
||||
|
||||
Reference in New Issue
Block a user