Use FirModuleBasedSession with module info, use platform default imports
In this commit, FIR sessions made bound to a particular module
This commit is contained in:
@@ -11,6 +11,7 @@ plugins {
|
||||
jvmTarget = "1.6"
|
||||
|
||||
dependencies {
|
||||
compile(project(":compiler:frontend.common"))
|
||||
compile(project(":core:descriptors"))
|
||||
compile(project(":compiler:fir:cones"))
|
||||
compile(project(":compiler:ir.tree"))
|
||||
|
||||
@@ -5,10 +5,11 @@
|
||||
|
||||
package org.jetbrains.kotlin.fir
|
||||
|
||||
import org.jetbrains.kotlin.analyzer.ModuleInfo
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
interface FirSession {
|
||||
|
||||
val moduleInfo: ModuleInfo?
|
||||
|
||||
val components: Map<KClass<*>, Any>
|
||||
|
||||
|
||||
@@ -5,15 +5,18 @@
|
||||
|
||||
package org.jetbrains.kotlin.fir
|
||||
|
||||
import org.jetbrains.kotlin.analyzer.ModuleInfo
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
abstract class FirSessionBase : FirSession {
|
||||
override val components: MutableMap<KClass<*>, Any> = mutableMapOf()
|
||||
|
||||
override val moduleInfo: ModuleInfo?
|
||||
get() = null
|
||||
|
||||
protected fun <T : Any> registerComponent(tClass: KClass<T>, t: T) {
|
||||
assert(tClass !in components) { "Already registered component" }
|
||||
components[tClass] = t
|
||||
}
|
||||
}
|
||||
|
||||
override val components: MutableMap<KClass<*>, Any> = mutableMapOf()
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user