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:
Ilya Chernikov
2022-02-15 17:22:24 +03:00
committed by teamcity
parent da41fddabb
commit 2044754628
22 changed files with 64 additions and 62 deletions
@@ -124,7 +124,7 @@ object GenerationUtils {
)
val generationState = GenerationState.Builder(
project, classBuilderFactory, moduleFragment.descriptor, dummyBindingContext, files, configuration
project, classBuilderFactory, moduleFragment.descriptor, dummyBindingContext, configuration
).isIrBackend(
true
).jvmBackendClassResolver(
@@ -132,8 +132,9 @@ object GenerationUtils {
).build()
generationState.beforeCompile()
generationState.oldBEInitTrace(files)
codegenFactory.generateModuleInFrontendIRMode(
generationState, moduleFragment, symbolTable, extensions, FirJvmBackendExtension(session, components),
generationState, files, moduleFragment, symbolTable, extensions, FirJvmBackendExtension(session, components),
) {}
generationState.factory.done()
@@ -188,10 +189,11 @@ object GenerationUtils {
configuration.getBoolean(JVMConfigurationKeys.USE_KAPT_WITH_JVM_IR)
val generationState = GenerationState.Builder(
project, classBuilderFactory, analysisResult.moduleDescriptor, analysisResult.bindingContext,
files, configuration
configuration
).isIrBackend(isIrBackend).apply(configureGenerationState).build()
if (analysisResult.shouldGenerateCode) {
KotlinCodegenFacade.compileCorrectFiles(
files,
generationState,
if (isIrBackend)
JvmIrCodegenFactory(configuration, configuration.get(CLIConfigurationKeys.PHASE_CONFIG))