Inline Return Statement

void function() {
        /* frame setup code */
        ...

        if(cond) {
                ...
                goto leave;
        }
        ...

leave:
        /* frame clean-up code */
        ...
        return;
}

void function() {
        /* frame setup code */
        ...

        if(cond) {
                ...
                /* frame clean-up code */
                ...
                return;
        }
        ...

        /* frame clean-up code */
        ...
        return;
}

Motivation

When a function has multiple return statements the compiler unifies these statements in a single return statement, to avoid unnecessary duplication of the clean-up code. A jump, however, does not have the same semantic meaning of a return statement, being sometimes preferable the latter for better code comprehension.

Mechanics