[PATCH] D61970: [CodeGen][ObjC] Call objc_autoreleaseReturnValue and objc_retainAutoreleasedReturnValue instead of objc_autorelease and objc_retain in MRR

David Kilzer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 15 21:07:58 PDT 2019


ddkilzer added a comment.

Had a couple questions about using `objc_retainAutoreleasedReturnValue` without a `return` statement.  (I'm just reading this from a layman's point of view; it may not actually matter in practice.)



================
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}}
----------------
Silly question:  Should `objc_retainAutoreleasedReturnValue` really be called here when the value is not used in a `return` statement?


================
Comment at: test/CodeGenObjC/convert-messages-to-runtime-calls.m:169
   // MSGS: {{call.*@objc_msgSend}}
-  // CALLS: {{call.*@objc_retain}}
+  // CALLS-ARC-INTRINSICS: {{call.*@llvm.objc.retainAutoreleasedReturnValue}}
+  // CALLS-NO-ARC-INTRINSICS: {{call.*@objc_retain}}
----------------
Same silly question:  Should `objc_retainAutoreleasedReturnValue` really be called here when the value is not used in a `return` statement?


Repository:
  rC Clang

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

https://reviews.llvm.org/D61970





More information about the cfe-commits mailing list