[FIR] Use StandardClassIds instead of StandardNames everywhere it's possible
This commit is contained in:
committed by
teamcityserver
parent
5c2a3bb78e
commit
7a347b11e3
+5
-11
@@ -5,7 +5,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.fir.deserialization
|
||||
|
||||
import org.jetbrains.kotlin.builtins.StandardNames
|
||||
import org.jetbrains.kotlin.builtins.jvm.JvmBuiltInsSignatures
|
||||
import org.jetbrains.kotlin.descriptors.ClassKind
|
||||
import org.jetbrains.kotlin.descriptors.EffectiveVisibility
|
||||
@@ -20,8 +19,6 @@ import org.jetbrains.kotlin.fir.declarations.utils.addDeclarations
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.moduleName
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.sourceElement
|
||||
import org.jetbrains.kotlin.fir.expressions.FirAnnotation
|
||||
import org.jetbrains.kotlin.fir.resolve.providers.impl.FirCloneableSymbolProvider.Companion.CLONE
|
||||
import org.jetbrains.kotlin.fir.resolve.providers.impl.FirCloneableSymbolProvider.Companion.CLONEABLE_CLASS_ID
|
||||
import org.jetbrains.kotlin.fir.scopes.FirScopeProvider
|
||||
import org.jetbrains.kotlin.fir.symbols.ConeTypeParameterLookupTag
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.ConeClassLikeLookupTagImpl
|
||||
@@ -37,10 +34,7 @@ import org.jetbrains.kotlin.load.kotlin.KotlinJvmBinarySourceElement
|
||||
import org.jetbrains.kotlin.metadata.ProtoBuf
|
||||
import org.jetbrains.kotlin.metadata.deserialization.*
|
||||
import org.jetbrains.kotlin.metadata.jvm.JvmProtoBuf
|
||||
import org.jetbrains.kotlin.name.CallableId
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.name.*
|
||||
import org.jetbrains.kotlin.serialization.deserialization.ProtoEnumFlags
|
||||
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource
|
||||
import org.jetbrains.kotlin.serialization.deserialization.getName
|
||||
@@ -254,11 +248,11 @@ private fun FirRegularClassBuilder.addSerializableIfNeeded(classId: ClassId) {
|
||||
}
|
||||
|
||||
private fun FirRegularClassBuilder.addCloneForArrayIfNeeded(classId: ClassId, dispatchReceiver: ConeClassLikeType?) {
|
||||
if (classId.packageFqName != StandardNames.BUILT_INS_PACKAGE_FQ_NAME) return
|
||||
if (classId.packageFqName != StandardClassIds.BASE_KOTLIN_PACKAGE) return
|
||||
if (classId.shortClassName !in ARRAY_CLASSES) return
|
||||
superTypeRefs += buildResolvedTypeRef {
|
||||
type = ConeClassLikeTypeImpl(
|
||||
ConeClassLikeLookupTagImpl(CLONEABLE_CLASS_ID),
|
||||
ConeClassLikeLookupTagImpl(StandardClassIds.Cloneable),
|
||||
typeArguments = emptyArray(),
|
||||
isNullable = false
|
||||
)
|
||||
@@ -286,8 +280,8 @@ private fun FirRegularClassBuilder.addCloneForArrayIfNeeded(classId: ClassId, di
|
||||
status = FirResolvedDeclarationStatusImpl(Visibilities.Public, Modality.FINAL, EffectiveVisibility.Public).apply {
|
||||
isOverride = true
|
||||
}
|
||||
name = CLONE
|
||||
symbol = FirNamedFunctionSymbol(CallableId(classId, CLONE))
|
||||
name = StandardClassIds.Callables.clone.callableName
|
||||
symbol = FirNamedFunctionSymbol(CallableId(classId, name))
|
||||
dispatchReceiverType = dispatchReceiver!!
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -171,7 +171,7 @@ class FirTypeDeserializer(
|
||||
): ConeClassLikeType? {
|
||||
fun ConeClassLikeType.isContinuation(): Boolean {
|
||||
if (this.typeArguments.size != 1) return false
|
||||
if (this.lookupTag.classId != CONTINUATION_INTERFACE_CLASS_ID) return false
|
||||
if (this.lookupTag.classId != StandardClassIds.Continuation) return false
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
/*
|
||||
* 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.fir.deserialization
|
||||
|
||||
import org.jetbrains.kotlin.builtins.StandardNames
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
|
||||
|
||||
val CONTINUATION_INTERFACE_CLASS_ID = ClassId.topLevel(StandardNames.CONTINUATION_INTERFACE_FQ_NAME)
|
||||
+1
-2
@@ -5,7 +5,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.fir.resolve.providers.impl
|
||||
|
||||
import org.jetbrains.kotlin.builtins.StandardNames
|
||||
import org.jetbrains.kotlin.builtins.functions.FunctionClassKind
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.fir.FirModuleData
|
||||
@@ -58,7 +57,7 @@ open class FirBuiltinSymbolProvider(
|
||||
private fun loadBuiltIns(): List<BuiltInsPackageFragment> {
|
||||
val classLoader = this::class.java.classLoader
|
||||
val streamProvider = { path: String -> classLoader?.getResourceAsStream(path) ?: ClassLoader.getSystemResourceAsStream(path) }
|
||||
val packageFqNames = StandardNames.BUILT_INS_PACKAGE_FQ_NAMES
|
||||
val packageFqNames = StandardClassIds.builtInsPackages
|
||||
|
||||
return packageFqNames.map { fqName ->
|
||||
val resourcePath = BuiltInSerializerProtocol.getBuiltInsFilePath(fqName)
|
||||
|
||||
Reference in New Issue
Block a user