Replaces for loop with an equivalent construct based on a while loop:
for (init; cond; step) { //... continue; //... //... } Copy
for (init; cond; step) { //... continue; //... //... }
becomes
{ init; while (cond) { // ... goto __for_loop_step_${step_label_suffix}; // ... // ... __for_loop_step_${step_label_suffix}: step; } } Copy
{ init; while (cond) { // ... goto __for_loop_step_${step_label_suffix}; // ... // ... __for_loop_step_${step_label_suffix}: step; } }
For-loop joinpoint
Suffix to attach to the for loop step label, added in case there are continue statements to account for
continue
The newly created replacement joinpoint
Replaces for loop with an equivalent construct based on a while loop:
becomes