[PATCH] D135091: Create storage for the `_cmd` argument to the helper function for generated getters/setters of `direct` Objective-C properties.

Michael Wyman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 6 16:37:11 PDT 2022


mwyman marked 2 inline comments as done.
mwyman added inline comments.


================
Comment at: clang/lib/CodeGen/CGObjC.cpp:1116
+// for the `_cmd` argument that no longer exists for direct methods.
+static llvm::Value *emitCmdLoadForGetterSetterBody(CodeGenFunction &CGF,
+                                                   ObjCMethodDecl *MD) {
----------------
ahatanak wrote:
> Since this is loading from an uninitialized alloca, can we just pass an `undef` to the call to `objc_get/setProperty`? The optimization passes will just do that, but we can still reduce the code size at `-O0`.
Great suggestion! Done.


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

https://reviews.llvm.org/D135091



More information about the cfe-commits mailing list