Mark some expressions after processing their components

when it's semantically correct

Expressions: calls, 'for' loops, elvis operators
It's significant for reporting 'unreachable code' correctly
This commit is contained in:
Svetlana Isakova
2014-06-12 12:58:57 +04:00
parent 6e622f2301
commit 9480907514
39 changed files with 181 additions and 178 deletions
@@ -8,18 +8,18 @@ fun main() {
L0:
1 <START>
2 mark({ while(0 > 1) { 2 } })
mark(while(0 > 1) { 2 })
L2 [loop entry point]:
L5 [condition entry point]:
mark(0 > 1) PREV:[mark(while(0 > 1) { 2 }), jmp(L2 [loop entry point])]
r(0) -> <v0>
r(0) -> <v0> PREV:[mark({ while(0 > 1) { 2 } }), jmp(L2 [loop entry point])]
r(1) -> <v1>
mark(0 > 1)
call(>, compareTo|<v0>, <v1>) -> <v2>
mark(while(0 > 1) { 2 })
jf(L3 [loop exit point]|<v2>) NEXT:[read (Unit), mark({ 2 })]
L4 [body entry point]:
3 mark({ 2 })
r(2) -> <v3>
2 jmp(L2 [loop entry point]) NEXT:[mark(0 > 1)]
2 jmp(L2 [loop entry point]) NEXT:[r(0) -> <v0>]
L3 [loop exit point]:
read (Unit) PREV:[jf(L3 [loop exit point]|<v2>)]
L1:
@@ -44,9 +44,9 @@ L4 [body entry point]:
mark({return})
ret L1 NEXT:[<END>]
L5 [condition entry point]:
- mark(0 > 1) PREV:[]
- r(0) -> <v0> PREV:[]
- r(1) -> <v1> PREV:[]
- mark(0 > 1) PREV:[]
- call(>, compareTo|<v0>, <v1>) -> <v2> PREV:[]
- jt(L2 [loop entry point]|<v2>) NEXT:[read (Unit), mark({return})] PREV:[]
L3 [loop exit point]: