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

Pete Cooper via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 20 09:16:46 PST 2015


pete updated this revision to Diff 40790.
pete added a comment.

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);


http://reviews.llvm.org/D14737

Files:
  include/clang/Basic/ObjCRuntime.h
  include/clang/Driver/Options.td
  include/clang/Frontend/CodeGenOptions.def
  lib/CodeGen/CGObjC.cpp
  lib/CodeGen/CodeGenFunction.h
  lib/CodeGen/CodeGenModule.h
  lib/Driver/Tools.cpp
  lib/Frontend/CompilerInvocation.cpp
  test/CodeGenObjC/convert-messages-to-runtime-calls.m
  test/Driver/objc-convert-messages-to-runtime-calls.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14737.40790.patch
Type: text/x-patch
Size: 16276 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151120/798e0be4/attachment-0001.bin>


More information about the cfe-commits mailing list