[PATCH] D92808: [ObjC][ARC] Annotate calls with attributes instead of emitting retainRV or claimRV calls in the IR

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 8 14:28:53 PST 2020


rjmccall added a comment.

Your patch description doesn't mention the changes to the inliner.



================
Comment at: clang/lib/CodeGen/CGObjC.cpp:2282
 
+static const char *markerKey = "clang.arc.retainAutoreleasedReturnValueMarker";
+
----------------
This is too generic for a global variable name.

It should also be `const`.


================
Comment at: clang/lib/CodeGen/CGObjC.cpp:2328
+      CGF.CGM.getTarget().getTriple().isAArch64() &&
+      !CGF.CGM.getTarget().getTriple().isOSWindows()) {
+    auto *callBase = cast<llvm::CallBase>(value);
----------------
It would be good to explain why this is target-specific in a comment.


================
Comment at: clang/lib/CodeGen/CGObjC.cpp:2334
+                               IsRetainRV ? "retainRV" : "claimRV");
+    if (CGF.CGM.getModule().getModuleFlag(markerKey))
+      attrs = attrs.addAttribute(CGF.getLLVMContext(),
----------------
Didn't we just add this?  Can that fail to add the marker?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92808



More information about the cfe-commits mailing list