User Tools

Site Tools


goto-transform

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
goto-transform [2013/09/17 17:19]
joshi
goto-transform [2013/09/17 17:25] (current)
joshi
Line 241: Line 241:
 </​code>​ </​code>​
 **All these methods are destructive and may change properties of instructions of prog2** **All these methods are destructive and may change properties of instructions of prog2**
 +
 +=== Updating a goto-program ====
 +**Important** : It is very important that once all the changes/​transformation of a goto-program is done
 +the ''​update()''​ method be called on it.
 +
 +<code CPP>
 +prog.update();​
 +</​code>​
 +Since, goto-programs makes heavy use of iterators (for jump instructions/​branching)),​ the ''​update''​ method makes sure that labels of targets are appropriately adjusted. It also updates the ''​location_number''​ field of all the instructions. ''​location_number''​ could be very useful in debugging.
 +
  
goto-transform.txt ยท Last modified: 2013/09/17 17:25 by joshi