[PLUGIN API] Do postprocess after symbol resolve

This commit is contained in:
Roman Artemev
2020-05-06 12:54:47 +03:00
committed by romanart
parent 92befaac5d
commit 7737c76540
3 changed files with 7 additions and 5 deletions
@@ -24,6 +24,7 @@ import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.scopes.MemberScope
// TODO: Make IrPluginContext be interface
open class IrPluginContext(
@Deprecated("FrontEnd API shouldn't be accessed in Ir plugin environment")
val moduleDescriptor: ModuleDescriptor,
@@ -58,8 +59,8 @@ open class IrPluginContext(
if (symbol.isBound) return symbol
linker.getDeclaration(symbol)
// TODO: post process
// linker.
linker.postProcess()
return symbol
}
@@ -70,8 +71,8 @@ open class IrPluginContext(
symbols.forEach { if (!it.isBound) linker.getDeclaration(it) }
// TODO: post process
// linker.
linker.postProcess()
return symbols
}
@@ -49,6 +49,7 @@ interface LazyIrProvider : IrProvider {
interface IrDeserializer : IrProvider {
fun init(moduleFragment: IrModuleFragment?) {}
fun postProcess() {}
}
interface ReferenceSymbolTable {
@@ -537,7 +537,7 @@ abstract class KotlinIrLinker(
deserializersForModules.values.forEach { it.init() }
}
fun postProcess() {
override fun postProcess() {
deserializersForModules.values.forEach { it.postProcess() }
finalizeExpectActualLinker()
}