[FIR] Get rid of FirExtension.key

In reality plugin key was used only in two ways:
- found corresponding generator for member scope of generated class
- pass it to declaration origin so it can be read in backend IR plugin

Because of first usage plugin key was required to be an object, which
  reduces functionality of second usage, because there was no way to
  pass any additional info via key to IR (in future this usecase will be
  covered with IR declaration attributes, but right now we don't have
  them)

So now generator which created some class is now saved in its attributes
  and plugins can use any keys they want. And since there is no other
  usages of `FirExtension.key` it removed from FirExtension API at all
This commit is contained in:
Dmitriy Novozhilov
2021-11-29 18:37:05 +03:00
committed by TeamCityServer
parent e7af50fe2b
commit c46e9943cc
16 changed files with 36 additions and 51 deletions
@@ -6,7 +6,6 @@
package org.jetbrains.kotlin.fir.extensions
import org.jetbrains.kotlin.fir.FirSession
import org.jetbrains.kotlin.fir.declarations.FirPluginKey
import org.jetbrains.kotlin.fir.extensions.predicate.DeclarationPredicate
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
@@ -24,8 +23,6 @@ typealias AnnotationFqn = FqName
abstract class FirExtension(val session: FirSession) {
abstract val name: FirExtensionPointName
abstract val key: FirPluginKey
abstract val extensionType: KClass<out FirExtension>
fun interface Factory<out P : FirExtension> {