[FIR] Improve the control flow graph around try expressions

1. throw goes to catches instead of main exist block
2. return goes via finally (single level only supported atm)
3. collect non-direct return to retrieve all return expressions easier
This commit is contained in:
Andrey Zinovyev
2021-08-03 12:11:50 +03:00
committed by teamcityserver
parent 7b6dddf012
commit 06b23d5937
11 changed files with 80 additions and 247 deletions
@@ -113,7 +113,7 @@ fun t7() : Int {
catch (<!THROWABLE_TYPE_MISMATCH!>e : Any<!>) {
2
}
<!UNREACHABLE_CODE!>return 1<!> // this is OK, like in Java
return 1 // this is OK, like in Java
}
fun t8() : Int {
@@ -123,7 +123,7 @@ fun t8() : Int {
}
catch (<!THROWABLE_TYPE_MISMATCH!>e : Any<!>) {
return 1
2
<!UNREACHABLE_CODE!>2<!>
}
<!UNREACHABLE_CODE!>return 1<!>
}