JVM IR: remove dependency of 'backend.jvm' on 'psi2ir', 'ir.serialization.jvm'
Add a new module 'backend.jvm.entrypoint' which depends on psi2ir and contains code that runs psi2ir + JVM IR backend with serialization implementations. Hopefully this will allow to compile these modules in parallel and reduce the build time.
This commit is contained in:
@@ -12,6 +12,7 @@ dependencies {
|
||||
compile(project(":compiler:backend-common"))
|
||||
compile(project(":compiler:backend"))
|
||||
compile(project(":compiler:backend.jvm"))
|
||||
implementation(project(":compiler:backend.jvm:backend.jvm.entrypoint"))
|
||||
compile(project(":compiler:ir.backend.common"))
|
||||
compile(project(":compiler:light-classes"))
|
||||
compile(project(":compiler:serialization"))
|
||||
|
||||
@@ -12,6 +12,9 @@ dependencies {
|
||||
api(project(":compiler:fir:fir2ir"))
|
||||
api(project(":compiler:fir:checkers"))
|
||||
|
||||
// TODO: do not use GeneratorExtensions in `FirAnalyzerFacade.convertToIr`, and make this an 'implementation' dependency.
|
||||
api(project(":compiler:ir.psi2ir"))
|
||||
|
||||
implementation(project(":compiler:fir:resolve"))
|
||||
implementation(project(":compiler:fir:fir2ir:jvm-backend"))
|
||||
implementation(project(":compiler:backend.jvm"))
|
||||
|
||||
@@ -15,6 +15,7 @@ dependencies {
|
||||
compileOnly(project(":compiler:ir.tree"))
|
||||
compileOnly(project(":compiler:backend"))
|
||||
compileOnly(project(":compiler:backend.jvm"))
|
||||
api(project(":compiler:ir.serialization.common"))
|
||||
|
||||
compileOnly(intellijCoreDep()) { includeJars("intellij-core", "asm-all", rootProject = rootProject) }
|
||||
}
|
||||
|
||||
@@ -7,9 +7,7 @@ dependencies {
|
||||
compile(project(":kotlin-annotations-jvm"))
|
||||
compile(project(":compiler:backend"))
|
||||
compile(project(":compiler:ir.tree"))
|
||||
compile(project(":compiler:ir.psi2ir"))
|
||||
compile(project(":compiler:ir.backend.common"))
|
||||
compile(project(":compiler:ir.serialization.jvm"))
|
||||
api(project(":compiler:backend.common.jvm"))
|
||||
compileOnly(project(":compiler:ir.tree.impl"))
|
||||
compileOnly(intellijCoreDep()) { includeJars("intellij-core", "asm-all", "guava", rootProject = rootProject) }
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api(project(":compiler:ir.psi2ir"))
|
||||
api(project(":compiler:backend.jvm"))
|
||||
api(project(":compiler:ir.tree.impl"))
|
||||
api(project(":compiler:ir.serialization.jvm"))
|
||||
compileOnly(intellijCoreDep()) { includeJars("intellij-core", rootProject = rootProject) }
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
"main" {
|
||||
projectDefault()
|
||||
}
|
||||
"test" {}
|
||||
}
|
||||
+1
-6
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@@ -32,7 +32,6 @@ import org.jetbrains.kotlin.ir.declarations.impl.IrFactoryImpl
|
||||
import org.jetbrains.kotlin.ir.descriptors.IrBuiltIns
|
||||
import org.jetbrains.kotlin.ir.descriptors.IrFunctionFactory
|
||||
import org.jetbrains.kotlin.ir.linkage.IrProvider
|
||||
import org.jetbrains.kotlin.ir.types.defaultType
|
||||
import org.jetbrains.kotlin.ir.util.*
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.psi2ir.Psi2IrConfiguration
|
||||
@@ -178,10 +177,6 @@ class JvmIrCodegenFactory(private val phaseConfig: PhaseConfig) : CodegenFactory
|
||||
/* JvmBackendContext creates new unbound symbols, have to resolve them. */
|
||||
ExternalDependenciesGenerator(symbolTable, irProviders).generateUnboundSymbolsAsDependencies()
|
||||
|
||||
state.mapInlineClass = { descriptor ->
|
||||
context.typeMapper.mapType(context.referenceClass(descriptor).defaultType)
|
||||
}
|
||||
|
||||
context.state.factory.registerSourceFiles(irModuleFragment.files.map(IrFile::getKtFile))
|
||||
|
||||
JvmLower(context).lower(irModuleFragment)
|
||||
@@ -37,6 +37,7 @@ import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrFunctionReference
|
||||
import org.jetbrains.kotlin.ir.symbols.*
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.types.defaultType
|
||||
import org.jetbrains.kotlin.ir.util.SymbolTable
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.resolve.jvm.JvmClassName
|
||||
@@ -130,6 +131,12 @@ class JvmBackendContext(
|
||||
|
||||
internal val continuationClassesVarsCountByType: MutableMap<IrAttributeContainer, Map<Type, Int>> = hashMapOf()
|
||||
|
||||
init {
|
||||
state.mapInlineClass = { descriptor ->
|
||||
typeMapper.mapType(referenceClass(descriptor).defaultType)
|
||||
}
|
||||
}
|
||||
|
||||
internal fun referenceClass(descriptor: ClassDescriptor): IrClassSymbol =
|
||||
symbolTable.lazyWrapper.referenceClass(descriptor)
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ dependencies {
|
||||
testApi(project(":compiler:fir:entrypoint"))
|
||||
testApi(project(":compiler:cli"))
|
||||
testImplementation(project(":compiler:ir.tree.impl"))
|
||||
testImplementation(project(":compiler:backend.jvm:backend.jvm.entrypoint"))
|
||||
testImplementation(intellijCoreDep()) { includeJars("intellij-core") }
|
||||
|
||||
testCompileOnly(project(":kotlin-reflect-api"))
|
||||
|
||||
@@ -23,6 +23,7 @@ dependencies {
|
||||
testCompile(project(":compiler:cli-js"))
|
||||
testCompile(project(":compiler:serialization"))
|
||||
testCompile(project(":compiler:fir:entrypoint"))
|
||||
testCompile(project(":compiler:backend.jvm:backend.jvm.entrypoint"))
|
||||
testCompile(projectTests(":compiler:test-infrastructure-utils"))
|
||||
testCompile(project(":kotlin-preloader"))
|
||||
testCompile(commonDep("com.android.tools:r8"))
|
||||
|
||||
Reference in New Issue
Block a user