IR: remove a KotlinType use from Ir.kt
This commit is contained in:
@@ -118,22 +118,30 @@ open class BuiltinSymbolsBase(protected val irBuiltIns: IrBuiltIns, protected va
|
|||||||
.getContributedFunctions(Name.identifier("getProgressionLastElement"), NoLookupLocation.FROM_BACKEND)
|
.getContributedFunctions(Name.identifier("getProgressionLastElement"), NoLookupLocation.FROM_BACKEND)
|
||||||
.filter { it.containingDeclaration !is BuiltInsPackageFragment }
|
.filter { it.containingDeclaration !is BuiltInsPackageFragment }
|
||||||
.map { d ->
|
.map { d ->
|
||||||
val c = d.returnType?.constructor?.declarationDescriptor?.let { symbolTable.referenceClassifier(it) }
|
val klass = d.returnType?.constructor?.declarationDescriptor?.let { symbolTable.referenceClassifier(it) }
|
||||||
val f = symbolTable.referenceSimpleFunction(d)
|
val function = symbolTable.referenceSimpleFunction(d)
|
||||||
c to f
|
klass to function
|
||||||
}.toMap()
|
}.toMap()
|
||||||
|
|
||||||
val toUIntByExtensionReceiver = builtInsPackage("kotlin").getContributedFunctions(
|
val toUIntByExtensionReceiver = builtInsPackage("kotlin").getContributedFunctions(
|
||||||
Name.identifier("toUInt"),
|
Name.identifier("toUInt"),
|
||||||
NoLookupLocation.FROM_BACKEND
|
NoLookupLocation.FROM_BACKEND
|
||||||
).filter { it.containingDeclaration !is BuiltInsPackageFragment && it.extensionReceiverParameter != null }
|
).filter { it.containingDeclaration !is BuiltInsPackageFragment && it.extensionReceiverParameter != null }
|
||||||
.map { Pair(it.extensionReceiverParameter!!.type, symbolTable.referenceSimpleFunction(it)) }.toMap()
|
.map {
|
||||||
|
val klass = symbolTable.referenceClassifier(it.extensionReceiverParameter!!.type.constructor.declarationDescriptor!!)
|
||||||
|
val function = symbolTable.referenceSimpleFunction(it)
|
||||||
|
klass to function
|
||||||
|
}.toMap()
|
||||||
|
|
||||||
val toULongByExtensionReceiver = builtInsPackage("kotlin").getContributedFunctions(
|
val toULongByExtensionReceiver = builtInsPackage("kotlin").getContributedFunctions(
|
||||||
Name.identifier("toULong"),
|
Name.identifier("toULong"),
|
||||||
NoLookupLocation.FROM_BACKEND
|
NoLookupLocation.FROM_BACKEND
|
||||||
).filter { it.containingDeclaration !is BuiltInsPackageFragment && it.extensionReceiverParameter != null }
|
).filter { it.containingDeclaration !is BuiltInsPackageFragment && it.extensionReceiverParameter != null }
|
||||||
.map { Pair(it.extensionReceiverParameter!!.type, symbolTable.referenceSimpleFunction(it)) }.toMap()
|
.map {
|
||||||
|
val klass = symbolTable.referenceClassifier(it.extensionReceiverParameter!!.type.constructor.declarationDescriptor!!)
|
||||||
|
val function = symbolTable.referenceSimpleFunction(it)
|
||||||
|
klass to function
|
||||||
|
}.toMap()
|
||||||
|
|
||||||
val any = symbolTable.referenceClass(builtIns.any)
|
val any = symbolTable.referenceClass(builtIns.any)
|
||||||
val unit = symbolTable.referenceClass(builtIns.unit)
|
val unit = symbolTable.referenceClass(builtIns.unit)
|
||||||
|
|||||||
+2
-2
@@ -201,7 +201,7 @@ internal class UIntProgressionType(symbols: Symbols<CommonBackendContext>) :
|
|||||||
// Uses `getProgressionLastElement(UInt, UInt, Int): UInt`
|
// Uses `getProgressionLastElement(UInt, UInt, Int): UInt`
|
||||||
getProgressionLastElementFunction = symbols.getProgressionLastElementByReturnType[symbols.uInt!!],
|
getProgressionLastElementFunction = symbols.getProgressionLastElementByReturnType[symbols.uInt!!],
|
||||||
unsignedType = symbols.uInt!!.defaultType,
|
unsignedType = symbols.uInt!!.defaultType,
|
||||||
unsignedConversionFunction = symbols.toUIntByExtensionReceiver.getValue(symbols.int.defaultType.toKotlinType())
|
unsignedConversionFunction = symbols.toUIntByExtensionReceiver.getValue(symbols.int)
|
||||||
) {
|
) {
|
||||||
override fun DeclarationIrBuilder.minValueExpression() = irInt(UInt.MIN_VALUE.toInt())
|
override fun DeclarationIrBuilder.minValueExpression() = irInt(UInt.MIN_VALUE.toInt())
|
||||||
|
|
||||||
@@ -219,7 +219,7 @@ internal class ULongProgressionType(symbols: Symbols<CommonBackendContext>) :
|
|||||||
// Uses `getProgressionLastElement(ULong, ULong, Long): ULong`
|
// Uses `getProgressionLastElement(ULong, ULong, Long): ULong`
|
||||||
getProgressionLastElementFunction = symbols.getProgressionLastElementByReturnType[symbols.uLong!!],
|
getProgressionLastElementFunction = symbols.getProgressionLastElementByReturnType[symbols.uLong!!],
|
||||||
unsignedType = symbols.uLong!!.defaultType,
|
unsignedType = symbols.uLong!!.defaultType,
|
||||||
unsignedConversionFunction = symbols.toULongByExtensionReceiver.getValue(symbols.long.defaultType.toKotlinType())
|
unsignedConversionFunction = symbols.toULongByExtensionReceiver.getValue(symbols.long)
|
||||||
) {
|
) {
|
||||||
override fun DeclarationIrBuilder.minValueExpression() = irLong(ULong.MIN_VALUE.toLong())
|
override fun DeclarationIrBuilder.minValueExpression() = irLong(ULong.MIN_VALUE.toLong())
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user