rjmccall accepted this revision. rjmccall added inline comments. This revision is now accepted and ready to land.
================ Comment at: clang/lib/CodeGen/CGObjC.cpp:475-483 case ObjCMessageExpr::Class: { ReceiverType = E->getClassReceiver(); const ObjCObjectType *ObjTy = ReceiverType->getAs<ObjCObjectType>(); assert(ObjTy && "Invalid Objective-C class message send"); OID = ObjTy->getInterface(); assert(OID && "Invalid Objective-C class message send"); Receiver = Runtime.GetClass(*this, OID); ---------------- erik.pilkington wrote: > > Also, I think getInterface() can return null here, although it might need > > to be contrived to fit the other requirements. Class<SomeProtocol>, where > > that protocol declares +alloc? If there isn't a way to just emit the > > receiver pointer of a normal message send from an ObjCMessageExpr, that's > > really too bad. > > Are you sure? It looks like we unconditionally dereference getInterface() > here, and we would take this path if not for the new check above. It looks like `ObjCMessageExpr::Class` is only for messages to type names, and Sema rejects types in that case that aren't just an ObjC class, so you're right, I misunderstood. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57936/new/ https://reviews.llvm.org/D57936 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits