Migrate deprecations in Native compiler
Replacing deprecated Char.toInt() with Char.code and Number.toChar() with Number.toInt().toChar(), where Number is not Int. KT-23451
This commit is contained in:
+1
-1
@@ -128,7 +128,7 @@ internal class Int16(val value: Short) : ConstValue {
|
||||
}
|
||||
|
||||
internal class Char16(val value: Char) : ConstValue {
|
||||
override val llvm = LLVMConstInt(int16Type, value.toLong(), 1)!!
|
||||
override val llvm = LLVMConstInt(int16Type, value.code.toLong(), 1)!!
|
||||
}
|
||||
|
||||
internal class Int32(val value: Int) : ConstValue {
|
||||
|
||||
+1
-1
@@ -173,6 +173,6 @@ internal class StaticData(override val context: Context): ContextUtils {
|
||||
* @param args data for constant creation.
|
||||
*/
|
||||
internal fun StaticData.createImmutableBlob(value: IrConst<String>): LLVMValueRef {
|
||||
val args = value.value.map { Int8(it.toByte()).llvm }
|
||||
val args = value.value.map { Int8(it.code.toByte()).llvm }
|
||||
return createConstKotlinArray(context.ir.symbols.immutableBlob.owner, args)
|
||||
}
|
||||
+1
-1
@@ -87,7 +87,7 @@ internal class PostInlineLowering(val context: Context) : BodyLoweringPass {
|
||||
// Luckily, all values in range 0x00 .. 0xff represent valid UTF-16 symbols,
|
||||
// block 0 (Basic Latin) and block 1 (Latin-1 Supplement) in
|
||||
// Basic Multilingual Plane, so we could just append data "as is".
|
||||
builder.append(value.toChar())
|
||||
builder.append(value.toInt().toChar())
|
||||
}
|
||||
expression.putValueArgument(0, IrConstImpl(
|
||||
expression.startOffset, expression.endOffset,
|
||||
|
||||
Reference in New Issue
Block a user