[FIR] Move base FirExtension infrastructure to :fir:tree module

This is needed for type attribute extension which is used not only
  from :resolve module but also from :(de)serialization modules
This commit is contained in:
Dmitriy Novozhilov
2021-09-30 12:43:22 +03:00
committed by TeamCityServer
parent e26cd74b16
commit 32709151c3
4 changed files with 7 additions and 7 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2021 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.
*/
@@ -26,7 +26,7 @@ abstract class FirExtension(val session: FirSession) {
abstract val key: FirPluginKey
internal abstract val extensionType: KClass<out FirExtension>
abstract val extensionType: KClass<out FirExtension>
fun interface Factory<out P : FirExtension> {
fun create(session: FirSession): P
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2021 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.
*/
@@ -13,7 +13,7 @@ sealed class DeclarationPredicate {
abstract val annotations: Set<AnnotationFqn>
abstract val metaAnnotations: Set<AnnotationFqn>
internal abstract fun <R, D> accept(visitor: DeclarationPredicateVisitor<R, D>, data: D): R
abstract fun <R, D> accept(visitor: DeclarationPredicateVisitor<R, D>, data: D): R
object Any : DeclarationPredicate() {
override val annotations: Set<AnnotationFqn>
@@ -1,11 +1,11 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2021 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.fir.extensions.predicate
internal abstract class DeclarationPredicateVisitor<R, D> {
abstract class DeclarationPredicateVisitor<R, D> {
abstract fun visitPredicate(predicate: DeclarationPredicate, data: D): R
open fun visitAny(predicate: DeclarationPredicate.Any, data: D): R {
return visitPredicate(predicate, data)
@@ -42,4 +42,4 @@ internal abstract class DeclarationPredicateVisitor<R, D> {
open fun visitUnderMetaAnnotated(predicate: UnderMetaAnnotated, data: D): R {
return visitMetaAnnotated(predicate, data)
}
}
}