Reordered compiler phases

Moved finally blocks, data classes and for loops
lowerings down along the pipeline
This commit is contained in:
Igor Chevdar
2019-01-28 12:04:32 +03:00
parent da12f62efe
commit 1dc8494824
2 changed files with 12 additions and 12 deletions
@@ -74,12 +74,6 @@ internal class KonanLower(val context: Context, val parentPhaser: PhaseManager)
phaser.phase(KonanPhase.LOWER_STRING_CONCAT) {
StringConcatenationLowering(context).lower(irFile)
}
phaser.phase(KonanPhase.LOWER_DATA_CLASSES) {
DataClassOperatorsLowering(context).runOnFilePostfix(irFile)
}
phaser.phase(KonanPhase.LOWER_FOR_LOOPS) {
ForLoopsLowering(context).lower(irFile)
}
phaser.phase(KonanPhase.LOWER_ENUM_CONSTRUCTORS) {
EnumConstructorsLowering(context).run(irFile)
}
@@ -96,18 +90,24 @@ internal class KonanLower(val context: Context, val parentPhaser: PhaseManager)
phaser.phase(KonanPhase.LOWER_TAILREC) {
TailrecLowering(context).runOnFilePostfix(irFile)
}
phaser.phase(KonanPhase.LOWER_FINALLY) {
FinallyBlocksLowering(context).lower(irFile)
}
phaser.phase(KonanPhase.LOWER_DEFAULT_PARAMETER_EXTENT) {
DefaultArgumentStubGenerator(context, skipInlineMethods = false).runOnFilePostfix(irFile)
KonanDefaultParameterInjector(context).lower(irFile)
}
phaser.phase(KonanPhase.LOWER_INNER_CLASSES) {
InnerClassLowering(context).runOnFilePostfix(irFile)
}
phaser.phase(KonanPhase.LOWER_FOR_LOOPS) {
ForLoopsLowering(context).lower(irFile)
}
phaser.phase(KonanPhase.LOWER_DATA_CLASSES) {
DataClassOperatorsLowering(context).runOnFilePostfix(irFile)
}
phaser.phase(KonanPhase.LOWER_BUILTIN_OPERATORS) {
BuiltinOperatorLowering(context).lower(irFile)
}
phaser.phase(KonanPhase.LOWER_INNER_CLASSES) {
InnerClassLowering(context).runOnFilePostfix(irFile)
phaser.phase(KonanPhase.LOWER_FINALLY) {
FinallyBlocksLowering(context).lower(irFile)
}
phaser.phase(KonanPhase.TEST_PROCESSOR) {
TestProcessor(context).process(irFile)
@@ -45,7 +45,7 @@ enum class KonanPhase(val description: String,
/* ... ... */ LOWER_COMPILE_TIME_EVAL("Compile time evaluation lowering", LOWER_VARARG, enabled = false),
/* ... ... */ LOWER_INNER_CLASSES("Inner classes lowering", LOWER_DEFAULT_PARAMETER_EXTENT, GEN_SYNTHETIC_FIELDS),
/* ... ... */ LOWER_BUILTIN_OPERATORS("BuiltIn Operators Lowering", LOWER_DEFAULT_PARAMETER_EXTENT),
/* ... ... */ LOWER_COROUTINES("Coroutines lowering", LOWER_LOCAL_FUNCTIONS),
/* ... ... */ LOWER_COROUTINES("Coroutines lowering", LOWER_LOCAL_FUNCTIONS, LOWER_FINALLY),
/* ... ... */ LOWER_TYPE_OPERATORS("Type operators lowering", LOWER_COROUTINES),
/* ... ... */ BRIDGES_BUILDING("Bridges building", LOWER_COROUTINES),
/* ... ... */ LOWER_STRING_CONCAT("String concatenation lowering"),