控制流的翻译
case While(cond, body) =>
val exit = fv.freshLabel
loop(emitExpr(cond), emitStmt(body)(ctx, exit :: loopExits, fv), exit)private def loop(test: => Temp, block: => Unit, exit: Label)
(implicit fv: FuncVisitor): Unitwhile (cond) {
block
}entry:
cond = do test
if (cond == 0) branch exit
do block
branch entry
exit:Last updated
Was this helpful?