ahatanak added inline comments.

================
Comment at: test/CodeGenObjC/convert-messages-to-runtime-calls.m:32
   // CALLS: {{call.*@objc_allocWithZone}}
-  // CALLS: {{call.*@objc_retain}}
+  // CALLS-ARC-INTRINSICS: {{call.*@llvm.objc.retainAutoreleasedReturnValue}}
+  // CALLS-NO-ARC-INTRINSICS: {{call.*@objc_retain}}
----------------
ddkilzer wrote:
> Silly question:  Should `objc_retainAutoreleasedReturnValue` really be called 
> here when the value is not used in a `return` statement?
ARC optimizer has an optimization that converts a call to 
`objc_retainAutoreleasedReturnValue` to a call to `objc_retain` when it doesn't 
use the result of a call.

http://llvm.org/doxygen/ObjCARCOpts_8cpp_source.html

Also, it converts a call to `objc_autoreleaseReturnValue` to a call to 
`objc_autorelease` when its result isn't used by a return instruction.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61970/new/

https://reviews.llvm.org/D61970



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to