Jump on 'continue' to condition entry points for all loops

This commit is contained in:
Svetlana Isakova
2014-08-29 21:36:16 +04:00
parent 25a0854dbd
commit 0b4f313b6d
18 changed files with 267 additions and 23 deletions
@@ -0,0 +1,21 @@
== test ==
fun test(b: Boolean) {
for (i in 1..10) {
if (b) break;
continue;
}
}
---------------------
<v0>: Boolean NEW: magic[FAKE_INITIALIZER](b: Boolean) -> <v0>
<v4>: Int NEW: magic[LOOP_RANGE_ITERATION](1..10|<v3>) -> <v4>
1 <v1>: Int NEW: r(1) -> <v1>
10 <v2>: Int NEW: r(10) -> <v2>
1..10 <v3>: {<: Iterable<Int>} NEW: call(1..10, rangeTo|<v1>, <v2>) -> <v3>
b <v5>: Boolean NEW: r(b) -> <v5>
break !<v6>: *
if (b) break <v7>: * NEW: merge(if (b) break|!<v6>) -> <v7>
continue !<v8>: *
{ if (b) break; continue; } !<v8>: * COPY
for (i in 1..10) { if (b) break; continue; } !<v9>: *
{ for (i in 1..10) { if (b) break; continue; } } !<v9>: * COPY
=====================