AstGen: properly generate errdefer expressions when returning

`return` statements use a new function `nodeMayEvalToError` which does
some basic checks on the AST node to return never, always, or maybe.

Depending on this result, AstGen skips the errdefers, always includes
the errdefers, or emits a conditional branch to check whether the return
value is an error that Sema will have to evaluate.

Closes #8821
Unblocks #9047
6ce8440987Andrew Kelley committed on 6/18/2021, 5:44:17 AMparentccb6e16
1 file changedLine totals unavailable