[IR] support of changes in progression handlers and for loop lowerings in 8a4185202f

This commit is contained in:
Vasily Levchenko
2019-10-30 20:19:55 +01:00
parent 494d5ce1a4
commit f1aca2307f
4 changed files with 16 additions and 1 deletions
@@ -282,6 +282,7 @@ internal val allLoweringsPhase = namedIrModulePhase(
name = "IrLowerByFile",
description = "IR Lowering by file",
lower = lateinitPhase then
forLoopsPhase then
stringConcatenationPhase then
enumConstructorsPhase then
initializersPhase then
@@ -290,7 +291,6 @@ internal val allLoweringsPhase = namedIrModulePhase(
tailrecPhase then
defaultParameterExtentPhase then
innerClassPhase then
forLoopsPhase then
dataClassesPhase then
builtinOperatorPhase then
finallyBlocksPhase then
@@ -230,6 +230,9 @@ internal class KonanSymbols(
val throwInvalidReceiverTypeException = internalFunction("ThrowInvalidReceiverTypeException")
val throwIllegalStateException = internalFunction("ThrowIllegalStateException")
val throwIllegalStateExceptionWithMessage = internalFunction("ThrowIllegalStateExceptionWithMessage")
val throwIllegalArgumentException = internalFunction("ThrowIllegalArgumentException")
val throwIllegalArgumentExceptionWithMessage = internalFunction("ThrowIllegalArgumentExceptionWithMessage")
override val ThrowUninitializedPropertyAccessException = internalFunction("ThrowUninitializedPropertyAccessException")
@@ -2195,6 +2195,13 @@ internal class CodeGeneratorVisitor(val context: Context, val lifetimes: Map<IrE
else -> icmpLe(args[0], args[1])
}
}
functionSymbol == context.irBuiltIns.illegalArgumentExceptionSymbol -> {
callDirect(
context.ir.symbols.throwIllegalArgumentExceptionWithMessage.owner,
args,
Lifetime.GLOBAL
)
}
else -> TODO(function.name.toString())
}
}
@@ -61,6 +61,11 @@ internal fun ThrowIllegalArgumentException() : Nothing {
throw IllegalArgumentException()
}
@ExportForCppRuntime
internal fun ThrowIllegalArgumentExceptionWithMessage(message: String) : Nothing {
throw IllegalArgumentException(message)
}
@ExportForCppRuntime
internal fun ThrowIllegalStateException() : Nothing {
throw IllegalStateException()