[objc_direct] fix codegen for mismatched Decl/Impl return types

Authored by MadCoder on Jan 22 2020, 8:46 AM.

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.


[objc_direct] fix codegen for mismatched Decl/Impl return types

For non direct methods, the codegen uses the type of the Implementation.
Because Objective-C rules allow some differences between the Declaration
and Implementation return types, when the Implementation is in this
translation unit, the type of the Implementation should be preferred to
emit the Function over the Declaration.

Radar-Id: rdar://problem/58797748
Signed-off-by: Pierre Habouzit <phabouzit@apple.com>
Differential Revision: https://reviews.llvm.org/D73208
(cherry picked from commit 6eb969b7c5b5195d7f85b70e2e060eb2989cdc3c)