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 = 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() != ObjCMethodDecl::Optional && in ParseObjCSelectorExpression()
1351 !getSourceManager().isInSystemHeader(Method->getLocation())) in ParseObjCSelectorExpression()
1454 ObjCMethodDecl *Method, in getBaseMessageSendResultType() argument
1457 assert(Method && "Must have a method"); in getBaseMessageSendResultType()
1458 if (!Method->hasRelatedResultType()) in getBaseMessageSendResultType()
1459 return Method->getSendResultType(ReceiverType); in getBaseMessageSendResultType()
1468 Method->getSendResultType(ReceiverType)->getNullability()) { in getBaseMessageSendResultType()
1486 if (Method->isInstanceMethod() && isClassMessage) in getBaseMessageSendResultType()
1488 Method->getSendResultType(ReceiverType)); in getBaseMessageSendResultType()
1509 Method->getSendResultType(ReceiverType)); in getBaseMessageSendResultType()
1519 ObjCMethodDecl *Method, in getMessageSendResultType() argument
1524 Method, in getMessageSendResultType()
1537 QualType T = Method->getSendResultType(ReceiverType); in getMessageSendResultType()
1690 const ObjCMethodDecl *Method = MsgSend->getMethodDecl(); in EmitRelatedResultTypeNote() local
1691 if (!Method) in EmitRelatedResultTypeNote()
1694 if (!Method->hasRelatedResultType()) in EmitRelatedResultTypeNote()
1698 Method->getReturnType().getNonReferenceType(), MsgSend->getType())) in EmitRelatedResultTypeNote()
1701 if (!Context.hasSameUnqualifiedType(Method->getReturnType(), in EmitRelatedResultTypeNote()
1705 Diag(Method->getLocation(), diag::note_related_result_type_inferred) in EmitRelatedResultTypeNote()
1706 << Method->isInstanceMethod() << Method->getSelector() in EmitRelatedResultTypeNote()
1712 Selector Sel, ArrayRef<SourceLocation> SelectorLocs, ObjCMethodDecl *Method, in CheckMessageArgumentTypes() argument
1722 if (!Method) { in CheckMessageArgumentTypes()
1791 ReturnType = getMessageSendResultType(Receiver, ReceiverType, Method, in CheckMessageArgumentTypes()
1793 VK = Expr::getValueKindForType(Method->getReturnType()); in CheckMessageArgumentTypes()
1798 if (Method->param_size() > Sel.getNumArgs()) in CheckMessageArgumentTypes()
1799 NumNamedArgs = Method->param_size(); in CheckMessageArgumentTypes()
1810 ReceiverType->getObjCSubstitutions(Method->getDeclContext()); in CheckMessageArgumentTypes()
1819 ParmVarDecl *param = Method->parameters()[i]; in CheckMessageArgumentTypes()
1885 if (Method->isVariadic()) { in CheckMessageArgumentTypes()
1901 << Method->getSourceRange() in CheckMessageArgumentTypes()
1907 DiagnoseSentinelCalls(Method, SelLoc, Args); in CheckMessageArgumentTypes()
1911 CheckObjCMethodCall(Method, SelLoc, ArrayRef(Args.data(), Args.size())); in CheckMessageArgumentTypes()
1918 ObjCMethodDecl *Method = in isSelfExpr() local
1920 return isSelfExpr(RExpr, Method); in isSelfExpr()
2264 ObjCInterfaceOrSuperCCC(ObjCMethodDecl *Method) { in ObjCInterfaceOrSuperCCC() argument
2266 if (Method && Method->getClassInterface()) in ObjCInterfaceOrSuperCCC()
2267 WantObjCSuper = Method->getClassInterface()->getSuperClass(); in ObjCInterfaceOrSuperCCC()
2305 if (ObjCMethodDecl *Method = getCurMethodDecl()) { in getObjCMessageKind() local
2306 if (!Method->getClassInterface()) { in getObjCMessageKind()
2312 if (Method->getClassInterface()->lookupInstanceVariable(Name, in getObjCMessageKind()
2388 ObjCMethodDecl *Method = tryCaptureObjCSelf(SuperLoc); in ActOnSuperMessage() local
2389 if (!Method) { in ActOnSuperMessage()
2394 ObjCInterfaceDecl *Class = Method->getClassInterface(); in ActOnSuperMessage()
2397 << Method->getDeclName(); in ActOnSuperMessage()
2411 if (Method->getSelector() == Sel) in ActOnSuperMessage()
2414 if (Method->isInstanceMethod()) { in ActOnSuperMessage()
2435 ObjCMethodDecl *Method, in BuildClassMessageImplicit() argument
2443 Sel, Method, Loc, Loc, Loc, Args, in BuildClassMessageImplicit()
2492 const ObjCMethodDecl *Method, in checkFoundationAPI() argument
2497 if (Method->getSelector().getMethodFamily() != OMF_performSelector || in checkFoundationAPI()
2527 << Method->getSelector() in checkFoundationAPI()
2541 ObjCMethodDecl *Method, in DiagnoseCStringFormatDirectiveInObjCAPI() argument
2551 else if (Method) { in DiagnoseCStringFormatDirectiveInObjCAPI()
2552 for (const auto *I : Method->specific_attrs<FormatAttr>()) { in DiagnoseCStringFormatDirectiveInObjCAPI()
2569 if (Method) in DiagnoseCStringFormatDirectiveInObjCAPI()
2570 S.Diag(Method->getLocation(), diag::note_method_declared_at) in DiagnoseCStringFormatDirectiveInObjCAPI()
2571 << Method->getDeclName(); in DiagnoseCStringFormatDirectiveInObjCAPI()
2608 ObjCMethodDecl *Method, in BuildClassMessage() argument
2653 if (!Method) { in BuildClassMessage()
2663 Method = LookupFactoryMethodInGlobalPool(Sel, in BuildClassMessage()
2665 if (Method && !getLangOpts().ObjCAutoRefCount) in BuildClassMessage()
2666 Diag(Method->getLocation(), diag::note_method_sent_forward_class) in BuildClassMessage()
2667 << Method->getDeclName(); in BuildClassMessage()
2669 if (!Method) in BuildClassMessage()
2670 Method = Class->lookupClassMethod(Sel); in BuildClassMessage()
2673 if (!Method) in BuildClassMessage()
2674 Method = Class->lookupPrivateClassMethod(Sel); in BuildClassMessage()
2676 if (Method && DiagnoseUseOfDecl(Method, SelectorSlotLocs, in BuildClassMessage()
2689 Method, true, SuperLoc.isValid(), LBracLoc, in BuildClassMessage()
2693 if (Method && !Method->getReturnType()->isVoidType() && in BuildClassMessage()
2694 RequireCompleteType(LBracLoc, Method->getReturnType(), in BuildClassMessage()
2698 if (Method && Method->isDirectMethod() && SuperLoc.isValid()) { in BuildClassMessage()
2703 : Method->getClassInterface()->getName()); in BuildClassMessage()
2704 Diag(Method->getLocation(), diag::note_direct_method_declared_at) in BuildClassMessage()
2705 << Method->getDeclName(); in BuildClassMessage()
2709 if (Method && Method->getMethodFamily() == OMF_initialize) { in BuildClassMessage()
2712 dyn_cast<ObjCInterfaceDecl>(Method->getDeclContext()); in BuildClassMessage()
2715 Diag(Method->getLocation(), diag::note_method_declared_at) in BuildClassMessage()
2716 << Method->getDeclName(); in BuildClassMessage()
2723 Diag(Method->getLocation(), diag::note_method_declared_at) in BuildClassMessage()
2724 << Method->getDeclName(); in BuildClassMessage()
2731 DiagnoseCStringFormatDirectiveInObjCAPI(*this, Method, Sel, Args, NumArgs); in BuildClassMessage()
2738 ReceiverType, Sel, SelectorLocs, Method, ArrayRef(Args, NumArgs), in BuildClassMessage()
2743 Method, ArrayRef(Args, NumArgs), RBracLoc, isImplicit); in BuildClassMessage()
2747 if (Method) in BuildClassMessage()
2748 checkFoundationAPI(*this, SelLoc, Method, ArrayRef(Args, NumArgs), in BuildClassMessage()
2781 ObjCMethodDecl *Method, in BuildInstanceMessageImplicit() argument
2785 Sel, Method, Loc, Loc, Loc, Args, in BuildInstanceMessageImplicit()
2839 ObjCMethodDecl *Method, in BuildInstanceMessage() argument
2941 if (!Method) { in BuildInstanceMessage()
2956 Method = Methods[0]; in BuildInstanceMessage()
2959 SelectBestMethod(Sel, ArgsIn, Method->isInstanceMethod(), Methods)) in BuildInstanceMessage()
2960 Method = BestMethod; in BuildInstanceMessage()
2962 if (!AreMultipleMethodsInGlobalPool(Sel, Method, in BuildInstanceMessage()
2965 DiagnoseUseOfDecl(Method, SelectorSlotLocs); in BuildInstanceMessage()
2977 Method = LookupMethodInQualifiedType(Sel, QClassTy, false); in BuildInstanceMessage()
2978 if (!Method) { in BuildInstanceMessage()
2979 Method = LookupMethodInQualifiedType(Sel, QClassTy, true); in BuildInstanceMessage()
2981 if (Method && !isMethodDeclaredInRootProtocol(*this, Method)) { in BuildInstanceMessage()
2983 << Method->getSelector() << Sel; in BuildInstanceMessage()
2984 Diag(Method->getLocation(), diag::note_method_declared_at) in BuildInstanceMessage()
2985 << Method->getDeclName(); in BuildInstanceMessage()
2995 Method = ClassDecl->lookupClassMethod(Sel); in BuildInstanceMessage()
2997 if (!Method) in BuildInstanceMessage()
2998 Method = ClassDecl->lookupPrivateClassMethod(Sel); in BuildInstanceMessage()
3000 if (Method && DiagnoseUseOfDecl(Method, SelectorSlotLocs)) in BuildInstanceMessage()
3004 if (!Method) { in BuildInstanceMessage()
3016 Method = Methods[0]; in BuildInstanceMessage()
3019 if (Method->isInstanceMethod()) { in BuildInstanceMessage()
3021 dyn_cast<ObjCInterfaceDecl>(Method->getDeclContext())) { in BuildInstanceMessage()
3029 SelectBestMethod(Sel, ArgsIn, Method->isInstanceMethod(), in BuildInstanceMessage()
3031 Method = BestMethod; in BuildInstanceMessage()
3045 Method = LookupMethodInQualifiedType(Sel, QIdTy, true); in BuildInstanceMessage()
3046 if (!Method) in BuildInstanceMessage()
3047 Method = LookupMethodInQualifiedType(Sel, QIdTy, false); in BuildInstanceMessage()
3048 if (Method && DiagnoseUseOfDecl(Method, SelectorSlotLocs)) in BuildInstanceMessage()
3071 Method = nullptr; in BuildInstanceMessage()
3073 Method = ClassDecl->lookupInstanceMethod(Sel); in BuildInstanceMessage()
3076 if (!Method) in BuildInstanceMessage()
3078 Method = LookupMethodInQualifiedType(Sel, OCIType, true); in BuildInstanceMessage()
3080 if (!Method) { in BuildInstanceMessage()
3082 Method = ClassDecl->lookupPrivateMethod(Sel); in BuildInstanceMessage()
3084 if (!Method && getLangOpts().ObjCAutoRefCount) { in BuildInstanceMessage()
3091 if (!Method && (!Receiver || !isSelfExpr(Receiver))) { in BuildInstanceMessage()
3103 Method = Methods[0]; in BuildInstanceMessage()
3106 SelectBestMethod(Sel, ArgsIn, Method->isInstanceMethod(), in BuildInstanceMessage()
3108 Method = BestMethod; in BuildInstanceMessage()
3110 AreMultipleMethodsInGlobalPool(Sel, Method, in BuildInstanceMessage()
3115 if (Method && !forwardClass) in BuildInstanceMessage()
3122 if (Method && DiagnoseUseOfDecl(Method, SelectorSlotLocs, forwardClass)) in BuildInstanceMessage()
3133 (Method && Method->getMethodFamily() == OMF_init) in BuildInstanceMessage()
3136 if (Method && Method->isDirectMethod()) { in BuildInstanceMessage()
3140 Diag(Method->getLocation(), diag::note_direct_method_declared_at) in BuildInstanceMessage()
3141 << Method->getDeclName(); in BuildInstanceMessage()
3154 RecRange, Method->getClassInterface()->getName())); in BuildInstanceMessage()
3157 Diag(Method->getLocation(), diag::note_direct_method_declared_at) in BuildInstanceMessage()
3158 << Method->getDeclName(); in BuildInstanceMessage()
3167 SuperLoc, Method->getClassInterface()->getName())); in BuildInstanceMessage()
3172 Diag(Method->getLocation(), diag::note_direct_method_declared_at) in BuildInstanceMessage()
3173 << Method->getDeclName(); in BuildInstanceMessage()
3230 Method, ClassMessage, SuperLoc.isValid(), in BuildInstanceMessage()
3234 if (Method && !Method->getReturnType()->isVoidType() && in BuildInstanceMessage()
3235 RequireCompleteType(LBracLoc, Method->getReturnType(), in BuildInstanceMessage()
3243 (Method ? Method->getMethodFamily() : Sel.getMethodFamily()); in BuildInstanceMessage()
3246 if (Method) in BuildInstanceMessage()
3247 checkInitMethod(Method, ReceiverType); in BuildInstanceMessage()
3270 if (Method && NumArgs >= 1) { in BuildInstanceMessage()
3320 DiagnoseCStringFormatDirectiveInObjCAPI(*this, Method, Sel, Args, NumArgs); in BuildInstanceMessage()
3327 ReceiverType, Sel, SelectorLocs, Method, ArrayRef(Args, NumArgs), in BuildInstanceMessage()
3331 Context, ReturnType, VK, LBracLoc, Receiver, Sel, SelectorLocs, Method, in BuildInstanceMessage()
3336 if (Method) { in BuildInstanceMessage()
3353 checkFoundationAPI(*this, SelLoc, Method, ArrayRef(Args, NumArgs), in BuildInstanceMessage()
3378 if (!isImplicit && Method) { in BuildInstanceMessage()
3379 if (const ObjCPropertyDecl *Prop = Method->findPropertyDecl()) { in BuildInstanceMessage()