SILGen: Simplify SILGenFunction::emitClosure()

This commit is contained in:
Slava Pestov
2019-12-12 13:23:40 -05:00
parent 1401cbaf2b
commit 62d1adb409

View File

@@ -513,10 +513,7 @@ void SILGenFunction::emitClosure(AbstractClosureExpr *ace) {
emitStmt(ce->getBody());
} else {
auto *autoclosure = cast<AutoClosureExpr>(ace);
// Closure expressions implicitly return the result of their body
// expression.
emitReturnExpr(ImplicitReturnLocation(ace),
autoclosure->getSingleExpressionBody());
emitStmt(autoclosure->getBody());
}
emitEpilog(ace);
}