[PATCH] D69991: Implement __attribute__((objc_direct)), __attribute__((objc_direct_members))

Pierre Habouzit via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 13 14:05:47 PST 2019


MadCoder added inline comments.


================
Comment at: clang/lib/CodeGen/CGObjCMac.cpp:4076
+  if (OMD->isClassMethod()) {
+    const ObjCInterfaceDecl *OID = dyn_cast<ObjCInterfaceDecl>(CD);
+    Selector SelfSel = GetNullarySelector("self", CGM.getContext());
----------------
rjmccall wrote:
> When would the method container ever be an interface?  This is running on a method implementation; it should always be within an `ObjCImplDecl`.  (There was a case where this wasn't true for accessors, but Adrian just fixed that; regardless, you can definitely pass down an `ObjCImplDecl`.). From the `ObjCImplDecl` you can extract the class interface, which can never be null.
so it turns out the `CD` is always a classInterface because that's how things are called, so I will instead make it a cast<>


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

https://reviews.llvm.org/D69991





More information about the cfe-commits mailing list