Eliminate dead code in lists of statements.
(statement-list-dead stmts) → new-stmt
- stmts — Guard (statement-listp stmts).
- new-stmt — Type (statement-listp new-stmt).
We go through the statements, recursively transforming them.
If we reach a break, continue, or leave we stop,
dropping the remaining statements.
This is correct because
there cannot be function definitions among the statements,
as discussed in dead-code-eliminator.
Without this assumption,
we would still have to retain the function definitions
after the break, continue, or leave.