replace in-place generation llvm values for true and false with constants

(cherry picked from commit 4a16460b2d778e9406b805f7b6b517b162e77dd8)
This commit is contained in:
Vasily Levchenko
2016-11-17 14:29:44 +03:00
parent fa7bcd90e3
commit e4c384e99a
@@ -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)