Added support of external serializers to the FIR

Co-authored-by: Leonid Startsev <leonid.startsev@jetbrains.com>
Merge-request: KT-MR-7334
Merged-by: Sergey Shanshin <Sergey.Shanshin@jetbrains.com>
This commit is contained in:
Sergey.Shanshin
2022-10-13 15:25:39 +00:00
committed by Space Team
parent 817afcd4af
commit 5a1c2c56bd
28 changed files with 629 additions and 101 deletions
@@ -52,6 +52,8 @@ class Fir2IrPluginContext(
override val typeTranslator: TypeTranslator
get() = error(ERROR_MESSAGE)
override val afterK2: Boolean = true
override val languageVersionSettings: LanguageVersionSettings
get() = components.session.languageVersionSettings
@@ -34,6 +34,11 @@ annotation class FirIncompatiblePluginAPI(val hint: String = "")
interface IrPluginContext : IrGeneratorContext {
val languageVersionSettings: LanguageVersionSettings
/**
* Indicates that the plugin works after FIR. Effectively it means that all descriptor-based API may contain incorrect and/or incomplete information, and declarations marked with `@FirIncompatibleApi` will throw runtime exceptions.
*/
val afterK2: Boolean
@ObsoleteDescriptorBasedAPI
val moduleDescriptor: ModuleDescriptor
@@ -42,6 +42,8 @@ open class IrPluginContextImpl constructor(
override val symbols: BuiltinSymbolsBase = BuiltinSymbolsBase(irBuiltIns, st)
) : IrPluginContext {
override val afterK2: Boolean = false
override val platform: TargetPlatform? = module.platform
@OptIn(ObsoleteDescriptorBasedAPI::class)