Pseudocode: Generate instructions for unresolved array assignments

This commit is contained in:
Alexey Sedunov
2014-10-06 16:35:16 +04:00
parent b06b3ab4c4
commit a56c54371e
12 changed files with 220 additions and 5 deletions
@@ -0,0 +1,17 @@
== A ==
class A
---------------------
=====================
== foo ==
fun foo(a: A) {
a[0] += 1
}
---------------------
<v0>: A NEW: magic[FAKE_INITIALIZER](a: A) -> <v0>
a <v1>: * NEW: r(a) -> <v1>
0 <v2>: * NEW: r(0) -> <v2>
a[0] <v3>: * NEW: magic[UNRESOLVED_CALL](a[0]|<v1>, <v2>) -> <v3>
1 <v4>: * NEW: r(1) -> <v4>
a[0] += 1 <v5>: * NEW: magic[UNRESOLVED_CALL](a[0] += 1|<v3>, <v4>) -> <v5>
{ a[0] += 1 } <v5>: * COPY
=====================