next up previous
Next: for Up: Loop Peeling: An Example Previous: while

do

For a do loop, we'll convert the following

        do {
                body;
        } while (cond);

into the following:

        body;
        if (cond) {
                do {
                        body;
                } while (cond);
        }

Again, the semantics are preserved; the body of a do must be executed at least once; after that, if the conditional, cond, is still true, we continue with the do loop.



Calvin Lin
2002-01-31