[Plugin API] Provide special context in EP for link-time resolve
- requires to customize declarations from synthetic declarations
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright 2010-2020 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.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.ir.builders
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
|
||||
import org.jetbrains.kotlin.ir.util.ReferenceSymbolTable
|
||||
import org.jetbrains.kotlin.ir.util.TypeTranslator
|
||||
import org.jetbrains.kotlin.resolve.BindingContext
|
||||
|
||||
interface TranslationPluginContext : IrGeneratorContext {
|
||||
|
||||
val moduleDescriptor: ModuleDescriptor
|
||||
val bindingContext: BindingContext
|
||||
val symbolTable: ReferenceSymbolTable
|
||||
val typeTranslator: TypeTranslator
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.linkage
|
||||
|
||||
import org.jetbrains.kotlin.ir.builders.TranslationPluginContext
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
|
||||
import org.jetbrains.kotlin.ir.declarations.IrModuleFragment
|
||||
import org.jetbrains.kotlin.ir.symbols.IrSymbol
|
||||
@@ -12,7 +13,7 @@ import org.jetbrains.kotlin.ir.symbols.IrSymbol
|
||||
interface IrDeserializer : IrProvider {
|
||||
|
||||
interface IrLinkerExtension {
|
||||
fun resolveSymbol(symbol: IrSymbol): IrDeclaration? = null
|
||||
fun resolveSymbol(symbol: IrSymbol, context: TranslationPluginContext): IrDeclaration? = null
|
||||
}
|
||||
|
||||
fun init(moduleFragment: IrModuleFragment?, extensions: Collection<IrLinkerExtension>) {}
|
||||
|
||||
Reference in New Issue
Block a user