[FIR] Implement JvmTypeMapper based on cone types

This commit is contained in:
Dmitriy Novozhilov
2020-09-23 17:07:55 +03:00
parent a28d0e0b7f
commit b343d05e14
4 changed files with 134 additions and 0 deletions
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.fir.symbols
import org.jetbrains.kotlin.builtins.StandardNames
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
@@ -74,6 +75,14 @@ object StandardClassIds {
val unsignedTypes = listOf(UByte, UShort, UInt, ULong)
val unsignedArrayTypeByElementType = unsignedTypes.associate { id -> id to id.shortClassName.primitiveArrayId() }
val elementTypeByUnsignedArrayType = unsignedArrayTypeByElementType.inverseMap()
val Continuation =
ClassId(StandardNames.COROUTINES_PACKAGE_FQ_NAME_RELEASE, StandardNames.CONTINUATION_INTERFACE_FQ_NAME_RELEASE.shortName())
@Suppress("FunctionName")
fun FunctionN(n: Int): ClassId {
return "Function$n".baseId()
}
}
private fun <K, V> Map<K, V>.inverseMap() = entries.associate { (k, v) -> v to k }