[K/N] Refactor KonanSymbols to avoid descriptors when built over FIR

^KT-58437
This commit is contained in:
Pavel Kunyavskiy
2023-05-03 16:49:00 +02:00
committed by Space Team
parent 7f9118d0f2
commit 68a68b2763
7 changed files with 283 additions and 350 deletions
@@ -61,10 +61,10 @@ open class BuiltinSymbolsBase(val irBuiltIns: IrBuiltIns, private val symbolTabl
// The "...OrNull" variants are used for the classes below because the minimal stdlib used in tests do not include those classes.
// It was not feasible to add them to the JS reduced runtime because all its transitive dependencies also need to be
// added, which would include a lot of the full stdlib.
open val uByte = irBuiltIns.findClass(Name.identifier("UByte"), "kotlin")
open val uShort = irBuiltIns.findClass(Name.identifier("UShort"), "kotlin")
open val uInt = irBuiltIns.findClass(Name.identifier("UInt"), "kotlin")
open val uLong = irBuiltIns.findClass(Name.identifier("ULong"), "kotlin")
val uByte = irBuiltIns.findClass(Name.identifier("UByte"), "kotlin")
val uShort = irBuiltIns.findClass(Name.identifier("UShort"), "kotlin")
val uInt = irBuiltIns.findClass(Name.identifier("UInt"), "kotlin")
val uLong = irBuiltIns.findClass(Name.identifier("ULong"), "kotlin")
val uIntProgression = progressionOrNull("UIntProgression")
val uLongProgression = progressionOrNull("ULongProgression")
val uIntRange = progressionOrNull("UIntRange")
@@ -176,7 +176,7 @@ internal class UIntProgressionType(symbols: Symbols, allowUnsignedBounds: Boolea
maxValueAsLong = UInt.MAX_VALUE.toLong(),
// Uses `getProgressionLastElement(UInt, UInt, Int): UInt`
getProgressionLastElementFunction = symbols.getProgressionLastElementByReturnType[symbols.uInt!!],
unsignedType = symbols.uInt!!.defaultType,
unsignedType = symbols.uInt.defaultType,
unsignedConversionFunction = symbols.toUIntByExtensionReceiver.getValue(symbols.int)
) {
@@ -192,7 +192,7 @@ internal class ULongProgressionType(symbols: Symbols, allowUnsignedBounds: Boole
maxValueAsLong = ULong.MAX_VALUE.toLong(),
// Uses `getProgressionLastElement(ULong, ULong, Long): ULong`
getProgressionLastElementFunction = symbols.getProgressionLastElementByReturnType[symbols.uLong!!],
unsignedType = symbols.uLong!!.defaultType,
unsignedType = symbols.uLong.defaultType,
unsignedConversionFunction = symbols.toULongByExtensionReceiver.getValue(symbols.long)
) {