Native: remove unused code
This commit is contained in:
committed by
Space Team
parent
d096641ddb
commit
ed9f5497fb
-24
@@ -23,7 +23,6 @@ import org.jetbrains.kotlin.ir.types.IrType
|
|||||||
import org.jetbrains.kotlin.ir.util.*
|
import org.jetbrains.kotlin.ir.util.*
|
||||||
import org.jetbrains.kotlin.resolve.annotations.argumentValue
|
import org.jetbrains.kotlin.resolve.annotations.argumentValue
|
||||||
import org.jetbrains.kotlin.resolve.constants.StringValue
|
import org.jetbrains.kotlin.resolve.constants.StringValue
|
||||||
import org.jetbrains.kotlin.resolve.descriptorUtil.module
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of all implemented interfaces (including those which implemented by a super class)
|
* List of all implemented interfaces (including those which implemented by a super class)
|
||||||
@@ -237,26 +236,6 @@ internal fun IrSimpleFunction.bridgeDirectionsTo(overriddenFunction: IrSimpleFun
|
|||||||
fun IrFunctionSymbol.isComparisonFunction(map: Map<IrClassifierSymbol, IrSimpleFunctionSymbol>): Boolean =
|
fun IrFunctionSymbol.isComparisonFunction(map: Map<IrClassifierSymbol, IrSimpleFunctionSymbol>): Boolean =
|
||||||
this in map.values
|
this in map.values
|
||||||
|
|
||||||
val IrDeclaration.isPropertyAccessor get() =
|
|
||||||
this is IrSimpleFunction && this.correspondingPropertySymbol != null
|
|
||||||
|
|
||||||
val IrDeclaration.isPropertyField get() =
|
|
||||||
this is IrField && this.correspondingPropertySymbol != null
|
|
||||||
|
|
||||||
val IrDeclaration.isTopLevelDeclaration get() =
|
|
||||||
parent !is IrDeclaration && !this.isPropertyAccessor && !this.isPropertyField
|
|
||||||
|
|
||||||
fun IrDeclaration.findTopLevelDeclaration(): IrDeclaration = when {
|
|
||||||
this.isTopLevelDeclaration ->
|
|
||||||
this
|
|
||||||
this.isPropertyAccessor ->
|
|
||||||
(this as IrSimpleFunction).correspondingPropertySymbol!!.owner.findTopLevelDeclaration()
|
|
||||||
this.isPropertyField ->
|
|
||||||
(this as IrField).correspondingPropertySymbol!!.owner.findTopLevelDeclaration()
|
|
||||||
else ->
|
|
||||||
(this.parent as IrDeclaration).findTopLevelDeclaration()
|
|
||||||
}
|
|
||||||
|
|
||||||
internal fun IrClass.isFrozen(context: Context): Boolean {
|
internal fun IrClass.isFrozen(context: Context): Boolean {
|
||||||
val isLegacyMM = context.memoryModel != MemoryModel.EXPERIMENTAL
|
val isLegacyMM = context.memoryModel != MemoryModel.EXPERIMENTAL
|
||||||
return when {
|
return when {
|
||||||
@@ -300,6 +279,3 @@ fun IrFunction.externalSymbolOrThrow(): String? {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val IrFunction.isBuiltInOperator get() = origin == IrBuiltIns.BUILTIN_OPERATOR
|
val IrFunction.isBuiltInOperator get() = origin == IrBuiltIns.BUILTIN_OPERATOR
|
||||||
|
|
||||||
fun IrDeclaration.isFromMetadataInteropLibrary() =
|
|
||||||
descriptor.module.isFromInteropLibrary()
|
|
||||||
|
|||||||
-22
@@ -32,33 +32,11 @@ internal val String.synthesizedName get() = Name.identifier(this.synthesizedStri
|
|||||||
internal val String.synthesizedString get() = "\$$this"
|
internal val String.synthesizedString get() = "\$$this"
|
||||||
|
|
||||||
|
|
||||||
internal val DeclarationDescriptor.propertyIfAccessor
|
|
||||||
get() = if (this is PropertyAccessorDescriptor)
|
|
||||||
this.correspondingProperty
|
|
||||||
else this
|
|
||||||
|
|
||||||
internal val CallableMemberDescriptor.propertyIfAccessor
|
internal val CallableMemberDescriptor.propertyIfAccessor
|
||||||
get() = if (this is PropertyAccessorDescriptor)
|
get() = if (this is PropertyAccessorDescriptor)
|
||||||
this.correspondingProperty
|
this.correspondingProperty
|
||||||
else this
|
else this
|
||||||
|
|
||||||
internal val FunctionDescriptor.deserializedPropertyIfAccessor: DeserializedCallableMemberDescriptor
|
|
||||||
get() {
|
|
||||||
val member = this.propertyIfAccessor
|
|
||||||
if (member is DeserializedCallableMemberDescriptor)
|
|
||||||
return member
|
|
||||||
else
|
|
||||||
error("Unexpected deserializable callable descriptor")
|
|
||||||
}
|
|
||||||
|
|
||||||
internal val CallableMemberDescriptor.isDeserializableCallable
|
|
||||||
get () = (this.propertyIfAccessor is DeserializedCallableMemberDescriptor)
|
|
||||||
|
|
||||||
fun DeclarationDescriptor.findTopLevelDescriptor(): DeclarationDescriptor {
|
|
||||||
return if (this.containingDeclaration is org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor) this.propertyIfAccessor
|
|
||||||
else this.containingDeclaration!!.findTopLevelDescriptor()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun IrDeclaration.findTopLevelDeclaration(): IrDeclaration = when (val parent = this.parent) {
|
private fun IrDeclaration.findTopLevelDeclaration(): IrDeclaration = when (val parent = this.parent) {
|
||||||
is IrDeclaration -> parent.findTopLevelDeclaration()
|
is IrDeclaration -> parent.findTopLevelDeclaration()
|
||||||
else -> this
|
else -> this
|
||||||
|
|||||||
Reference in New Issue
Block a user