
This is the code that expands array and record assignments out into multiple assignments. Having it done as a pass means it can do a better job -- this fixes some problems with cgtest56 where the old version of the code couldn't handle record assignments from literals. This is the first pass that's had to add a replicator to the tree, so this also introduces a helper function for generating new replicator counters.
13 lines
229 B
Plaintext
13 lines
229 B
Plaintext
PROC P ()
|
|
VAL size IS 32:
|
|
[100]INT src:
|
|
[32]INT dest:
|
|
SEQ
|
|
SEQ i = 0 FOR SIZE src
|
|
src[i] := i
|
|
dest := [src FROM 0 FOR size]
|
|
ASSERT ((SIZE dest) = size)
|
|
SEQ i = 0 FOR size
|
|
ASSERT (dest[i] = i)
|
|
:
|