From 872deb205c744f4881b5e15db3bfbd6c8fc4516e Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Fri, 24 Aug 2018 16:36:15 +0300 Subject: [PATCH] Improve implicit widening conversion to unsigned integer --- .../org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt | 7 ++----- 1 file changed, 2 insertions(+), 5 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 daf253a34c6..de0f2f223a6 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 @@ -1272,8 +1272,7 @@ internal class CodeGeneratorVisitor(val context: Context, val lifetimes: Map result srcWidth > dstWidth -> LLVMBuildTrunc(functionGenerationContext.builder, result, llvmDstType, "")!! - /* srcWidth < dstWidth */ - typeIsUnsigned -> LLVMBuildZExt(functionGenerationContext.builder, result, llvmDstType, "")!! - else -> LLVMBuildSExt(functionGenerationContext.builder, result, llvmDstType, "")!! + else /* srcWidth < dstWidth */ -> LLVMBuildSExt(functionGenerationContext.builder, result, llvmDstType, "")!! } }