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
@@ -308,8 +308,7 @@ object FirKotlinToJvmBytecodeCompiler {
val generationState = GenerationState.Builder(
(projectEnvironment as VfsBasedProjectEnvironment).project, ClassBuilderFactories.BINARIES,
moduleFragment.descriptor, dummyBindingContext, ktFiles,
moduleConfiguration
moduleFragment.descriptor, dummyBindingContext, moduleConfiguration
).withModule(
module
).onIndependentPartCompilationEnd(
@@ -326,8 +325,9 @@ object FirKotlinToJvmBytecodeCompiler {
performanceManager?.notifyIRLoweringStarted()
generationState.beforeCompile()
generationState.oldBEInitTrace(ktFiles)
codegenFactory.generateModuleInFrontendIRMode(
generationState, moduleFragment, symbolTable, extensions, FirJvmBackendExtension(session, components)
generationState, ktFiles, moduleFragment, symbolTable, extensions, FirJvmBackendExtension(session, components)
) {
performanceManager?.notifyIRLoweringFinished()
performanceManager?.notifyIRGenerationStarted()
@@ -318,7 +318,6 @@ object KotlinToJVMBytecodeCompiler {
ClassBuilderFactories.BINARIES,
result.moduleDescriptor,
result.bindingContext,
sourceFiles,
configuration
)
.withModule(module)
@@ -331,6 +330,7 @@ object KotlinToJVMBytecodeCompiler {
performanceManager?.notifyGenerationStarted()
state.beforeCompile()
state.oldBEInitTrace(sourceFiles)
ProgressIndicatorAndCompilationCanceledStatus.checkCanceled()
@@ -220,8 +220,7 @@ fun generateCodeFromIr(
val generationState = GenerationState.Builder(
(environment.projectEnvironment as VfsBasedProjectEnvironment).project, ClassBuilderFactories.BINARIES,
input.irModuleFragment.descriptor, dummyBindingContext, emptyList()/* !! */,
input.configuration
input.irModuleFragment.descriptor, dummyBindingContext, input.configuration
).targetId(
input.targetId
).moduleName(
@@ -242,7 +241,7 @@ fun generateCodeFromIr(
generationState.beforeCompile()
codegenFactory.generateModuleInFrontendIRMode(
generationState, input.irModuleFragment, input.symbolTable, input.extensions,
generationState, emptyList() /* !! */, input.irModuleFragment, input.symbolTable, input.extensions,
FirJvmBackendExtension(input.firSession, input.components)
) {
performanceManager?.notifyIRLoweringFinished()