[analyzer] Refactor codes in findMethodDecl()
In findMethodDecl(clang::ObjCMessageExpr const *, clang::ObjCObjectPointerType const *, clang::ASTContext &), if the MessageExpr->getReceiverKind() is not Instance or Class, we never dereference pointer “ReceiverObjectPtrType”. Also, we don't dereference the pointer “ReceiverObjectPtrType” if ReceiverType is ObjCIdType or ObhjCClassType. So the pointer “ReceiverObjectPtrType”is only used in this branch and the declaration should be here. This patch directly uses ReceiverType->castAs<ObjCObjectPointerType>() instead of ReceiverObjectPtrType when calling canAssignObjCInterfaces() to express the intent more clearly. Reviewed By: erichkeane, steakhal Differential Revision: https://reviews.llvm.org/D152194
parent
310a6f12
Please register or sign in to comment