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:
@@ -368,9 +368,4 @@ public class ClassFileFactory implements OutputFileCollection {
|
||||
generators.remove(classInternalName + ".class");
|
||||
}
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
public List<KtFile> getInputFiles() {
|
||||
return state.getFiles();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ interface CodegenFactory {
|
||||
val skipBodies: Boolean,
|
||||
) {
|
||||
companion object {
|
||||
fun fromGenerationState(state: GenerationState): IrConversionInput =
|
||||
fun fromGenerationStateAndFiles(state: GenerationState, files: Collection<KtFile>): IrConversionInput =
|
||||
with(state) {
|
||||
IrConversionInput(
|
||||
project, files, configuration, module, originalFrontendBindingContext, languageVersionSettings, ignoreErrors,
|
||||
@@ -84,22 +84,23 @@ interface CodegenFactory {
|
||||
}
|
||||
|
||||
object DefaultCodegenFactory : CodegenFactory {
|
||||
private object DummyOldBackendInput : CodegenFactory.BackendInput
|
||||
private class OldBackendInput(val ktFiles: Collection<KtFile>) : CodegenFactory.BackendInput
|
||||
|
||||
private class DummyOldCodegenInput(override val state: GenerationState) : CodegenFactory.CodegenInput
|
||||
|
||||
override fun convertToIr(input: CodegenFactory.IrConversionInput): CodegenFactory.BackendInput = DummyOldBackendInput
|
||||
override fun convertToIr(input: CodegenFactory.IrConversionInput): CodegenFactory.BackendInput = OldBackendInput(input.files)
|
||||
|
||||
override fun getModuleChunkBackendInput(
|
||||
wholeBackendInput: CodegenFactory.BackendInput,
|
||||
sourceFiles: Collection<KtFile>,
|
||||
): CodegenFactory.BackendInput = DummyOldBackendInput
|
||||
): CodegenFactory.BackendInput = OldBackendInput(sourceFiles)
|
||||
|
||||
override fun invokeLowerings(state: GenerationState, input: CodegenFactory.BackendInput): CodegenFactory.CodegenInput {
|
||||
input as OldBackendInput
|
||||
val filesInPackages = MultiMap<FqName, KtFile>()
|
||||
val filesInMultifileClasses = MultiMap<FqName, KtFile>()
|
||||
|
||||
for (file in state.files) {
|
||||
for (file in input.ktFiles) {
|
||||
val fileClassInfo = JvmFileClassUtil.getFileClassInfoNoResolve(file)
|
||||
|
||||
if (fileClassInfo.withJvmMultifileClass) {
|
||||
|
||||
@@ -23,16 +23,22 @@ import org.jetbrains.kotlin.progress.ProgressIndicatorAndCompilationCanceledStat
|
||||
import org.jetbrains.kotlin.psi.KtFile;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class KotlinCodegenFacade {
|
||||
public static void compileCorrectFiles(@NotNull GenerationState state, CodegenFactory codegenFactory) {
|
||||
public static void compileCorrectFiles(
|
||||
Collection<KtFile> files,
|
||||
@NotNull GenerationState state,
|
||||
CodegenFactory codegenFactory
|
||||
) {
|
||||
ProgressIndicatorAndCompilationCanceledStatus.checkCanceled();
|
||||
|
||||
state.beforeCompile();
|
||||
state.oldBEInitTrace(files);
|
||||
|
||||
ProgressIndicatorAndCompilationCanceledStatus.checkCanceled();
|
||||
|
||||
CodegenFactory.IrConversionInput psi2irInput = CodegenFactory.IrConversionInput.Companion.fromGenerationState(state);
|
||||
CodegenFactory.IrConversionInput psi2irInput = CodegenFactory.IrConversionInput.Companion.fromGenerationStateAndFiles(state, files);
|
||||
CodegenFactory.BackendInput backendInput = codegenFactory.convertToIr(psi2irInput);
|
||||
|
||||
ProgressIndicatorAndCompilationCanceledStatus.checkCanceled();
|
||||
|
||||
@@ -94,9 +94,9 @@ public class CodegenBinding {
|
||||
return properties == null ? null : CollectionsKt.filterIsInstance(properties, LocalVariableDescriptor.class);
|
||||
}
|
||||
|
||||
public static void initTrace(@NotNull GenerationState state) {
|
||||
public static void initTrace(@NotNull GenerationState state, Collection<KtFile> files) {
|
||||
CodegenAnnotatingVisitor visitor = new CodegenAnnotatingVisitor(state);
|
||||
for (KtFile file : allFilesInPackages(state.getBindingContext(), state.getFiles())) {
|
||||
for (KtFile file : allFilesInPackages(state.getBindingContext(), files)) {
|
||||
file.accept(visitor);
|
||||
if (file instanceof KtCodeFragment) {
|
||||
PsiElement context = file.getContext();
|
||||
|
||||
@@ -59,7 +59,6 @@ class GenerationState private constructor(
|
||||
builderFactory: ClassBuilderFactory,
|
||||
val module: ModuleDescriptor,
|
||||
val originalFrontendBindingContext: BindingContext,
|
||||
val files: List<KtFile>,
|
||||
val configuration: CompilerConfiguration,
|
||||
val generateDeclaredClassFilter: GenerateClassFilter,
|
||||
val targetId: TargetId?,
|
||||
@@ -78,7 +77,6 @@ class GenerationState private constructor(
|
||||
private val builderFactory: ClassBuilderFactory,
|
||||
private val module: ModuleDescriptor,
|
||||
private val bindingContext: BindingContext,
|
||||
private val files: List<KtFile>,
|
||||
private val configuration: CompilerConfiguration
|
||||
) {
|
||||
private var generateDeclaredClassFilter: GenerateClassFilter = GenerateClassFilter.GENERATE_ALL
|
||||
@@ -129,7 +127,7 @@ class GenerationState private constructor(
|
||||
|
||||
fun build() =
|
||||
GenerationState(
|
||||
project, builderFactory, module, bindingContext, files, configuration,
|
||||
project, builderFactory, module, bindingContext, configuration,
|
||||
generateDeclaredClassFilter, targetId,
|
||||
moduleName, outDirectory, onIndependentPartCompilationEnd, wantsDiagnostics,
|
||||
jvmBackendClassResolver, isIrBackend, ignoreErrors,
|
||||
@@ -375,9 +373,11 @@ class GenerationState private constructor(
|
||||
|
||||
fun beforeCompile() {
|
||||
markUsed()
|
||||
}
|
||||
|
||||
fun oldBEInitTrace(ktFiles: Collection<KtFile>) {
|
||||
if (!isIrBackend) {
|
||||
CodegenBinding.initTrace(this)
|
||||
CodegenBinding.initTrace(this, ktFiles)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -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()
|
||||
|
||||
+1
-1
@@ -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()
|
||||
|
||||
+5
-2
@@ -59,6 +59,7 @@ open class JvmIrCodegenFactory(
|
||||
) : CodegenFactory {
|
||||
data class JvmIrBackendInput(
|
||||
val irModuleFragment: IrModuleFragment,
|
||||
val ktFiles: List<KtFile>,
|
||||
val symbolTable: SymbolTable,
|
||||
val phaseConfig: PhaseConfig?,
|
||||
val irProviders: List<IrProvider>,
|
||||
@@ -214,6 +215,7 @@ open class JvmIrCodegenFactory(
|
||||
}
|
||||
return JvmIrBackendInput(
|
||||
irModuleFragment,
|
||||
input.files.toList(),
|
||||
symbolTable,
|
||||
phaseConfig,
|
||||
irProviders,
|
||||
@@ -248,7 +250,7 @@ open class JvmIrCodegenFactory(
|
||||
}
|
||||
|
||||
override fun invokeLowerings(state: GenerationState, input: CodegenFactory.BackendInput): CodegenFactory.CodegenInput {
|
||||
val (irModuleFragment, symbolTable, customPhaseConfig, irProviders, extensions, backendExtension, notifyCodegenStart) =
|
||||
val (irModuleFragment, _, symbolTable, customPhaseConfig, irProviders, extensions, backendExtension, notifyCodegenStart) =
|
||||
input as JvmIrBackendInput
|
||||
val irSerializer = if (
|
||||
state.configuration.get(JVMConfigurationKeys.SERIALIZE_IR, JvmSerializeIrMode.NONE) != JvmSerializeIrMode.NONE
|
||||
@@ -287,6 +289,7 @@ open class JvmIrCodegenFactory(
|
||||
|
||||
fun generateModuleInFrontendIRMode(
|
||||
state: GenerationState,
|
||||
ktFiles: List<KtFile>,
|
||||
irModuleFragment: IrModuleFragment,
|
||||
symbolTable: SymbolTable,
|
||||
extensions: JvmGeneratorExtensionsImpl,
|
||||
@@ -297,7 +300,7 @@ open class JvmIrCodegenFactory(
|
||||
generateModule(
|
||||
state,
|
||||
JvmIrBackendInput(
|
||||
irModuleFragment, symbolTable, phaseConfig, irProviders, extensions, backendExtension,
|
||||
irModuleFragment, ktFiles, symbolTable, phaseConfig, irProviders, extensions, backendExtension,
|
||||
notifyCodegenStart
|
||||
)
|
||||
)
|
||||
|
||||
+12
-12
@@ -46,21 +46,21 @@ fun buildLightClass(
|
||||
try {
|
||||
val classBuilderFactory = KotlinLightClassBuilderFactory(createJavaFileStub(packageFqName, files))
|
||||
val state = GenerationState.Builder(
|
||||
project,
|
||||
classBuilderFactory,
|
||||
context.module,
|
||||
context.bindingContext,
|
||||
files.toList(),
|
||||
context.languageVersionSettings?.let {
|
||||
CompilerConfiguration().apply {
|
||||
languageVersionSettings = it
|
||||
put(JVMConfigurationKeys.JVM_TARGET, context.jvmTarget)
|
||||
isReadOnly = true
|
||||
}
|
||||
} ?: CompilerConfiguration.EMPTY
|
||||
project,
|
||||
classBuilderFactory,
|
||||
context.module,
|
||||
context.bindingContext,
|
||||
context.languageVersionSettings?.let {
|
||||
CompilerConfiguration().apply {
|
||||
languageVersionSettings = it
|
||||
put(JVMConfigurationKeys.JVM_TARGET, context.jvmTarget)
|
||||
isReadOnly = true
|
||||
}
|
||||
} ?: CompilerConfiguration.EMPTY
|
||||
|
||||
).generateDeclaredClassFilter(generateClassFilter).wantsDiagnostics(false).build()
|
||||
state.beforeCompile()
|
||||
state.oldBEInitTrace(files)
|
||||
|
||||
generate(state, files)
|
||||
|
||||
|
||||
+2
-3
@@ -37,12 +37,11 @@ class ClassicJvmBackendFacade(
|
||||
ClassBuilderFactories.TEST,
|
||||
analysisResult.moduleDescriptor,
|
||||
analysisResult.bindingContext,
|
||||
psiFiles.toList(),
|
||||
configuration
|
||||
).build()
|
||||
|
||||
KotlinCodegenFacade.compileCorrectFiles(generationState, DefaultCodegenFactory)
|
||||
KotlinCodegenFacade.compileCorrectFiles(psiFiles, generationState, DefaultCodegenFactory)
|
||||
javaCompilerFacade.compileJavaFiles(module, configuration, generationState.factory)
|
||||
return BinaryArtifacts.Jvm(generationState.factory)
|
||||
return BinaryArtifacts.Jvm(generationState.factory, psiFiles)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ open class JvmBoxRunner(testServices: TestServices) : JvmBinaryArtifactHandler(t
|
||||
}
|
||||
|
||||
override fun processModule(module: TestModule, info: BinaryArtifacts.Jvm) {
|
||||
val ktFiles = info.classFileFactory.inputFiles.ifEmpty { return }
|
||||
val ktFiles = info.ktFiles.ifEmpty { return }
|
||||
val reportProblems = !testServices.codegenSuppressionChecker.failuresInModuleAreIgnored(module)
|
||||
val classLoader = createAndVerifyClassLoader(module, info.classFileFactory, reportProblems)
|
||||
try {
|
||||
|
||||
+1
-2
@@ -6,7 +6,6 @@
|
||||
package org.jetbrains.kotlin.test.backend.ir
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.BackendException
|
||||
import org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory
|
||||
import org.jetbrains.kotlin.test.backend.classic.JavaCompilerFacade
|
||||
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives
|
||||
import org.jetbrains.kotlin.test.model.ArtifactKinds
|
||||
@@ -40,6 +39,6 @@ class JvmIrBackendFacade(
|
||||
val configuration = testServices.compilerConfigurationProvider.getCompilerConfiguration(module)
|
||||
javaCompilerFacade.compileJavaFiles(module, configuration, state.factory)
|
||||
|
||||
return BinaryArtifacts.Jvm(state.factory)
|
||||
return BinaryArtifacts.Jvm(state.factory, inputArtifact.backendInput.ktFiles)
|
||||
}
|
||||
}
|
||||
|
||||
+2
-3
@@ -51,12 +51,11 @@ class ClassicFrontend2IrConverter(
|
||||
|
||||
val configuration = testServices.compilerConfigurationProvider.getCompilerConfiguration(module)
|
||||
|
||||
val files = psiFiles.values.toList()
|
||||
val phaseConfig = configuration.get(CLIConfigurationKeys.PHASE_CONFIG)
|
||||
val codegenFactory = JvmIrCodegenFactory(configuration, phaseConfig)
|
||||
val state = GenerationState.Builder(
|
||||
project, ClassBuilderFactories.TEST, analysisResult.moduleDescriptor, analysisResult.bindingContext,
|
||||
files, configuration
|
||||
configuration
|
||||
).isIrBackend(true)
|
||||
.ignoreErrors(CodegenTestDirectives.IGNORE_ERRORS in module.directives)
|
||||
.diagnosticReporter(DiagnosticReporterFactory.createReporter())
|
||||
@@ -65,7 +64,7 @@ class ClassicFrontend2IrConverter(
|
||||
return IrBackendInput.JvmIrBackendInput(
|
||||
state,
|
||||
codegenFactory,
|
||||
codegenFactory.convertToIr(CodegenFactory.IrConversionInput.fromGenerationState(state))
|
||||
codegenFactory.convertToIr(CodegenFactory.IrConversionInput.fromGenerationStateAndFiles(state, psiFiles.values))
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -62,8 +62,7 @@ class Fir2IrResultsConverter(
|
||||
|
||||
val generationState = GenerationState.Builder(
|
||||
project, ClassBuilderFactories.TEST,
|
||||
container.get(), dummyBindingContext, ktFiles,
|
||||
configuration
|
||||
container.get(), dummyBindingContext, configuration
|
||||
).isIrBackend(
|
||||
true
|
||||
).jvmBackendClassResolver(
|
||||
@@ -77,6 +76,7 @@ class Fir2IrResultsConverter(
|
||||
codegenFactory,
|
||||
JvmIrCodegenFactory.JvmIrBackendInput(
|
||||
irModuleFragment,
|
||||
ktFiles,
|
||||
symbolTable,
|
||||
phaseConfig,
|
||||
irProviders,
|
||||
|
||||
+2
-1
@@ -13,10 +13,11 @@ import org.jetbrains.kotlin.js.backend.ast.JsProgram
|
||||
import org.jetbrains.kotlin.library.KotlinLibrary
|
||||
import org.jetbrains.kotlin.ir.backend.js.LoweredIr
|
||||
import org.jetbrains.kotlin.js.facade.TranslationResult
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import java.io.File
|
||||
|
||||
object BinaryArtifacts {
|
||||
class Jvm(val classFileFactory: ClassFileFactory) : ResultingArtifact.Binary<Jvm>() {
|
||||
class Jvm(val classFileFactory: ClassFileFactory, val ktFiles: Collection<KtFile>) : ResultingArtifact.Binary<Jvm>() {
|
||||
override val kind: BinaryKind<Jvm>
|
||||
get() = ArtifactKinds.Jvm
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
|
||||
+1
-2
@@ -70,10 +70,9 @@ class JvmAbiAnalysisHandlerExtension(
|
||||
AbiBinaries,
|
||||
module,
|
||||
bindingContext,
|
||||
files.toList(),
|
||||
compilerConfiguration
|
||||
).targetId(targetId).build()
|
||||
KotlinCodegenFacade.compileCorrectFiles(generationState, DefaultCodegenFactory)
|
||||
KotlinCodegenFacade.compileCorrectFiles(files, generationState, DefaultCodegenFactory)
|
||||
|
||||
val outputDir = compilerConfiguration.get(JVMConfigurationKeys.OUTPUT_DIRECTORY)!!
|
||||
val outputs = ArrayList<AbiOutput>()
|
||||
|
||||
@@ -273,7 +273,6 @@ abstract class AbstractKapt3Extension(
|
||||
builderFactory,
|
||||
module,
|
||||
bindingContext,
|
||||
files,
|
||||
compilerConfiguration
|
||||
).targetId(targetId)
|
||||
.isIrBackend(isIrBackend)
|
||||
@@ -281,6 +280,7 @@ abstract class AbstractKapt3Extension(
|
||||
|
||||
val (classFilesCompilationTime) = measureTimeMillis {
|
||||
KotlinCodegenFacade.compileCorrectFiles(
|
||||
files,
|
||||
generationState,
|
||||
if (isIrBackend)
|
||||
JvmIrCodegenFactory(compilerConfiguration, compilerConfiguration.get(CLIConfigurationKeys.PHASE_CONFIG))
|
||||
|
||||
+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