This patch changes the way Environment::ReturnLoc is set: Whereas previously it was set by the caller, it is now set by the callee (obviously, as we otherwise would not be able to return references).
The patch also introduces Environment::ReturnVal, which is used for non-reference-type return values. This allows these to be handled with the correct value category semantics; see also https://discourse.llvm.org/t/70086, which describes the ongoing migration to strict value category semantics.
Depends On D150776
I know that Obj-C is a non-goal, but it might worth a comment to support ObjCMessageExpr just in case someone wants to work on this.
Btw, this is one of my biggest pet peeves about the Clang AST. We should have a common abstraction for all the callables, instead of having to bifurcate many of the APIs.