- mature_immBlock(body_block);
- mature_immBlock(false_block);
- mature_immBlock(step_block);
- mature_immBlock(header_block);
- mature_immBlock(false_block);
+ /* Create the step block, if necessary. */
+ ir_node * step_block = header_block;
+ expression_t *const step = statement->step;
+ if (step != NULL) {
+ step_block = new_immBlock();
+ }
+
+ ir_node *const old_continue_label = continue_label;
+ ir_node *const old_break_label = break_label;
+ continue_label = step_block;
+ break_label = false_block;
+
+ /* Create the loop body. */
+ set_cur_block(body_block);
+ statement_to_firm(statement->body);
+ jump_if_reachable(step_block);
+
+ /* Create the step code. */
+ if (step != NULL) {
+ mature_immBlock(step_block);
+ set_cur_block(step_block);
+ expression_to_firm(step);
+ jump_if_reachable(header_block);
+ }