More review fixes
This commit is contained in:
committed by
Pavel Punegov
parent
45985d9a7f
commit
46f75c2226
+10
-13
@@ -46,7 +46,6 @@ import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.SimpleType
|
||||
import org.jetbrains.kotlin.types.TypeUtils
|
||||
import org.jetbrains.kotlin.types.typeUtil.isNothing
|
||||
import org.jetbrains.kotlin.types.typeUtil.isPrimitiveNumberType
|
||||
@@ -2343,27 +2342,25 @@ internal class CodeGeneratorVisitor(val context: Context, val lifetimes: Map<IrE
|
||||
val ib = context.irModule!!.irBuiltins
|
||||
|
||||
with(functionGenerationContext) {
|
||||
val arg0 = args[0]
|
||||
val arg1 = args[1]
|
||||
return when {
|
||||
descriptor == ib.eqeqeq -> icmpEq(arg0, arg1)
|
||||
descriptor == ib.booleanNot -> icmpNe(arg0, kTrue)
|
||||
descriptor == ib.eqeqeq -> icmpEq(args[0], args[1])
|
||||
descriptor == ib.booleanNot -> icmpNe(args[0], kTrue)
|
||||
|
||||
descriptor.isComparisonDescriptor(ib.greaterFunByOperandType) -> {
|
||||
if (arg0.type.isFloatingPoint()) fcmpGt(arg0, arg1)
|
||||
else icmpGt(arg0, arg1)
|
||||
if (args[0].type.isFloatingPoint()) fcmpGt(args[0], args[1])
|
||||
else icmpGt(args[0], args[1])
|
||||
}
|
||||
descriptor.isComparisonDescriptor(ib.greaterOrEqualFunByOperandType) -> {
|
||||
if (arg0.type.isFloatingPoint()) fcmpGe(arg0, arg1)
|
||||
else icmpGe(arg0, arg1)
|
||||
if (args[0].type.isFloatingPoint()) fcmpGe(args[0], args[1])
|
||||
else icmpGe(args[0], args[1])
|
||||
}
|
||||
descriptor.isComparisonDescriptor(ib.lessFunByOperandType) -> {
|
||||
if (arg0.type.isFloatingPoint()) fcmpLt(arg0, arg1)
|
||||
else icmpLt(arg0, arg1)
|
||||
if (args[0].type.isFloatingPoint()) fcmpLt(args[0], args[1])
|
||||
else icmpLt(args[0], args[1])
|
||||
}
|
||||
descriptor.isComparisonDescriptor(ib.lessOrEqualFunByOperandType) -> {
|
||||
if (arg0.type.isFloatingPoint()) fcmpLe(arg0, arg1)
|
||||
else icmpLe(arg0, arg1)
|
||||
if (args[0].type.isFloatingPoint()) fcmpLe(args[0], args[1])
|
||||
else icmpLe(args[0], args[1])
|
||||
}
|
||||
else -> TODO(descriptor.name.toString())
|
||||
}
|
||||
|
||||
+2
-2
@@ -441,7 +441,7 @@ private class ForLoopsTransformer(val context: Context) : IrElementTransformerVo
|
||||
putValueArgument(0, minConst)
|
||||
}
|
||||
putValueArgument(0, compareToCall)
|
||||
putValueArgument(1, IrConstImpl.int(startOffset, endOffset, context.builtIns.intType, 0))
|
||||
putValueArgument(1, irInt(0))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -459,7 +459,7 @@ private class ForLoopsTransformer(val context: Context) : IrElementTransformerVo
|
||||
|
||||
val check: IrExpression = irCall(comparingBuiltIn!!).apply {
|
||||
putValueArgument(0, irCallOp(compareTo, irGet(forLoopInfo.inductionVariable), irGet(forLoopInfo.last)))
|
||||
putValueArgument(1, IrConstImpl.int(startOffset, endOffset, context.builtIns.intType, 0))
|
||||
putValueArgument(1, irInt(0))
|
||||
}
|
||||
|
||||
// Process closed and open ranges in different manners.
|
||||
|
||||
@@ -21,12 +21,11 @@ import kotlin.coroutines.experimental.intrinsics.*
|
||||
|
||||
@Intrinsic
|
||||
@PublishedApi
|
||||
internal external fun <T> getContinuation(): Continuation<T> = throw AssertionError("Call to getContinuation should've been lowered")
|
||||
internal external fun <T> getContinuation(): Continuation<T>
|
||||
|
||||
@Intrinsic
|
||||
@PublishedApi
|
||||
internal external suspend fun <T> returnIfSuspended(@Suppress("UNUSED_PARAMETER") argument: Any?): T
|
||||
= throw AssertionError("Call to returnIfSuspended should've been lowered")
|
||||
|
||||
// Single-threaded continuation.
|
||||
class SafeContinuation<in T>
|
||||
|
||||
Reference in New Issue
Block a user