Convert SwitchCodegen to Kotlin, prettify and optimize codegen

This commit is contained in:
Denis Zharkov
2018-02-13 12:05:54 +03:00
parent 806faf86b7
commit 5a591be25f
8 changed files with 190 additions and 246 deletions

View File

@@ -9,6 +9,6 @@ fun box(): String {
return if (b) "OK" else "FAIL"
}
// 0 TABLESWITCH
// 1 LOOKUPSWITCH
// 1 ATHROW
// 1 TABLESWITCH
// 0 LOOKUPSWITCH
// 1 ATHROW

View File

@@ -7,6 +7,6 @@ fun box(): String {
}
}
// 0 TABLESWITCH
// 1 LOOKUPSWITCH
// 1 TABLESWITCH
// 0 LOOKUPSWITCH
// 1 ATHROW

View File

@@ -12,5 +12,4 @@ fun foo2(x: Int): Boolean {
}
}
// 0 TABLESWITCH
// 2 LOOKUPSWITCH
// 2 TABLESWITCH

View File

@@ -18,4 +18,4 @@ fun box() : String {
}
}
// 1 LOOKUPSWITCH
// 1 TABLESWITCH

View File

@@ -24,4 +24,4 @@ fun box(): String {
return res
}
// 1 LOOKUPSWITCH
// 1 TABLESWITCH

View File

@@ -24,4 +24,4 @@ fun box(): String {
return "O".doTheThing() + Level.K.doTheThing()
}
// 1 LOOKUPSWITCH
// 1 TABLESWITCH