KotlinMangler: added IrType.isInlined
Added possibility to specify when IrType corresponds to an inline class
This commit is contained in:
+2
-2
@@ -21,7 +21,7 @@ interface KotlinMangler {
|
|||||||
val IrDeclaration.hashedMangle: Long
|
val IrDeclaration.hashedMangle: Long
|
||||||
fun IrDeclaration.isExported(): Boolean
|
fun IrDeclaration.isExported(): Boolean
|
||||||
val IrFunction.functionName: String
|
val IrFunction.functionName: String
|
||||||
|
val IrType.isInlined: Boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class KotlinManglerImpl: KotlinMangler {
|
abstract class KotlinManglerImpl: KotlinMangler {
|
||||||
@@ -155,7 +155,7 @@ abstract class KotlinManglerImpl: KotlinMangler {
|
|||||||
val signatureSuffix =
|
val signatureSuffix =
|
||||||
when {
|
when {
|
||||||
this.typeParameters.isNotEmpty() -> "Generic"
|
this.typeParameters.isNotEmpty() -> "Generic"
|
||||||
returnType.isInlined() -> "ValueType"
|
returnType.isInlined -> "ValueType"
|
||||||
!returnType.isUnitOrNullableUnit() -> typeToHashString(returnType)
|
!returnType.isUnitOrNullableUnit() -> typeToHashString(returnType)
|
||||||
else -> ""
|
else -> ""
|
||||||
}
|
}
|
||||||
|
|||||||
+5
@@ -6,9 +6,14 @@
|
|||||||
package org.jetbrains.kotlin.ir.backend.js.lower.serialization.ir
|
package org.jetbrains.kotlin.ir.backend.js.lower.serialization.ir
|
||||||
|
|
||||||
import org.jetbrains.kotlin.backend.common.serialization.KotlinManglerImpl
|
import org.jetbrains.kotlin.backend.common.serialization.KotlinManglerImpl
|
||||||
|
import org.jetbrains.kotlin.ir.types.IrType
|
||||||
|
import org.jetbrains.kotlin.ir.util.isInlined
|
||||||
|
|
||||||
object JsMangler: KotlinManglerImpl() {
|
object JsMangler: KotlinManglerImpl() {
|
||||||
// TODO: think about this
|
// TODO: think about this
|
||||||
override val String.hashMangle: Long get() = this.hashCode().toLong()
|
override val String.hashMangle: Long get() = this.hashCode().toLong()
|
||||||
|
|
||||||
|
override val IrType.isInlined: Boolean
|
||||||
|
get() = this.isInlined()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user