Move building of "not empty" condition (used to check if loop is empty)

from ForLoopsLowering into ForLoopHeader, reducing the building logic in
ForLoopsLowering.
This commit is contained in:
Mark Punzalan
2019-03-19 22:57:21 -07:00
committed by max-kammerer
parent a2e3d3635e
commit 7b153b2b68
9 changed files with 94 additions and 93 deletions
@@ -279,6 +279,9 @@ fun IrBuilderWithScope.irImplicitCast(argument: IrExpression, type: IrType) =
fun IrBuilderWithScope.irInt(value: Int) =
IrConstImpl.int(startOffset, endOffset, context.irBuiltIns.intType, value)
fun IrBuilderWithScope.irLong(value: Long) =
IrConstImpl.long(startOffset, endOffset, context.irBuiltIns.longType, value)
fun IrBuilderWithScope.irString(value: String) =
IrConstImpl.string(startOffset, endOffset, context.irBuiltIns.stringType, value)
@@ -181,7 +181,7 @@ class IrBuiltIns(
// TODO switch to IrType
val primitiveTypes = listOf(bool, char, byte, short, int, long, float, double)
val primitiveTypesWithComparisons = listOf(int, long, float, double)
val primitiveTypesWithComparisons = listOf(char, byte, short, int, long, float, double)
val primitiveFloatingPointTypes = listOf(float, double)
val lessFunByOperandType = primitiveTypesWithComparisons.defineComparisonOperatorForEachType(OperatorNames.LESS)