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[1] = 2
}
---------------------
<v0>: A NEW: magic[FAKE_INITIALIZER](a: A) -> <v0>
a <v1>: * NEW: r(a) -> <v1>
1 <v2>: * NEW: r(1) -> <v2>
a[1] <v3>: * NEW: magic[UNRESOLVED_CALL](a[1]|<v1>, <v2>) -> <v3>
2 <v4>: * NEW: r(2) -> <v4>
a[1] = 2 <v5>: * NEW: magic[UNRESOLVED_CALL](a[1] = 2|<v3>, <v4>) -> <v5>
{ a[1] = 2 } <v5>: * COPY
=====================