[K/N][IR] Fixed wrong type in IR around ImmutableBlob
This commit is contained in:
+1
@@ -109,6 +109,7 @@ internal class KonanSymbols(
|
|||||||
val nativePtrType = nativePtr.typeWith(arguments = emptyList())
|
val nativePtrType = nativePtr.typeWith(arguments = emptyList())
|
||||||
|
|
||||||
val immutableBlobOf = nativeFunction(IMMUTABLE_BLOB_OF)
|
val immutableBlobOf = nativeFunction(IMMUTABLE_BLOB_OF)
|
||||||
|
val immutableBlobOfImpl = internalFunction("immutableBlobOfImpl")
|
||||||
|
|
||||||
val signedIntegerClasses = setOf(byte, short, int, long)
|
val signedIntegerClasses = setOf(byte, short, int, long)
|
||||||
val unsignedIntegerClasses = setOf(uByte!!, uShort!!, uInt!!, uLong!!)
|
val unsignedIntegerClasses = setOf(uByte!!, uShort!!, uInt!!, uLong!!)
|
||||||
|
|||||||
+4
-4
@@ -15,6 +15,7 @@ import org.jetbrains.kotlin.backend.konan.renderCompilerError
|
|||||||
import org.jetbrains.kotlin.ir.builders.IrBuilderWithScope
|
import org.jetbrains.kotlin.ir.builders.IrBuilderWithScope
|
||||||
import org.jetbrains.kotlin.ir.builders.irCall
|
import org.jetbrains.kotlin.ir.builders.irCall
|
||||||
import org.jetbrains.kotlin.ir.builders.irCallWithSubstitutedType
|
import org.jetbrains.kotlin.ir.builders.irCallWithSubstitutedType
|
||||||
|
import org.jetbrains.kotlin.ir.builders.irString
|
||||||
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
|
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
|
||||||
import org.jetbrains.kotlin.ir.declarations.IrDeclarationBase
|
import org.jetbrains.kotlin.ir.declarations.IrDeclarationBase
|
||||||
import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction
|
import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction
|
||||||
@@ -91,10 +92,9 @@ internal class PostInlineLowering(val context: Context) : BodyLoweringPass {
|
|||||||
// Basic Multilingual Plane, so we could just append data "as is".
|
// Basic Multilingual Plane, so we could just append data "as is".
|
||||||
builder.append(value.toInt().toChar())
|
builder.append(value.toInt().toChar())
|
||||||
}
|
}
|
||||||
expression.putValueArgument(0, IrConstImpl(
|
return data.irCall(context.ir.symbols.immutableBlobOfImpl).apply {
|
||||||
expression.startOffset, expression.endOffset,
|
putValueArgument(0, data.irString(builder.toString()))
|
||||||
context.irBuiltIns.stringType,
|
}
|
||||||
IrConstKind.String, builder.toString()))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return expression
|
return expression
|
||||||
|
|||||||
@@ -264,3 +264,7 @@ internal fun KonanObjectToUtf8Array(value: Any?): ByteArray {
|
|||||||
}
|
}
|
||||||
return string.encodeToByteArray()
|
return string.encodeToByteArray()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PublishedApi
|
||||||
|
@TypedIntrinsic(IntrinsicType.IMMUTABLE_BLOB)
|
||||||
|
internal external fun immutableBlobOfImpl(data: String): ImmutableBlob
|
||||||
|
|||||||
Reference in New Issue
Block a user