[FIR] Add opt-in annotation which prevents from using symbol.fir
This commit is contained in:
committed by
teamcityserver
parent
c99a02796f
commit
e94d75d433
@@ -0,0 +1,26 @@
|
|||||||
|
val projectsAllowedToUseFirFromSymbol = listOf(
|
||||||
|
"analysis-tests",
|
||||||
|
"dump",
|
||||||
|
"fir-deserialization",
|
||||||
|
"fir-serialization",
|
||||||
|
"fir2ir",
|
||||||
|
"java",
|
||||||
|
"jvm",
|
||||||
|
"raw-fir",
|
||||||
|
"resolve",
|
||||||
|
"tree",
|
||||||
|
"jvm-backend",
|
||||||
|
"light-tree2fir",
|
||||||
|
"psi2fir",
|
||||||
|
"raw-fir.common"
|
||||||
|
)
|
||||||
|
|
||||||
|
subprojects {
|
||||||
|
if (name in projectsAllowedToUseFirFromSymbol) {
|
||||||
|
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
|
||||||
|
kotlinOptions {
|
||||||
|
freeCompilerArgs += "-Xopt-in=org.jetbrains.kotlin.fir.symbols.SymbolInternals"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,6 +13,7 @@ import org.jetbrains.kotlin.fir.declarations.FirDeclarationOrigin
|
|||||||
abstract class FirBasedSymbol<E : FirDeclaration> {
|
abstract class FirBasedSymbol<E : FirDeclaration> {
|
||||||
private var _fir: E? = null
|
private var _fir: E? = null
|
||||||
|
|
||||||
|
@SymbolInternals
|
||||||
val fir: E
|
val fir: E
|
||||||
get() = _fir
|
get() = _fir
|
||||||
?: error("Fir is not initialized for $this")
|
?: error("Fir is not initialized for $this")
|
||||||
@@ -30,3 +31,6 @@ abstract class FirBasedSymbol<E : FirDeclaration> {
|
|||||||
val moduleData: FirModuleData
|
val moduleData: FirModuleData
|
||||||
get() = fir.moduleData
|
get() = fir.moduleData
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequiresOptIn
|
||||||
|
annotation class SymbolInternals
|
||||||
|
|||||||
@@ -14,3 +14,9 @@ sourceSets {
|
|||||||
"main" { projectDefault() }
|
"main" { projectDefault() }
|
||||||
"test" { }
|
"test" { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
|
||||||
|
kotlinOptions {
|
||||||
|
freeCompilerArgs += "-Xopt-in=org.jetbrains.kotlin.fir.symbols.SymbolInternals"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -62,6 +62,13 @@ projectTest(jUnit5Enabled = true) {
|
|||||||
|
|
||||||
testsJar()
|
testsJar()
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
|
||||||
|
kotlinOptions {
|
||||||
|
freeCompilerArgs += "-Xopt-in=org.jetbrains.kotlin.fir.symbols.SymbolInternals"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val generatorClasspath by configurations.creating
|
val generatorClasspath by configurations.creating
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -262,7 +262,8 @@ include ":benchmarks",
|
|||||||
":wasm:wasm.ir"
|
":wasm:wasm.ir"
|
||||||
|
|
||||||
|
|
||||||
include ":compiler:fir:cones",
|
include ":compiler:fir",
|
||||||
|
":compiler:fir:cones",
|
||||||
":compiler:fir:tree",
|
":compiler:fir:tree",
|
||||||
":compiler:fir:tree:tree-generator",
|
":compiler:fir:tree:tree-generator",
|
||||||
":compiler:fir:raw-fir:raw-fir.common",
|
":compiler:fir:raw-fir:raw-fir.common",
|
||||||
|
|||||||
Reference in New Issue
Block a user