
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.
16 lines
246 B
Plaintext
16 lines
246 B
Plaintext
PROC P ()
|
|
DATA TYPE FOO
|
|
RECORD
|
|
INT a:
|
|
BYTE b:
|
|
REAL32 c:
|
|
:
|
|
VAL FOO src IS [111, 222, 333.3]:
|
|
FOO dest:
|
|
SEQ
|
|
dest := src
|
|
ASSERT (dest[a] = src[a])
|
|
ASSERT (dest[b] = src[b])
|
|
ASSERT (dest[c] = src[c])
|
|
:
|