Lines Matching refs:Method
150 Selector Sel, const ObjCMethodDecl *Method) { in validateBoxingMethod() argument
151 if (!Method) { in validateBoxingMethod()
158 QualType ReturnType = Method->getReturnType(); in validateBoxingMethod()
162 S.Diag(Method->getLocation(), diag::note_objc_literal_method_return) in validateBoxingMethod()
284 ObjCMethodDecl *Method = S.NSNumberDecl->lookupClassMethod(Sel); in getNSNumberFactoryMethod() local
285 if (!Method && S.getLangOpts().DebuggerObjCLiteral) { in getNSNumberFactoryMethod()
288 Method = ObjCMethodDecl::Create( in getNSNumberFactoryMethod()
297 ParmVarDecl *value = ParmVarDecl::Create(S.Context, Method, in getNSNumberFactoryMethod()
302 Method->setMethodParams(S.Context, value, std::nullopt); in getNSNumberFactoryMethod()
305 if (!validateBoxingMethod(S, Loc, S.NSNumberDecl, Sel, Method)) in getNSNumberFactoryMethod()
311 S.NSNumberLiteralMethods[*Kind] = Method; in getNSNumberFactoryMethod()
312 return Method; in getNSNumberFactoryMethod()
346 ObjCMethodDecl *Method = getNSNumberFactoryMethod(*this, AtLoc, NumberType, in BuildObjCNumericLiteral() local
348 if (!Method) in BuildObjCNumericLiteral()
352 ParmVarDecl *ParamDecl = Method->parameters()[0]; in BuildObjCNumericLiteral()
364 new (Context) ObjCBoxedExpr(Number, NSNumberPointer, Method, in BuildObjCNumericLiteral()
810 ObjCMethodDecl *Method = NSArrayDecl->lookupClassMethod(Sel); in BuildObjCArrayLiteral() local
811 if (!Method && getLangOpts().DebuggerObjCLiteral) { in BuildObjCArrayLiteral()
813 Method = ObjCMethodDecl::Create( in BuildObjCArrayLiteral()
821 ParmVarDecl *objects = ParmVarDecl::Create(Context, Method, in BuildObjCArrayLiteral()
829 ParmVarDecl *cnt = ParmVarDecl::Create(Context, Method, in BuildObjCArrayLiteral()
837 Method->setMethodParams(Context, Params, std::nullopt); in BuildObjCArrayLiteral()
840 if (!validateBoxingMethod(*this, Loc, NSArrayDecl, Sel, Method)) in BuildObjCArrayLiteral()
844 QualType T = Method->parameters()[0]->getType(); in BuildObjCArrayLiteral()
850 Diag(Method->parameters()[0]->getLocation(), in BuildObjCArrayLiteral()
858 if (!Method->parameters()[1]->getType()->isIntegerType()) { in BuildObjCArrayLiteral()
861 Diag(Method->parameters()[1]->getLocation(), in BuildObjCArrayLiteral()
864 << Method->parameters()[1]->getType() in BuildObjCArrayLiteral()
870 ArrayWithObjectsMethod = Method; in BuildObjCArrayLiteral()
972 ObjCMethodDecl *Method = NSDictionaryDecl->lookupClassMethod(Sel); in BuildObjCDictionaryLiteral() local
973 if (!Method && getLangOpts().DebuggerObjCLiteral) { in BuildObjCDictionaryLiteral()
974 Method = ObjCMethodDecl::Create( in BuildObjCDictionaryLiteral()
983 ParmVarDecl *objects = ParmVarDecl::Create(Context, Method, in BuildObjCDictionaryLiteral()
991 ParmVarDecl *keys = ParmVarDecl::Create(Context, Method, in BuildObjCDictionaryLiteral()
999 ParmVarDecl *cnt = ParmVarDecl::Create(Context, Method, in BuildObjCDictionaryLiteral()
1007 Method->setMethodParams(Context, Params, std::nullopt); in BuildObjCDictionaryLiteral()
1011 Method)) in BuildObjCDictionaryLiteral()
1015 QualType ValueT = Method->parameters()[0]->getType(); in BuildObjCDictionaryLiteral()
1021 Diag(Method->parameters()[0]->getLocation(), in BuildObjCDictionaryLiteral()
1029 QualType KeyT = Method->parameters()[1]->getType(); in BuildObjCDictionaryLiteral()
1055 Diag(Method->parameters()[1]->getLocation(), in BuildObjCDictionaryLiteral()
1064 QualType CountType = Method->parameters()[2]->getType(); in BuildObjCDictionaryLiteral()
1068 Diag(Method->parameters()[2]->getLocation(), in BuildObjCDictionaryLiteral()
1076 DictionaryWithObjectsMethod = Method; in BuildObjCDictionaryLiteral()
1177 ObjCMethodDecl *Method, in HelperToDiagnoseMismatchedMethodsInGlobalPool() argument
1183 if (MatchingMethodDecl == Method || in HelperToDiagnoseMismatchedMethodsInGlobalPool()
1185 MatchingMethodDecl->getSelector() != Method->getSelector()) in HelperToDiagnoseMismatchedMethodsInGlobalPool()
1187 if (!S.MatchTwoMethodDeclarations(Method, in HelperToDiagnoseMismatchedMethodsInGlobalPool()
1192 << Method->getSelector() << FixItHint::CreateInsertion(LParenLoc, "(") in HelperToDiagnoseMismatchedMethodsInGlobalPool()
1194 S.Diag(Method->getLocation(), diag::note_method_declared_at) in HelperToDiagnoseMismatchedMethodsInGlobalPool()
1195 << Method->getDeclName(); in HelperToDiagnoseMismatchedMethodsInGlobalPool()
1205 ObjCMethodDecl *Method, in DiagnoseMismatchedSelectors() argument
1218 Method, InstMethList)) in DiagnoseMismatchedSelectors()
1224 Method, ClsMethList) || Warned) in DiagnoseMismatchedSelectors()
1237 ObjCMethodDecl *Method = M->getMethod(); in LookupDirectMethodInMethodList() local
1238 if (!Method) in LookupDirectMethodInMethodList()
1240 assert(Method->getSelector() == Sel && "Method with wrong selector in method list"); in LookupDirectMethodInMethodList()
1241 if (Method->isDirectMethod()) { in LookupDirectMethodInMethodList()
1243 DirectMethod = Method; in LookupDirectMethodInMethodList()
1297 ObjCMethodDecl *Method = LookupInstanceMethodInGlobalPool(Sel, in ParseObjCSelectorExpression() local
1299 if (!Method) in ParseObjCSelectorExpression()
1300 Method = LookupFactoryMethodInGlobalPool(Sel, in ParseObjCSelectorExpression()
1302 if (!Method) { in ParseObjCSelectorExpression()
1314 DiagnoseMismatchedSelectors(*this, AtLoc, Method, LParenLoc, RParenLoc, in ParseObjCSelectorExpression()
1324 << Method->getSelector(); in ParseObjCSelectorExpression()
1325 Diag(Method->getLocation(), diag::note_direct_method_declared_at) in ParseObjCSelectorExpression()
1326 << Method->getDeclName(); in ParseObjCSelectorExpression()
1349 if (Method && in ParseObjCSelectorExpression()
1350 Method->getImplementationControl() != in ParseObjCSelectorExpression()
1352 !getSourceManager().isInSystemHeader(Method->getLocation())) in ParseObjCSelectorExpression()
1455 ObjCMethodDecl *Method, in getBaseMessageSendResultType() argument
1458 assert(Method && "Must have a method"); in getBaseMessageSendResultType()
1459 if (!Method->hasRelatedResultType()) in getBaseMessageSendResultType()
1460 return Method->getSendResultType(ReceiverType); in getBaseMessageSendResultType()
1469 Method->getSendResultType(ReceiverType)->getNullability()) { in getBaseMessageSendResultType()
1487 if (Method->isInstanceMethod() && isClassMessage) in getBaseMessageSendResultType()
1489 Method->getSendResultType(ReceiverType)); in getBaseMessageSendResultType()
1510 Method->getSendResultType(ReceiverType)); in getBaseMessageSendResultType()
1520 ObjCMethodDecl *Method, in getMessageSendResultType() argument
1525 Method, in getMessageSendResultType()
1538 QualType T = Method->getSendResultType(ReceiverType); in getMessageSendResultType()
1691 const ObjCMethodDecl *Method = MsgSend->getMethodDecl(); in EmitRelatedResultTypeNote() local
1692 if (!Method) in EmitRelatedResultTypeNote()
1695 if (!Method->hasRelatedResultType()) in EmitRelatedResultTypeNote()
1699 Method->getReturnType().getNonReferenceType(), MsgSend->getType())) in EmitRelatedResultTypeNote()
1702 if (!Context.hasSameUnqualifiedType(Method->getReturnType(), in EmitRelatedResultTypeNote()
1706 Diag(Method->getLocation(), diag::note_related_result_type_inferred) in EmitRelatedResultTypeNote()
1707 << Method->isInstanceMethod() << Method->getSelector() in EmitRelatedResultTypeNote()
1713 Selector Sel, ArrayRef<SourceLocation> SelectorLocs, ObjCMethodDecl *Method, in CheckMessageArgumentTypes() argument
1723 if (!Method) { in CheckMessageArgumentTypes()
1792 ReturnType = getMessageSendResultType(Receiver, ReceiverType, Method, in CheckMessageArgumentTypes()
1794 VK = Expr::getValueKindForType(Method->getReturnType()); in CheckMessageArgumentTypes()
1799 if (Method->param_size() > Sel.getNumArgs()) in CheckMessageArgumentTypes()
1800 NumNamedArgs = Method->param_size(); in CheckMessageArgumentTypes()
1812 ReceiverType->getObjCSubstitutions(Method->getDeclContext()); in CheckMessageArgumentTypes()
1821 ParmVarDecl *param = Method->parameters()[i]; in CheckMessageArgumentTypes()
1887 if (Method->isVariadic()) { in CheckMessageArgumentTypes()
1903 << Method->getSourceRange() << /*is non object*/ 0 in CheckMessageArgumentTypes()
1909 DiagnoseSentinelCalls(Method, SelLoc, Args); in CheckMessageArgumentTypes()
1913 CheckObjCMethodCall(Method, SelLoc, ArrayRef(Args.data(), Args.size())); in CheckMessageArgumentTypes()
1920 ObjCMethodDecl *Method = in isSelfExpr() local
1922 return isSelfExpr(RExpr, Method); in isSelfExpr()
2266 ObjCInterfaceOrSuperCCC(ObjCMethodDecl *Method) { in ObjCInterfaceOrSuperCCC() argument
2268 if (Method && Method->getClassInterface()) in ObjCInterfaceOrSuperCCC()
2269 WantObjCSuper = Method->getClassInterface()->getSuperClass(); in ObjCInterfaceOrSuperCCC()
2307 if (ObjCMethodDecl *Method = getCurMethodDecl()) { in getObjCMessageKind() local
2308 if (!Method->getClassInterface()) { in getObjCMessageKind()
2314 if (Method->getClassInterface()->lookupInstanceVariable(Name, in getObjCMessageKind()
2390 ObjCMethodDecl *Method = tryCaptureObjCSelf(SuperLoc); in ActOnSuperMessage() local
2391 if (!Method) { in ActOnSuperMessage()
2396 ObjCInterfaceDecl *Class = Method->getClassInterface(); in ActOnSuperMessage()
2399 << Method->getDeclName(); in ActOnSuperMessage()
2413 if (Method->getSelector() == Sel) in ActOnSuperMessage()
2416 if (Method->isInstanceMethod()) { in ActOnSuperMessage()
2437 ObjCMethodDecl *Method, in BuildClassMessageImplicit() argument
2448 Sel, Method, Loc, Loc, Loc, Args, in BuildClassMessageImplicit()
2497 const ObjCMethodDecl *Method, in checkFoundationAPI() argument
2502 if (Method->getSelector().getMethodFamily() != OMF_performSelector || in checkFoundationAPI()
2532 << Method->getSelector() in checkFoundationAPI()
2546 ObjCMethodDecl *Method, in DiagnoseCStringFormatDirectiveInObjCAPI() argument
2556 else if (Method) { in DiagnoseCStringFormatDirectiveInObjCAPI()
2557 for (const auto *I : Method->specific_attrs<FormatAttr>()) { in DiagnoseCStringFormatDirectiveInObjCAPI()
2574 if (Method) in DiagnoseCStringFormatDirectiveInObjCAPI()
2575 S.Diag(Method->getLocation(), diag::note_method_declared_at) in DiagnoseCStringFormatDirectiveInObjCAPI()
2576 << Method->getDeclName(); in DiagnoseCStringFormatDirectiveInObjCAPI()
2613 ObjCMethodDecl *Method, in BuildClassMessage() argument
2658 if (!Method) { in BuildClassMessage()
2668 Method = LookupFactoryMethodInGlobalPool(Sel, in BuildClassMessage()
2670 if (Method && !getLangOpts().ObjCAutoRefCount) in BuildClassMessage()
2671 Diag(Method->getLocation(), diag::note_method_sent_forward_class) in BuildClassMessage()
2672 << Method->getDeclName(); in BuildClassMessage()
2674 if (!Method) in BuildClassMessage()
2675 Method = Class->lookupClassMethod(Sel); in BuildClassMessage()
2678 if (!Method) in BuildClassMessage()
2679 Method = Class->lookupPrivateClassMethod(Sel); in BuildClassMessage()
2681 if (Method && DiagnoseUseOfDecl(Method, SelectorSlotLocs, in BuildClassMessage()
2694 Method, true, SuperLoc.isValid(), LBracLoc, in BuildClassMessage()
2698 if (Method && !Method->getReturnType()->isVoidType() && in BuildClassMessage()
2699 RequireCompleteType(LBracLoc, Method->getReturnType(), in BuildClassMessage()
2703 if (Method && Method->isDirectMethod() && SuperLoc.isValid()) { in BuildClassMessage()
2708 : Method->getClassInterface()->getName()); in BuildClassMessage()
2709 Diag(Method->getLocation(), diag::note_direct_method_declared_at) in BuildClassMessage()
2710 << Method->getDeclName(); in BuildClassMessage()
2714 if (Method && Method->getMethodFamily() == OMF_initialize) { in BuildClassMessage()
2717 dyn_cast<ObjCInterfaceDecl>(Method->getDeclContext()); in BuildClassMessage()
2720 Diag(Method->getLocation(), diag::note_method_declared_at) in BuildClassMessage()
2721 << Method->getDeclName(); in BuildClassMessage()
2728 Diag(Method->getLocation(), diag::note_method_declared_at) in BuildClassMessage()
2729 << Method->getDeclName(); in BuildClassMessage()
2736 DiagnoseCStringFormatDirectiveInObjCAPI(*this, Method, Sel, Args, NumArgs); in BuildClassMessage()
2743 ReceiverType, Sel, SelectorLocs, Method, ArrayRef(Args, NumArgs), in BuildClassMessage()
2748 Method, ArrayRef(Args, NumArgs), RBracLoc, isImplicit); in BuildClassMessage()
2752 if (Method) in BuildClassMessage()
2753 checkFoundationAPI(*this, SelLoc, Method, ArrayRef(Args, NumArgs), in BuildClassMessage()
2786 ObjCMethodDecl *Method, in BuildInstanceMessageImplicit() argument
2790 Sel, Method, Loc, Loc, Loc, Args, in BuildInstanceMessageImplicit()
2844 ObjCMethodDecl *Method, in BuildInstanceMessage() argument
2946 if (!Method) { in BuildInstanceMessage()
2961 Method = Methods[0]; in BuildInstanceMessage()
2964 SelectBestMethod(Sel, ArgsIn, Method->isInstanceMethod(), Methods)) in BuildInstanceMessage()
2965 Method = BestMethod; in BuildInstanceMessage()
2967 if (!AreMultipleMethodsInGlobalPool(Sel, Method, in BuildInstanceMessage()
2970 DiagnoseUseOfDecl(Method, SelectorSlotLocs); in BuildInstanceMessage()
2982 Method = LookupMethodInQualifiedType(Sel, QClassTy, false); in BuildInstanceMessage()
2983 if (!Method) { in BuildInstanceMessage()
2984 Method = LookupMethodInQualifiedType(Sel, QClassTy, true); in BuildInstanceMessage()
2986 if (Method && !isMethodDeclaredInRootProtocol(*this, Method)) { in BuildInstanceMessage()
2988 << Method->getSelector() << Sel; in BuildInstanceMessage()
2989 Diag(Method->getLocation(), diag::note_method_declared_at) in BuildInstanceMessage()
2990 << Method->getDeclName(); in BuildInstanceMessage()
3000 Method = ClassDecl->lookupClassMethod(Sel); in BuildInstanceMessage()
3002 if (!Method) in BuildInstanceMessage()
3003 Method = ClassDecl->lookupPrivateClassMethod(Sel); in BuildInstanceMessage()
3005 if (Method && DiagnoseUseOfDecl(Method, SelectorSlotLocs)) in BuildInstanceMessage()
3009 if (!Method) { in BuildInstanceMessage()
3021 Method = Methods[0]; in BuildInstanceMessage()
3024 if (Method->isInstanceMethod()) { in BuildInstanceMessage()
3026 dyn_cast<ObjCInterfaceDecl>(Method->getDeclContext())) { in BuildInstanceMessage()
3034 SelectBestMethod(Sel, ArgsIn, Method->isInstanceMethod(), in BuildInstanceMessage()
3036 Method = BestMethod; in BuildInstanceMessage()
3050 Method = LookupMethodInQualifiedType(Sel, QIdTy, true); in BuildInstanceMessage()
3051 if (!Method) in BuildInstanceMessage()
3052 Method = LookupMethodInQualifiedType(Sel, QIdTy, false); in BuildInstanceMessage()
3053 if (Method && DiagnoseUseOfDecl(Method, SelectorSlotLocs)) in BuildInstanceMessage()
3076 Method = nullptr; in BuildInstanceMessage()
3078 Method = ClassDecl->lookupInstanceMethod(Sel); in BuildInstanceMessage()
3081 if (!Method) in BuildInstanceMessage()
3083 Method = LookupMethodInQualifiedType(Sel, OCIType, true); in BuildInstanceMessage()
3085 if (!Method) { in BuildInstanceMessage()
3087 Method = ClassDecl->lookupPrivateMethod(Sel); in BuildInstanceMessage()
3089 if (!Method && getLangOpts().ObjCAutoRefCount) { in BuildInstanceMessage()
3096 if (!Method && (!Receiver || !isSelfExpr(Receiver))) { in BuildInstanceMessage()
3108 Method = Methods[0]; in BuildInstanceMessage()
3111 SelectBestMethod(Sel, ArgsIn, Method->isInstanceMethod(), in BuildInstanceMessage()
3113 Method = BestMethod; in BuildInstanceMessage()
3115 AreMultipleMethodsInGlobalPool(Sel, Method, in BuildInstanceMessage()
3120 if (Method && !forwardClass) in BuildInstanceMessage()
3127 if (Method && DiagnoseUseOfDecl(Method, SelectorSlotLocs, forwardClass)) in BuildInstanceMessage()
3138 (Method && Method->getMethodFamily() == OMF_init) in BuildInstanceMessage()
3141 if (Method && Method->isDirectMethod()) { in BuildInstanceMessage()
3145 Diag(Method->getLocation(), diag::note_direct_method_declared_at) in BuildInstanceMessage()
3146 << Method->getDeclName(); in BuildInstanceMessage()
3159 RecRange, Method->getClassInterface()->getName())); in BuildInstanceMessage()
3162 Diag(Method->getLocation(), diag::note_direct_method_declared_at) in BuildInstanceMessage()
3163 << Method->getDeclName(); in BuildInstanceMessage()
3172 SuperLoc, Method->getClassInterface()->getName())); in BuildInstanceMessage()
3177 Diag(Method->getLocation(), diag::note_direct_method_declared_at) in BuildInstanceMessage()
3178 << Method->getDeclName(); in BuildInstanceMessage()
3235 Method, ClassMessage, SuperLoc.isValid(), in BuildInstanceMessage()
3239 if (Method && !Method->getReturnType()->isVoidType() && in BuildInstanceMessage()
3240 RequireCompleteType(LBracLoc, Method->getReturnType(), in BuildInstanceMessage()
3248 (Method ? Method->getMethodFamily() : Sel.getMethodFamily()); in BuildInstanceMessage()
3251 if (Method) in BuildInstanceMessage()
3252 checkInitMethod(Method, ReceiverType); in BuildInstanceMessage()
3275 if (Method && NumArgs >= 1) { in BuildInstanceMessage()
3325 DiagnoseCStringFormatDirectiveInObjCAPI(*this, Method, Sel, Args, NumArgs); in BuildInstanceMessage()
3332 ReceiverType, Sel, SelectorLocs, Method, ArrayRef(Args, NumArgs), in BuildInstanceMessage()
3336 Context, ReturnType, VK, LBracLoc, Receiver, Sel, SelectorLocs, Method, in BuildInstanceMessage()
3341 if (Method) { in BuildInstanceMessage()
3358 checkFoundationAPI(*this, SelLoc, Method, ArrayRef(Args, NumArgs), in BuildInstanceMessage()
3383 if (!isImplicit && Method) { in BuildInstanceMessage()
3384 if (const ObjCPropertyDecl *Prop = Method->findPropertyDecl()) { in BuildInstanceMessage()