Lines Matching refs:Method

155                                  Selector Sel, const ObjCMethodDecl *Method) {  in validateBoxingMethod()  argument
156 if (!Method) { in validateBoxingMethod()
163 QualType ReturnType = Method->getReturnType(); in validateBoxingMethod()
167 S.Diag(Method->getLocation(), diag::note_objc_literal_method_return) in validateBoxingMethod()
290 ObjCMethodDecl *Method = S.NSNumberDecl->lookupClassMethod(Sel); in getNSNumberFactoryMethod() local
291 if (!Method && S.getLangOpts().DebuggerObjCLiteral) { in getNSNumberFactoryMethod()
294 Method = ObjCMethodDecl::Create( in getNSNumberFactoryMethod()
304 ParmVarDecl::Create(S.SemaRef.Context, Method, SourceLocation(), in getNSNumberFactoryMethod()
307 Method->setMethodParams(S.SemaRef.Context, value, std::nullopt); in getNSNumberFactoryMethod()
310 if (!validateBoxingMethod(S.SemaRef, Loc, S.NSNumberDecl, Sel, Method)) in getNSNumberFactoryMethod()
316 S.NSNumberLiteralMethods[*Kind] = Method; in getNSNumberFactoryMethod()
317 return Method; in getNSNumberFactoryMethod()
353 ObjCMethodDecl *Method = getNSNumberFactoryMethod(*this, AtLoc, NumberType, in BuildObjCNumericLiteral() local
355 if (!Method) in BuildObjCNumericLiteral()
359 ParmVarDecl *ParamDecl = Method->parameters()[0]; in BuildObjCNumericLiteral()
370 Number, NSNumberPointer, Method, SourceRange(AtLoc, NR.getEnd()))); in BuildObjCNumericLiteral()
818 ObjCMethodDecl *Method = NSArrayDecl->lookupClassMethod(Sel); in BuildObjCArrayLiteral() local
819 if (!Method && getLangOpts().DebuggerObjCLiteral) { in BuildObjCArrayLiteral()
821 Method = ObjCMethodDecl::Create( in BuildObjCArrayLiteral()
829 ParmVarDecl *objects = ParmVarDecl::Create(Context, Method, in BuildObjCArrayLiteral()
837 ParmVarDecl *cnt = ParmVarDecl::Create(Context, Method, in BuildObjCArrayLiteral()
845 Method->setMethodParams(Context, Params, std::nullopt); in BuildObjCArrayLiteral()
848 if (!validateBoxingMethod(SemaRef, Loc, NSArrayDecl, Sel, Method)) in BuildObjCArrayLiteral()
852 QualType T = Method->parameters()[0]->getType(); in BuildObjCArrayLiteral()
858 Diag(Method->parameters()[0]->getLocation(), in BuildObjCArrayLiteral()
866 if (!Method->parameters()[1]->getType()->isIntegerType()) { in BuildObjCArrayLiteral()
869 Diag(Method->parameters()[1]->getLocation(), in BuildObjCArrayLiteral()
872 << Method->parameters()[1]->getType() in BuildObjCArrayLiteral()
878 ArrayWithObjectsMethod = Method; in BuildObjCArrayLiteral()
979 ObjCMethodDecl *Method = NSDictionaryDecl->lookupClassMethod(Sel); in BuildObjCDictionaryLiteral() local
980 if (!Method && getLangOpts().DebuggerObjCLiteral) { in BuildObjCDictionaryLiteral()
981 Method = ObjCMethodDecl::Create( in BuildObjCDictionaryLiteral()
990 ParmVarDecl *objects = ParmVarDecl::Create(Context, Method, in BuildObjCDictionaryLiteral()
998 ParmVarDecl *keys = ParmVarDecl::Create(Context, Method, in BuildObjCDictionaryLiteral()
1006 ParmVarDecl *cnt = ParmVarDecl::Create(Context, Method, in BuildObjCDictionaryLiteral()
1014 Method->setMethodParams(Context, Params, std::nullopt); in BuildObjCDictionaryLiteral()
1018 Method)) in BuildObjCDictionaryLiteral()
1022 QualType ValueT = Method->parameters()[0]->getType(); in BuildObjCDictionaryLiteral()
1028 Diag(Method->parameters()[0]->getLocation(), in BuildObjCDictionaryLiteral()
1036 QualType KeyT = Method->parameters()[1]->getType(); in BuildObjCDictionaryLiteral()
1062 Diag(Method->parameters()[1]->getLocation(), in BuildObjCDictionaryLiteral()
1071 QualType CountType = Method->parameters()[2]->getType(); in BuildObjCDictionaryLiteral()
1075 Diag(Method->parameters()[2]->getLocation(), in BuildObjCDictionaryLiteral()
1083 DictionaryWithObjectsMethod = Method; in BuildObjCDictionaryLiteral()
1186 ObjCMethodDecl *Method, in HelperToDiagnoseMismatchedMethodsInGlobalPool() argument
1192 if (MatchingMethodDecl == Method || in HelperToDiagnoseMismatchedMethodsInGlobalPool()
1194 MatchingMethodDecl->getSelector() != Method->getSelector()) in HelperToDiagnoseMismatchedMethodsInGlobalPool()
1196 if (!S.ObjC().MatchTwoMethodDeclarations(Method, MatchingMethodDecl, in HelperToDiagnoseMismatchedMethodsInGlobalPool()
1201 << Method->getSelector() << FixItHint::CreateInsertion(LParenLoc, "(") in HelperToDiagnoseMismatchedMethodsInGlobalPool()
1203 S.Diag(Method->getLocation(), diag::note_method_declared_at) in HelperToDiagnoseMismatchedMethodsInGlobalPool()
1204 << Method->getDeclName(); in HelperToDiagnoseMismatchedMethodsInGlobalPool()
1214 ObjCMethodDecl *Method, in DiagnoseMismatchedSelectors() argument
1228 Method, InstMethList)) in DiagnoseMismatchedSelectors()
1234 Method, ClsMethList) || Warned) in DiagnoseMismatchedSelectors()
1247 ObjCMethodDecl *Method = M->getMethod(); in LookupDirectMethodInMethodList() local
1248 if (!Method) in LookupDirectMethodInMethodList()
1250 assert(Method->getSelector() == Sel && "Method with wrong selector in method list"); in LookupDirectMethodInMethodList()
1251 if (Method->isDirectMethod()) { in LookupDirectMethodInMethodList()
1253 DirectMethod = Method; in LookupDirectMethodInMethodList()
1308 ObjCMethodDecl *Method = LookupInstanceMethodInGlobalPool(Sel, in ParseObjCSelectorExpression() local
1310 if (!Method) in ParseObjCSelectorExpression()
1311 Method = LookupFactoryMethodInGlobalPool(Sel, in ParseObjCSelectorExpression()
1313 if (!Method) { in ParseObjCSelectorExpression()
1325 DiagnoseMismatchedSelectors(SemaRef, AtLoc, Method, LParenLoc, RParenLoc, in ParseObjCSelectorExpression()
1335 << Method->getSelector(); in ParseObjCSelectorExpression()
1336 Diag(Method->getLocation(), diag::note_direct_method_declared_at) in ParseObjCSelectorExpression()
1337 << Method->getDeclName(); in ParseObjCSelectorExpression()
1361 if (Method && in ParseObjCSelectorExpression()
1362 Method->getImplementationControl() != in ParseObjCSelectorExpression()
1364 !SemaRef.getSourceManager().isInSystemHeader(Method->getLocation())) in ParseObjCSelectorExpression()
1468 ObjCMethodDecl *Method, in getBaseMessageSendResultType() argument
1471 assert(Method && "Must have a method"); in getBaseMessageSendResultType()
1472 if (!Method->hasRelatedResultType()) in getBaseMessageSendResultType()
1473 return Method->getSendResultType(ReceiverType); in getBaseMessageSendResultType()
1482 Method->getSendResultType(ReceiverType)->getNullability()) { in getBaseMessageSendResultType()
1500 if (Method->isInstanceMethod() && isClassMessage) in getBaseMessageSendResultType()
1502 Method->getSendResultType(ReceiverType)); in getBaseMessageSendResultType()
1523 Method->getSendResultType(ReceiverType)); in getBaseMessageSendResultType()
1533 ObjCMethodDecl *Method, in getMessageSendResultType() argument
1539 SemaRef, ReceiverType, Method, isClassMessage, isSuperMessage); in getMessageSendResultType()
1550 QualType T = Method->getSendResultType(ReceiverType); in getMessageSendResultType()
1705 const ObjCMethodDecl *Method = MsgSend->getMethodDecl(); in EmitRelatedResultTypeNote() local
1706 if (!Method) in EmitRelatedResultTypeNote()
1709 if (!Method->hasRelatedResultType()) in EmitRelatedResultTypeNote()
1713 Method->getReturnType().getNonReferenceType(), MsgSend->getType())) in EmitRelatedResultTypeNote()
1716 if (!Context.hasSameUnqualifiedType(Method->getReturnType(), in EmitRelatedResultTypeNote()
1720 Diag(Method->getLocation(), diag::note_related_result_type_inferred) in EmitRelatedResultTypeNote()
1721 << Method->isInstanceMethod() << Method->getSelector() in EmitRelatedResultTypeNote()
1727 Selector Sel, ArrayRef<SourceLocation> SelectorLocs, ObjCMethodDecl *Method, in CheckMessageArgumentTypes() argument
1738 if (!Method) { in CheckMessageArgumentTypes()
1807 ReturnType = getMessageSendResultType(Receiver, ReceiverType, Method, in CheckMessageArgumentTypes()
1809 VK = Expr::getValueKindForType(Method->getReturnType()); in CheckMessageArgumentTypes()
1814 if (Method->param_size() > Sel.getNumArgs()) in CheckMessageArgumentTypes()
1815 NumNamedArgs = Method->param_size(); in CheckMessageArgumentTypes()
1827 ReceiverType->getObjCSubstitutions(Method->getDeclContext()); in CheckMessageArgumentTypes()
1836 ParmVarDecl *param = Method->parameters()[i]; in CheckMessageArgumentTypes()
1903 if (Method->isVariadic()) { in CheckMessageArgumentTypes()
1919 << Method->getSourceRange() << /*is non object*/ 0 in CheckMessageArgumentTypes()
1925 SemaRef.DiagnoseSentinelCalls(Method, SelLoc, Args); in CheckMessageArgumentTypes()
1929 CheckObjCMethodCall(Method, SelLoc, ArrayRef(Args.data(), Args.size())); in CheckMessageArgumentTypes()
1936 ObjCMethodDecl *Method = dyn_cast_or_null<ObjCMethodDecl>( in isSelfExpr() local
1938 return isSelfExpr(RExpr, Method); in isSelfExpr()
2277 ObjCInterfaceOrSuperCCC(ObjCMethodDecl *Method) { in ObjCInterfaceOrSuperCCC() argument
2279 if (Method && Method->getClassInterface()) in ObjCInterfaceOrSuperCCC()
2280 WantObjCSuper = Method->getClassInterface()->getSuperClass(); in ObjCInterfaceOrSuperCCC()
2317 if (ObjCMethodDecl *Method = SemaRef.getCurMethodDecl()) { in getObjCMessageKind() local
2318 if (!Method->getClassInterface()) { in getObjCMessageKind()
2324 if (Method->getClassInterface()->lookupInstanceVariable(Name, in getObjCMessageKind()
2399 ObjCMethodDecl *Method = tryCaptureObjCSelf(SuperLoc); in ActOnSuperMessage() local
2400 if (!Method) { in ActOnSuperMessage()
2405 ObjCInterfaceDecl *Class = Method->getClassInterface(); in ActOnSuperMessage()
2408 << Method->getDeclName(); in ActOnSuperMessage()
2422 if (Method->getSelector() == Sel) in ActOnSuperMessage()
2425 if (Method->isInstanceMethod()) { in ActOnSuperMessage()
2445 ObjCMethodDecl *Method, in BuildClassMessageImplicit() argument
2457 Sel, Method, Loc, Loc, Loc, Args, in BuildClassMessageImplicit()
2506 const ObjCMethodDecl *Method, in checkFoundationAPI() argument
2511 if (Method->getSelector().getMethodFamily() != OMF_performSelector || in checkFoundationAPI()
2541 << Method->getSelector() in checkFoundationAPI()
2555 ObjCMethodDecl *Method, in DiagnoseCStringFormatDirectiveInObjCAPI() argument
2565 else if (Method) { in DiagnoseCStringFormatDirectiveInObjCAPI()
2566 for (const auto *I : Method->specific_attrs<FormatAttr>()) { in DiagnoseCStringFormatDirectiveInObjCAPI()
2583 if (Method) in DiagnoseCStringFormatDirectiveInObjCAPI()
2584 S.Diag(Method->getLocation(), diag::note_method_declared_at) in DiagnoseCStringFormatDirectiveInObjCAPI()
2585 << Method->getDeclName(); in DiagnoseCStringFormatDirectiveInObjCAPI()
2620 SourceLocation SuperLoc, Selector Sel, ObjCMethodDecl *Method, in BuildClassMessage() argument
2663 if (!Method) { in BuildClassMessage()
2673 Method = LookupFactoryMethodInGlobalPool(Sel, in BuildClassMessage()
2675 if (Method && !getLangOpts().ObjCAutoRefCount) in BuildClassMessage()
2676 Diag(Method->getLocation(), diag::note_method_sent_forward_class) in BuildClassMessage()
2677 << Method->getDeclName(); in BuildClassMessage()
2679 if (!Method) in BuildClassMessage()
2680 Method = Class->lookupClassMethod(Sel); in BuildClassMessage()
2683 if (!Method) in BuildClassMessage()
2684 Method = Class->lookupPrivateClassMethod(Sel); in BuildClassMessage()
2686 if (Method && SemaRef.DiagnoseUseOfDecl(Method, SelectorSlotLocs, nullptr, in BuildClassMessage()
2699 Method, true, SuperLoc.isValid(), LBracLoc, in BuildClassMessage()
2703 if (Method && !Method->getReturnType()->isVoidType() && in BuildClassMessage()
2705 LBracLoc, Method->getReturnType(), in BuildClassMessage()
2709 if (Method && Method->isDirectMethod() && SuperLoc.isValid()) { in BuildClassMessage()
2714 : Method->getClassInterface()->getName()); in BuildClassMessage()
2715 Diag(Method->getLocation(), diag::note_direct_method_declared_at) in BuildClassMessage()
2716 << Method->getDeclName(); in BuildClassMessage()
2720 if (Method && Method->getMethodFamily() == OMF_initialize) { in BuildClassMessage()
2723 dyn_cast<ObjCInterfaceDecl>(Method->getDeclContext()); in BuildClassMessage()
2726 Diag(Method->getLocation(), diag::note_method_declared_at) in BuildClassMessage()
2727 << Method->getDeclName(); in BuildClassMessage()
2733 Diag(Method->getLocation(), diag::note_method_declared_at) in BuildClassMessage()
2734 << Method->getDeclName(); in BuildClassMessage()
2741 DiagnoseCStringFormatDirectiveInObjCAPI(SemaRef, Method, Sel, Args, NumArgs); in BuildClassMessage()
2748 ReceiverType, Sel, SelectorLocs, Method, ArrayRef(Args, NumArgs), in BuildClassMessage()
2753 Method, ArrayRef(Args, NumArgs), RBracLoc, isImplicit); in BuildClassMessage()
2757 if (Method) in BuildClassMessage()
2758 checkFoundationAPI(SemaRef, SelLoc, Method, ArrayRef(Args, NumArgs), in BuildClassMessage()
2789 ObjCMethodDecl *Method, MultiExprArg Args) { in BuildInstanceMessageImplicit() argument
2792 Sel, Method, Loc, Loc, Loc, Args, in BuildInstanceMessageImplicit()
2845 Selector Sel, ObjCMethodDecl *Method, SourceLocation LBracLoc, in BuildInstanceMessage() argument
2950 if (!Method) { in BuildInstanceMessage()
2965 Method = Methods[0]; in BuildInstanceMessage()
2968 Sel, ArgsIn, Method->isInstanceMethod(), Methods)) in BuildInstanceMessage()
2969 Method = BestMethod; in BuildInstanceMessage()
2971 if (!AreMultipleMethodsInGlobalPool(Sel, Method, in BuildInstanceMessage()
2974 SemaRef.DiagnoseUseOfDecl(Method, SelectorSlotLocs); in BuildInstanceMessage()
2986 Method = LookupMethodInQualifiedType(Sel, QClassTy, false); in BuildInstanceMessage()
2987 if (!Method) { in BuildInstanceMessage()
2988 Method = LookupMethodInQualifiedType(Sel, QClassTy, true); in BuildInstanceMessage()
2990 if (Method && !isMethodDeclaredInRootProtocol(SemaRef, Method)) { in BuildInstanceMessage()
2992 << Method->getSelector() << Sel; in BuildInstanceMessage()
2993 Diag(Method->getLocation(), diag::note_method_declared_at) in BuildInstanceMessage()
2994 << Method->getDeclName(); in BuildInstanceMessage()
3004 Method = ClassDecl->lookupClassMethod(Sel); in BuildInstanceMessage()
3006 if (!Method) in BuildInstanceMessage()
3007 Method = ClassDecl->lookupPrivateClassMethod(Sel); in BuildInstanceMessage()
3009 if (Method && SemaRef.DiagnoseUseOfDecl(Method, SelectorSlotLocs)) in BuildInstanceMessage()
3013 if (!Method) { in BuildInstanceMessage()
3025 Method = Methods[0]; in BuildInstanceMessage()
3028 if (Method->isInstanceMethod()) { in BuildInstanceMessage()
3030 dyn_cast<ObjCInterfaceDecl>(Method->getDeclContext())) { in BuildInstanceMessage()
3038 Sel, ArgsIn, Method->isInstanceMethod(), Methods)) in BuildInstanceMessage()
3039 Method = BestMethod; in BuildInstanceMessage()
3053 Method = LookupMethodInQualifiedType(Sel, QIdTy, true); in BuildInstanceMessage()
3054 if (!Method) in BuildInstanceMessage()
3055 Method = LookupMethodInQualifiedType(Sel, QIdTy, false); in BuildInstanceMessage()
3056 if (Method && SemaRef.DiagnoseUseOfDecl(Method, SelectorSlotLocs)) in BuildInstanceMessage()
3080 Method = nullptr; in BuildInstanceMessage()
3082 Method = ClassDecl->lookupInstanceMethod(Sel); in BuildInstanceMessage()
3085 if (!Method) in BuildInstanceMessage()
3087 Method = LookupMethodInQualifiedType(Sel, OCIType, true); in BuildInstanceMessage()
3089 if (!Method) { in BuildInstanceMessage()
3091 Method = ClassDecl->lookupPrivateMethod(Sel); in BuildInstanceMessage()
3093 if (!Method && getLangOpts().ObjCAutoRefCount) { in BuildInstanceMessage()
3100 if (!Method && (!Receiver || !isSelfExpr(Receiver))) { in BuildInstanceMessage()
3112 Method = Methods[0]; in BuildInstanceMessage()
3115 Sel, ArgsIn, Method->isInstanceMethod(), Methods)) in BuildInstanceMessage()
3116 Method = BestMethod; in BuildInstanceMessage()
3118 AreMultipleMethodsInGlobalPool(Sel, Method, in BuildInstanceMessage()
3123 if (Method && !forwardClass) in BuildInstanceMessage()
3130 if (Method && in BuildInstanceMessage()
3131 SemaRef.DiagnoseUseOfDecl(Method, SelectorSlotLocs, forwardClass)) in BuildInstanceMessage()
3142 (Method && Method->getMethodFamily() == OMF_init) in BuildInstanceMessage()
3146 if (Method && Method->isDirectMethod()) { in BuildInstanceMessage()
3150 Diag(Method->getLocation(), diag::note_direct_method_declared_at) in BuildInstanceMessage()
3151 << Method->getDeclName(); in BuildInstanceMessage()
3164 RecRange, Method->getClassInterface()->getName())); in BuildInstanceMessage()
3167 Diag(Method->getLocation(), diag::note_direct_method_declared_at) in BuildInstanceMessage()
3168 << Method->getDeclName(); in BuildInstanceMessage()
3177 SuperLoc, Method->getClassInterface()->getName())); in BuildInstanceMessage()
3182 Diag(Method->getLocation(), diag::note_direct_method_declared_at) in BuildInstanceMessage()
3183 << Method->getDeclName(); in BuildInstanceMessage()
3241 Method, ClassMessage, SuperLoc.isValid(), in BuildInstanceMessage()
3245 if (Method && !Method->getReturnType()->isVoidType() && in BuildInstanceMessage()
3247 LBracLoc, Method->getReturnType(), in BuildInstanceMessage()
3255 (Method ? Method->getMethodFamily() : Sel.getMethodFamily()); in BuildInstanceMessage()
3258 if (Method) in BuildInstanceMessage()
3259 checkInitMethod(Method, ReceiverType); in BuildInstanceMessage()
3282 if (Method && NumArgs >= 1) { in BuildInstanceMessage()
3332 DiagnoseCStringFormatDirectiveInObjCAPI(SemaRef, Method, Sel, Args, NumArgs); in BuildInstanceMessage()
3339 ReceiverType, Sel, SelectorLocs, Method, ArrayRef(Args, NumArgs), in BuildInstanceMessage()
3343 Context, ReturnType, VK, LBracLoc, Receiver, Sel, SelectorLocs, Method, in BuildInstanceMessage()
3348 if (Method) { in BuildInstanceMessage()
3365 checkFoundationAPI(SemaRef, SelLoc, Method, ArrayRef(Args, NumArgs), in BuildInstanceMessage()
3390 if (!isImplicit && Method) { in BuildInstanceMessage()
3391 if (const ObjCPropertyDecl *Prop = Method->findPropertyDecl()) { in BuildInstanceMessage()