From e4c384e99a02be9c20333ec3d5abbf37a498eecb Mon Sep 17 00:00:00 2001 From: Vasily Levchenko Date: Thu, 17 Nov 2016 14:29:44 +0300 Subject: [PATCH] replace in-place generation llvm values for true and false with constants (cherry picked from commit 4a16460b2d778e9406b805f7b6b517b162e77dd8) --- .../org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt index afa86de7433..82cab823105 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt @@ -444,8 +444,8 @@ internal class CodeGeneratorVisitor(val context: Context) : IrElementVisitorVoid when (value.kind) { IrConstKind.Null -> TODO() // LLVMConstPointerNull IrConstKind.Boolean -> when (value.value) { - true -> return LLVMConstInt(LLVMInt1Type(), 1, 1) - false -> return LLVMConstInt(LLVMInt1Type(), 0, 1) + true -> return kTrue + false -> return kFalse } IrConstKind.Char -> return LLVMConstInt(LLVMInt16Type(), (value.value as Char).toLong(), 0) IrConstKind.Byte -> return LLVMConstInt(LLVMInt8Type(), (value.value as Byte).toLong(), 1)