Pseudocode: Generate read instructions on call expression (instead of

callee)
This commit is contained in:
Alexey Sedunov
2014-07-25 15:22:58 +04:00
parent 9f3ebe5f3b
commit 85bb4f9b8e
6 changed files with 48 additions and 8 deletions
@@ -0,0 +1,19 @@
== foo ==
fun foo(i: Int) {
i()
}
---------------------
L0:
1 <START>
v(i: Int)
magic[FAKE_INITIALIZER](i: Int) -> <v0>
w(i|<v0>)
2 mark({ i() })
r(i) -> <v1>
L1:
1 <END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
@@ -0,0 +1,3 @@
fun foo(i: Int) {
i()
}
@@ -0,0 +1,10 @@
== foo ==
fun foo(i: Int) {
i()
}
---------------------
<v0>: Int NEW: magic[FAKE_INITIALIZER](i: Int) -> <v0>
i <v1>: * NEW: r(i) -> <v1>
i() !<v2>: *
{ i() } !<v2>: * COPY
=====================