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
1fe0142d1fAndrew Kelley committed on 6/20/2021, 11:25:52 PMparent76102ea
1 file changedLine totals unavailable