[PATCH] D14737: Convert some ObjC msgSends to runtime calls

John McCall via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 20 13:10:58 PST 2015


rjmccall added a comment.

In http://reviews.llvm.org/D14737#293967, @pete wrote:

> Added a couple of tests for retain returning types other than id.  Returning a pointer should still be converted to a call, while returning a non-pointer such as float will get a message instead.
>
> I walked through the code in the debugger to check on the return cast.  Turns out it is handled at the very end of emitARCValueOperation as follows:
>
>  
>   // Cast the result back to the original type.
>   return CGF.Builder.CreateBitCast(call, origType);


Right, that'll cast back to the original type.  That will be the type of the receiver of the message, which is not necessarily the type of the result of the message.


http://reviews.llvm.org/D14737





More information about the cfe-commits mailing list