Lines Matching refs:Method
149 Selector Sel, const ObjCMethodDecl *Method) { in validateBoxingMethod() argument
150 if (!Method) { in validateBoxingMethod()
157 QualType ReturnType = Method->getReturnType(); in validateBoxingMethod()
161 S.Diag(Method->getLocation(), diag::note_objc_literal_method_return) in validateBoxingMethod()
283 ObjCMethodDecl *Method = S.NSNumberDecl->lookupClassMethod(Sel); in getNSNumberFactoryMethod() local
284 if (!Method && S.getLangOpts().DebuggerObjCLiteral) { in getNSNumberFactoryMethod()
287 Method = in getNSNumberFactoryMethod()
296 ParmVarDecl *value = ParmVarDecl::Create(S.Context, Method, in getNSNumberFactoryMethod()
301 Method->setMethodParams(S.Context, value, None); in getNSNumberFactoryMethod()
304 if (!validateBoxingMethod(S, Loc, S.NSNumberDecl, Sel, Method)) in getNSNumberFactoryMethod()
310 S.NSNumberLiteralMethods[*Kind] = Method; in getNSNumberFactoryMethod()
311 return Method; in getNSNumberFactoryMethod()
345 ObjCMethodDecl *Method = getNSNumberFactoryMethod(*this, AtLoc, NumberType, in BuildObjCNumericLiteral() local
347 if (!Method) in BuildObjCNumericLiteral()
351 ParmVarDecl *ParamDecl = Method->parameters()[0]; in BuildObjCNumericLiteral()
363 new (Context) ObjCBoxedExpr(Number, NSNumberPointer, Method, in BuildObjCNumericLiteral()
809 ObjCMethodDecl *Method = NSArrayDecl->lookupClassMethod(Sel); in BuildObjCArrayLiteral() local
810 if (!Method && getLangOpts().DebuggerObjCLiteral) { in BuildObjCArrayLiteral()
812 Method = ObjCMethodDecl::Create( in BuildObjCArrayLiteral()
820 ParmVarDecl *objects = ParmVarDecl::Create(Context, Method, in BuildObjCArrayLiteral()
828 ParmVarDecl *cnt = ParmVarDecl::Create(Context, Method, in BuildObjCArrayLiteral()
836 Method->setMethodParams(Context, Params, None); in BuildObjCArrayLiteral()
839 if (!validateBoxingMethod(*this, Loc, NSArrayDecl, Sel, Method)) in BuildObjCArrayLiteral()
843 QualType T = Method->parameters()[0]->getType(); in BuildObjCArrayLiteral()
849 Diag(Method->parameters()[0]->getLocation(), in BuildObjCArrayLiteral()
857 if (!Method->parameters()[1]->getType()->isIntegerType()) { in BuildObjCArrayLiteral()
860 Diag(Method->parameters()[1]->getLocation(), in BuildObjCArrayLiteral()
863 << Method->parameters()[1]->getType() in BuildObjCArrayLiteral()
869 ArrayWithObjectsMethod = Method; in BuildObjCArrayLiteral()
971 ObjCMethodDecl *Method = NSDictionaryDecl->lookupClassMethod(Sel); in BuildObjCDictionaryLiteral() local
972 if (!Method && getLangOpts().DebuggerObjCLiteral) { in BuildObjCDictionaryLiteral()
973 Method = ObjCMethodDecl::Create( in BuildObjCDictionaryLiteral()
982 ParmVarDecl *objects = ParmVarDecl::Create(Context, Method, in BuildObjCDictionaryLiteral()
990 ParmVarDecl *keys = ParmVarDecl::Create(Context, Method, in BuildObjCDictionaryLiteral()
998 ParmVarDecl *cnt = ParmVarDecl::Create(Context, Method, in BuildObjCDictionaryLiteral()
1006 Method->setMethodParams(Context, Params, None); in BuildObjCDictionaryLiteral()
1010 Method)) in BuildObjCDictionaryLiteral()
1014 QualType ValueT = Method->parameters()[0]->getType(); in BuildObjCDictionaryLiteral()
1020 Diag(Method->parameters()[0]->getLocation(), in BuildObjCDictionaryLiteral()
1028 QualType KeyT = Method->parameters()[1]->getType(); in BuildObjCDictionaryLiteral()
1057 Diag(Method->parameters()[1]->getLocation(), in BuildObjCDictionaryLiteral()
1066 QualType CountType = Method->parameters()[2]->getType(); in BuildObjCDictionaryLiteral()
1070 Diag(Method->parameters()[2]->getLocation(), in BuildObjCDictionaryLiteral()
1078 DictionaryWithObjectsMethod = Method; in BuildObjCDictionaryLiteral()
1179 ObjCMethodDecl *Method, in HelperToDiagnoseMismatchedMethodsInGlobalPool() argument
1185 if (MatchingMethodDecl == Method || in HelperToDiagnoseMismatchedMethodsInGlobalPool()
1187 MatchingMethodDecl->getSelector() != Method->getSelector()) in HelperToDiagnoseMismatchedMethodsInGlobalPool()
1189 if (!S.MatchTwoMethodDeclarations(Method, in HelperToDiagnoseMismatchedMethodsInGlobalPool()
1194 << Method->getSelector() << FixItHint::CreateInsertion(LParenLoc, "(") in HelperToDiagnoseMismatchedMethodsInGlobalPool()
1196 S.Diag(Method->getLocation(), diag::note_method_declared_at) in HelperToDiagnoseMismatchedMethodsInGlobalPool()
1197 << Method->getDeclName(); in HelperToDiagnoseMismatchedMethodsInGlobalPool()
1207 ObjCMethodDecl *Method, in DiagnoseMismatchedSelectors() argument
1220 Method, InstMethList)) in DiagnoseMismatchedSelectors()
1226 Method, ClsMethList) || Warned) in DiagnoseMismatchedSelectors()
1239 ObjCMethodDecl *Method = M->getMethod(); in LookupDirectMethodInMethodList() local
1240 if (!Method) in LookupDirectMethodInMethodList()
1242 assert(Method->getSelector() == Sel && "Method with wrong selector in method list"); in LookupDirectMethodInMethodList()
1243 if (Method->isDirectMethod()) { in LookupDirectMethodInMethodList()
1245 DirectMethod = Method; in LookupDirectMethodInMethodList()
1299 ObjCMethodDecl *Method = LookupInstanceMethodInGlobalPool(Sel, in ParseObjCSelectorExpression() local
1301 if (!Method) in ParseObjCSelectorExpression()
1302 Method = LookupFactoryMethodInGlobalPool(Sel, in ParseObjCSelectorExpression()
1304 if (!Method) { in ParseObjCSelectorExpression()
1316 DiagnoseMismatchedSelectors(*this, AtLoc, Method, LParenLoc, RParenLoc, in ParseObjCSelectorExpression()
1326 << Method->getSelector(); in ParseObjCSelectorExpression()
1327 Diag(Method->getLocation(), diag::note_direct_method_declared_at) in ParseObjCSelectorExpression()
1328 << Method->getDeclName(); in ParseObjCSelectorExpression()
1351 if (Method && in ParseObjCSelectorExpression()
1352 Method->getImplementationControl() != ObjCMethodDecl::Optional && in ParseObjCSelectorExpression()
1353 !getSourceManager().isInSystemHeader(Method->getLocation())) in ParseObjCSelectorExpression()
1456 ObjCMethodDecl *Method, in getBaseMessageSendResultType() argument
1459 assert(Method && "Must have a method"); in getBaseMessageSendResultType()
1460 if (!Method->hasRelatedResultType()) in getBaseMessageSendResultType()
1461 return Method->getSendResultType(ReceiverType); in getBaseMessageSendResultType()
1469 if (auto nullability = Method->getSendResultType(ReceiverType) in getBaseMessageSendResultType()
1488 if (Method->isInstanceMethod() && isClassMessage) in getBaseMessageSendResultType()
1490 Method->getSendResultType(ReceiverType)); in getBaseMessageSendResultType()
1511 Method->getSendResultType(ReceiverType)); in getBaseMessageSendResultType()
1521 ObjCMethodDecl *Method, in getMessageSendResultType() argument
1526 Method, in getMessageSendResultType()
1539 QualType T = Method->getSendResultType(ReceiverType); in getMessageSendResultType()
1692 const ObjCMethodDecl *Method = MsgSend->getMethodDecl(); in EmitRelatedResultTypeNote() local
1693 if (!Method) in EmitRelatedResultTypeNote()
1696 if (!Method->hasRelatedResultType()) in EmitRelatedResultTypeNote()
1700 Method->getReturnType().getNonReferenceType(), MsgSend->getType())) in EmitRelatedResultTypeNote()
1703 if (!Context.hasSameUnqualifiedType(Method->getReturnType(), in EmitRelatedResultTypeNote()
1707 Diag(Method->getLocation(), diag::note_related_result_type_inferred) in EmitRelatedResultTypeNote()
1708 << Method->isInstanceMethod() << Method->getSelector() in EmitRelatedResultTypeNote()
1714 Selector Sel, ArrayRef<SourceLocation> SelectorLocs, ObjCMethodDecl *Method, in CheckMessageArgumentTypes() argument
1724 if (!Method) { in CheckMessageArgumentTypes()
1793 ReturnType = getMessageSendResultType(Receiver, ReceiverType, Method, in CheckMessageArgumentTypes()
1795 VK = Expr::getValueKindForType(Method->getReturnType()); in CheckMessageArgumentTypes()
1800 if (Method->param_size() > Sel.getNumArgs()) in CheckMessageArgumentTypes()
1801 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() in CheckMessageArgumentTypes()
1909 DiagnoseSentinelCalls(Method, SelLoc, Args); in CheckMessageArgumentTypes()
1913 Method, SelLoc, makeArrayRef(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
2445 Sel, Method, Loc, Loc, Loc, Args, in BuildClassMessageImplicit()
2494 const ObjCMethodDecl *Method, in checkFoundationAPI() argument
2499 if (Method->getSelector().getMethodFamily() != OMF_performSelector || in checkFoundationAPI()
2529 << Method->getSelector() in checkFoundationAPI()
2543 ObjCMethodDecl *Method, in DiagnoseCStringFormatDirectiveInObjCAPI() argument
2553 else if (Method) { in DiagnoseCStringFormatDirectiveInObjCAPI()
2554 for (const auto *I : Method->specific_attrs<FormatAttr>()) { in DiagnoseCStringFormatDirectiveInObjCAPI()
2571 if (Method) in DiagnoseCStringFormatDirectiveInObjCAPI()
2572 S.Diag(Method->getLocation(), diag::note_method_declared_at) in DiagnoseCStringFormatDirectiveInObjCAPI()
2573 << Method->getDeclName(); in DiagnoseCStringFormatDirectiveInObjCAPI()
2610 ObjCMethodDecl *Method, in BuildClassMessage() argument
2655 if (!Method) { in BuildClassMessage()
2665 Method = LookupFactoryMethodInGlobalPool(Sel, in BuildClassMessage()
2667 if (Method && !getLangOpts().ObjCAutoRefCount) in BuildClassMessage()
2668 Diag(Method->getLocation(), diag::note_method_sent_forward_class) in BuildClassMessage()
2669 << Method->getDeclName(); in BuildClassMessage()
2671 if (!Method) in BuildClassMessage()
2672 Method = Class->lookupClassMethod(Sel); in BuildClassMessage()
2675 if (!Method) in BuildClassMessage()
2676 Method = Class->lookupPrivateClassMethod(Sel); in BuildClassMessage()
2678 if (Method && DiagnoseUseOfDecl(Method, SelectorSlotLocs, in BuildClassMessage()
2691 Method, true, SuperLoc.isValid(), LBracLoc, in BuildClassMessage()
2695 if (Method && !Method->getReturnType()->isVoidType() && in BuildClassMessage()
2696 RequireCompleteType(LBracLoc, Method->getReturnType(), in BuildClassMessage()
2700 if (Method && Method->isDirectMethod() && SuperLoc.isValid()) { in BuildClassMessage()
2705 : Method->getClassInterface()->getName()); in BuildClassMessage()
2706 Diag(Method->getLocation(), diag::note_direct_method_declared_at) in BuildClassMessage()
2707 << Method->getDeclName(); in BuildClassMessage()
2711 if (Method && Method->getMethodFamily() == OMF_initialize) { in BuildClassMessage()
2714 dyn_cast<ObjCInterfaceDecl>(Method->getDeclContext()); in BuildClassMessage()
2717 Diag(Method->getLocation(), diag::note_method_declared_at) in BuildClassMessage()
2718 << Method->getDeclName(); in BuildClassMessage()
2725 Diag(Method->getLocation(), diag::note_method_declared_at) in BuildClassMessage()
2726 << Method->getDeclName(); in BuildClassMessage()
2733 DiagnoseCStringFormatDirectiveInObjCAPI(*this, Method, Sel, Args, NumArgs); in BuildClassMessage()
2741 Method, makeArrayRef(Args, NumArgs), in BuildClassMessage()
2746 Method, makeArrayRef(Args, NumArgs), in BuildClassMessage()
2751 if (Method) in BuildClassMessage()
2752 checkFoundationAPI(*this, SelLoc, Method, makeArrayRef(Args, NumArgs), in BuildClassMessage()
2785 ObjCMethodDecl *Method, in BuildInstanceMessageImplicit() argument
2789 Sel, Method, Loc, Loc, Loc, Args, in BuildInstanceMessageImplicit()
2843 ObjCMethodDecl *Method, in BuildInstanceMessage() argument
2945 if (!Method) { in BuildInstanceMessage()
2960 Method = Methods[0]; in BuildInstanceMessage()
2963 SelectBestMethod(Sel, ArgsIn, Method->isInstanceMethod(), Methods)) in BuildInstanceMessage()
2964 Method = BestMethod; in BuildInstanceMessage()
2966 if (!AreMultipleMethodsInGlobalPool(Sel, Method, in BuildInstanceMessage()
2969 DiagnoseUseOfDecl(Method, SelectorSlotLocs); in BuildInstanceMessage()
2981 Method = LookupMethodInQualifiedType(Sel, QClassTy, false); in BuildInstanceMessage()
2982 if (!Method) { in BuildInstanceMessage()
2983 Method = LookupMethodInQualifiedType(Sel, QClassTy, true); in BuildInstanceMessage()
2985 if (Method && !isMethodDeclaredInRootProtocol(*this, Method)) { in BuildInstanceMessage()
2987 << Method->getSelector() << Sel; in BuildInstanceMessage()
2988 Diag(Method->getLocation(), diag::note_method_declared_at) in BuildInstanceMessage()
2989 << Method->getDeclName(); in BuildInstanceMessage()
2999 Method = ClassDecl->lookupClassMethod(Sel); in BuildInstanceMessage()
3001 if (!Method) in BuildInstanceMessage()
3002 Method = ClassDecl->lookupPrivateClassMethod(Sel); in BuildInstanceMessage()
3004 if (Method && DiagnoseUseOfDecl(Method, SelectorSlotLocs)) in BuildInstanceMessage()
3008 if (!Method) { in BuildInstanceMessage()
3020 Method = Methods[0]; in BuildInstanceMessage()
3023 if (Method->isInstanceMethod()) { in BuildInstanceMessage()
3025 dyn_cast<ObjCInterfaceDecl>(Method->getDeclContext())) { in BuildInstanceMessage()
3033 SelectBestMethod(Sel, ArgsIn, Method->isInstanceMethod(), in BuildInstanceMessage()
3035 Method = BestMethod; in BuildInstanceMessage()
3049 Method = LookupMethodInQualifiedType(Sel, QIdTy, true); in BuildInstanceMessage()
3050 if (!Method) in BuildInstanceMessage()
3051 Method = LookupMethodInQualifiedType(Sel, QIdTy, false); in BuildInstanceMessage()
3052 if (Method && DiagnoseUseOfDecl(Method, SelectorSlotLocs)) in BuildInstanceMessage()
3075 Method = nullptr; in BuildInstanceMessage()
3077 Method = ClassDecl->lookupInstanceMethod(Sel); in BuildInstanceMessage()
3080 if (!Method) in BuildInstanceMessage()
3082 Method = LookupMethodInQualifiedType(Sel, OCIType, true); in BuildInstanceMessage()
3084 if (!Method) { in BuildInstanceMessage()
3086 Method = ClassDecl->lookupPrivateMethod(Sel); in BuildInstanceMessage()
3088 if (!Method && getLangOpts().ObjCAutoRefCount) { in BuildInstanceMessage()
3095 if (!Method && (!Receiver || !isSelfExpr(Receiver))) { in BuildInstanceMessage()
3107 Method = Methods[0]; in BuildInstanceMessage()
3110 SelectBestMethod(Sel, ArgsIn, Method->isInstanceMethod(), in BuildInstanceMessage()
3112 Method = BestMethod; in BuildInstanceMessage()
3114 AreMultipleMethodsInGlobalPool(Sel, Method, in BuildInstanceMessage()
3119 if (Method && !forwardClass) in BuildInstanceMessage()
3126 if (Method && DiagnoseUseOfDecl(Method, SelectorSlotLocs, forwardClass)) in BuildInstanceMessage()
3137 (Method && Method->getMethodFamily() == OMF_init) in BuildInstanceMessage()
3140 if (Method && Method->isDirectMethod()) { in BuildInstanceMessage()
3144 Diag(Method->getLocation(), diag::note_direct_method_declared_at) in BuildInstanceMessage()
3145 << Method->getDeclName(); in BuildInstanceMessage()
3158 RecRange, Method->getClassInterface()->getName())); in BuildInstanceMessage()
3161 Diag(Method->getLocation(), diag::note_direct_method_declared_at) in BuildInstanceMessage()
3162 << Method->getDeclName(); in BuildInstanceMessage()
3171 SuperLoc, Method->getClassInterface()->getName())); in BuildInstanceMessage()
3176 Diag(Method->getLocation(), diag::note_direct_method_declared_at) in BuildInstanceMessage()
3177 << Method->getDeclName(); in BuildInstanceMessage()
3234 Method, ClassMessage, SuperLoc.isValid(), in BuildInstanceMessage()
3238 if (Method && !Method->getReturnType()->isVoidType() && in BuildInstanceMessage()
3239 RequireCompleteType(LBracLoc, Method->getReturnType(), in BuildInstanceMessage()
3247 (Method ? Method->getMethodFamily() : Sel.getMethodFamily()); in BuildInstanceMessage()
3250 if (Method) in BuildInstanceMessage()
3251 checkInitMethod(Method, ReceiverType); in BuildInstanceMessage()
3274 if (Method && NumArgs >= 1) { in BuildInstanceMessage()
3324 DiagnoseCStringFormatDirectiveInObjCAPI(*this, Method, Sel, Args, NumArgs); in BuildInstanceMessage()
3331 ReceiverType, Sel, SelectorLocs, Method, in BuildInstanceMessage()
3336 Receiver, Sel, SelectorLocs, Method, in BuildInstanceMessage()
3342 if (Method) { in BuildInstanceMessage()
3359 checkFoundationAPI(*this, SelLoc, Method, makeArrayRef(Args, NumArgs), in BuildInstanceMessage()
3384 if (!isImplicit && Method) { in BuildInstanceMessage()
3385 if (const ObjCPropertyDecl *Prop = Method->findPropertyDecl()) { in BuildInstanceMessage()