Lines Matching defs:Method
154 Selector Sel, const ObjCMethodDecl *Method) {
155 if (!Method) {
162 QualType ReturnType = Method->getReturnType();
166 S.Diag(Method->getLocation(), diag::note_objc_literal_method_return)
289 ObjCMethodDecl *Method = S.NSNumberDecl->lookupClassMethod(Sel);
290 if (!Method && S.getLangOpts().DebuggerObjCLiteral) {
293 Method = ObjCMethodDecl::Create(
303 ParmVarDecl::Create(S.SemaRef.Context, Method, SourceLocation(),
306 Method->setMethodParams(S.SemaRef.Context, value, {});
309 if (!validateBoxingMethod(S.SemaRef, Loc, S.NSNumberDecl, Sel, Method))
315 S.NSNumberLiteralMethods[*Kind] = Method;
316 return Method;
352 ObjCMethodDecl *Method = getNSNumberFactoryMethod(*this, AtLoc, NumberType,
354 if (!Method)
358 ParmVarDecl *ParamDecl = Method->parameters()[0];
369 Number, NSNumberPointer, Method, SourceRange(AtLoc, NR.getEnd())));
814 ObjCMethodDecl *Method = NSArrayDecl->lookupClassMethod(Sel);
815 if (!Method && getLangOpts().DebuggerObjCLiteral) {
817 Method = ObjCMethodDecl::Create(
825 ParmVarDecl *objects = ParmVarDecl::Create(Context, Method,
833 ParmVarDecl *cnt = ParmVarDecl::Create(Context, Method,
841 Method->setMethodParams(Context, Params, {});
844 if (!validateBoxingMethod(SemaRef, Loc, NSArrayDecl, Sel, Method))
848 QualType T = Method->parameters()[0]->getType();
854 Diag(Method->parameters()[0]->getLocation(),
862 if (!Method->parameters()[1]->getType()->isIntegerType()) {
865 Diag(Method->parameters()[1]->getLocation(),
868 << Method->parameters()[1]->getType()
874 ArrayWithObjectsMethod = Method;
975 ObjCMethodDecl *Method = NSDictionaryDecl->lookupClassMethod(Sel);
976 if (!Method && getLangOpts().DebuggerObjCLiteral) {
977 Method = ObjCMethodDecl::Create(
986 ParmVarDecl *objects = ParmVarDecl::Create(Context, Method,
994 ParmVarDecl *keys = ParmVarDecl::Create(Context, Method,
1002 ParmVarDecl *cnt = ParmVarDecl::Create(Context, Method,
1010 Method->setMethodParams(Context, Params, {});
1014 Method))
1018 QualType ValueT = Method->parameters()[0]->getType();
1024 Diag(Method->parameters()[0]->getLocation(),
1032 QualType KeyT = Method->parameters()[1]->getType();
1058 Diag(Method->parameters()[1]->getLocation(),
1067 QualType CountType = Method->parameters()[2]->getType();
1071 Diag(Method->parameters()[2]->getLocation(),
1079 DictionaryWithObjectsMethod = Method;
1182 ObjCMethodDecl *Method,
1188 if (MatchingMethodDecl == Method ||
1190 MatchingMethodDecl->getSelector() != Method->getSelector())
1192 if (!S.ObjC().MatchTwoMethodDeclarations(Method, MatchingMethodDecl,
1197 << Method->getSelector() << FixItHint::CreateInsertion(LParenLoc, "(")
1199 S.Diag(Method->getLocation(), diag::note_method_declared_at)
1200 << Method->getDeclName();
1210 ObjCMethodDecl *Method,
1224 Method, InstMethList))
1230 Method, ClsMethList) || Warned)
1243 ObjCMethodDecl *Method = M->getMethod();
1244 if (!Method)
1246 assert(Method->getSelector() == Sel && "Method with wrong selector in method list");
1247 if (Method->isDirectMethod()) {
1249 DirectMethod = Method;
1304 ObjCMethodDecl *Method = LookupInstanceMethodInGlobalPool(Sel,
1306 if (!Method)
1307 Method = LookupFactoryMethodInGlobalPool(Sel,
1309 if (!Method) {
1321 DiagnoseMismatchedSelectors(SemaRef, AtLoc, Method, LParenLoc, RParenLoc,
1331 << Method->getSelector();
1332 Diag(Method->getLocation(), diag::note_direct_method_declared_at)
1333 << Method->getDeclName();
1357 if (Method &&
1358 Method->getImplementationControl() !=
1360 !SemaRef.getSourceManager().isInSystemHeader(Method->getLocation()))
1462 ObjCMethodDecl *Method,
1465 assert(Method && "Must have a method");
1466 if (!Method->hasRelatedResultType())
1467 return Method->getSendResultType(ReceiverType);
1476 Method->getSendResultType(ReceiverType)->getNullability()) {
1491 if (Method->isInstanceMethod() && isClassMessage)
1493 Method->getSendResultType(ReceiverType));
1514 Method->getSendResultType(ReceiverType));
1524 ObjCMethodDecl *Method,
1530 SemaRef, ReceiverType, Method, isClassMessage, isSuperMessage);
1541 QualType T = Method->getSendResultType(ReceiverType);
1693 const ObjCMethodDecl *Method = MsgSend->getMethodDecl();
1694 if (!Method)
1697 if (!Method->hasRelatedResultType())
1701 Method->getReturnType().getNonReferenceType(), MsgSend->getType()))
1704 if (!Context.hasSameUnqualifiedType(Method->getReturnType(),
1708 Diag(Method->getLocation(), diag::note_related_result_type_inferred)
1709 << Method->isInstanceMethod() << Method->getSelector()
1715 Selector Sel, ArrayRef<SourceLocation> SelectorLocs, ObjCMethodDecl *Method,
1726 if (!Method) {
1795 ReturnType = getMessageSendResultType(Receiver, ReceiverType, Method,
1797 VK = Expr::getValueKindForType(Method->getReturnType());
1800 // Method might have more arguments than selector indicates. This is due
1802 if (Method->param_size() > Sel.getNumArgs())
1803 NumNamedArgs = Method->param_size();
1815 ReceiverType->getObjCSubstitutions(Method->getDeclContext());
1824 ParmVarDecl *param = Method->parameters()[i];
1891 if (Method->isVariadic()) {
1907 << Method->getSourceRange() << /*is non object*/ 0
1913 SemaRef.DiagnoseSentinelCalls(Method, SelLoc, Args);
1917 CheckObjCMethodCall(Method, SelLoc, ArrayRef(Args.data(), Args.size()));
1924 ObjCMethodDecl *Method = dyn_cast_or_null<ObjCMethodDecl>(
1926 return isSelfExpr(RExpr, Method);
2265 ObjCInterfaceOrSuperCCC(ObjCMethodDecl *Method) {
2267 if (Method && Method->getClassInterface())
2268 WantObjCSuper = Method->getClassInterface()->getSuperClass();
2305 if (ObjCMethodDecl *Method = SemaRef.getCurMethodDecl()) {
2306 if (!Method->getClassInterface()) {
2312 if (Method->getClassInterface()->lookupInstanceVariable(Name,
2387 ObjCMethodDecl *Method = tryCaptureObjCSelf(SuperLoc);
2388 if (!Method) {
2393 ObjCInterfaceDecl *Class = Method->getClassInterface();
2396 << Method->getDeclName();
2410 if (Method->getSelector() == Sel)
2413 if (Method->isInstanceMethod()) {
2418 Sel, /*Method=*/nullptr,
2426 SuperLoc, Sel, /*Method=*/nullptr,
2433 ObjCMethodDecl *Method,
2445 Sel, Method, Loc, Loc, Loc, Args,
2494 const ObjCMethodDecl *Method,
2499 if (Method->getSelector().getMethodFamily() != OMF_performSelector ||
2529 << Method->getSelector()
2543 ObjCMethodDecl *Method,
2553 else if (Method) {
2554 for (const auto *I : Method->specific_attrs<FormatAttr>()) {
2571 if (Method)
2572 S.Diag(Method->getLocation(), diag::note_method_declared_at)
2573 << Method->getDeclName();
2598 /// \param Method The method that this class message is invoking, if
2608 SourceLocation SuperLoc, Selector Sel, ObjCMethodDecl *Method,
2634 /*Method=*/nullptr, ArrayRef(Args, NumArgs),
2651 if (!Method) {
2661 Method = LookupFactoryMethodInGlobalPool(Sel,
2663 if (Method && !getLangOpts().ObjCAutoRefCount)
2664 Diag(Method->getLocation(), diag::note_method_sent_forward_class)
2665 << Method->getDeclName();
2667 if (!Method)
2668 Method = Class->lookupClassMethod(Sel);
2671 if (!Method)
2672 Method = Class->lookupPrivateClassMethod(Sel);
2674 if (Method && SemaRef.DiagnoseUseOfDecl(Method, SelectorSlotLocs, nullptr,
2687 Method, true, SuperLoc.isValid(), LBracLoc,
2691 if (Method && !Method->getReturnType()->isVoidType() &&
2693 LBracLoc, Method->getReturnType(),
2697 if (Method && Method->isDirectMethod() && SuperLoc.isValid()) {
2702 : Method->getClassInterface()->getName());
2703 Diag(Method->getLocation(), diag::note_direct_method_declared_at)
2704 << Method->getDeclName();
2708 if (Method && Method->getMethodFamily() == OMF_initialize) {
2711 dyn_cast<ObjCInterfaceDecl>(Method->getDeclContext());
2714 Diag(Method->getLocation(), diag::note_method_declared_at)
2715 << Method->getDeclName();
2721 Diag(Method->getLocation(), diag::note_method_declared_at)
2722 << Method->getDeclName();
2729 DiagnoseCStringFormatDirectiveInObjCAPI(SemaRef, Method, Sel, Args, NumArgs);
2736 ReceiverType, Sel, SelectorLocs, Method, ArrayRef(Args, NumArgs),
2741 Method, ArrayRef(Args, NumArgs), RBracLoc, isImplicit);
2745 if (Method)
2746 checkFoundationAPI(SemaRef, SelLoc, Method, ArrayRef(Args, NumArgs),
2771 /*Method=*/nullptr, LBracLoc, SelectorLocs, RBracLoc,
2777 ObjCMethodDecl *Method, MultiExprArg Args) {
2780 Sel, Method, Loc, Loc, Loc, Args,
2823 /// \param Method The method that this instance message is invoking, if
2833 Selector Sel, ObjCMethodDecl *Method, SourceLocation LBracLoc,
2880 SelectorLocs, /*Method=*/nullptr, ArrayRef(Args, NumArgs), RBracLoc,
2938 if (!Method) {
2953 Method = Methods[0];
2956 Sel, ArgsIn, Method->isInstanceMethod(), Methods))
2957 Method = BestMethod;
2959 if (!AreMultipleMethodsInGlobalPool(Sel, Method,
2962 SemaRef.DiagnoseUseOfDecl(Method, SelectorSlotLocs);
2974 Method = LookupMethodInQualifiedType(Sel, QClassTy, false);
2975 if (!Method) {
2976 Method = LookupMethodInQualifiedType(Sel, QClassTy, true);
2978 if (Method && !isMethodDeclaredInRootProtocol(SemaRef, Method)) {
2980 << Method->getSelector() << Sel;
2981 Diag(Method->getLocation(), diag::note_method_declared_at)
2982 << Method->getDeclName();
2992 Method = ClassDecl->lookupClassMethod(Sel);
2994 if (!Method)
2995 Method = ClassDecl->lookupPrivateClassMethod(Sel);
2997 if (Method && SemaRef.DiagnoseUseOfDecl(Method, SelectorSlotLocs))
3001 if (!Method) {
3013 Method = Methods[0];
3016 if (Method->isInstanceMethod()) {
3018 dyn_cast<ObjCInterfaceDecl>(Method->getDeclContext())) {
3026 Sel, ArgsIn, Method->isInstanceMethod(), Methods))
3027 Method = BestMethod;
3041 Method = LookupMethodInQualifiedType(Sel, QIdTy, true);
3042 if (!Method)
3043 Method = LookupMethodInQualifiedType(Sel, QIdTy, false);
3044 if (Method && SemaRef.DiagnoseUseOfDecl(Method, SelectorSlotLocs))
3068 Method = nullptr;
3070 Method = ClassDecl->lookupInstanceMethod(Sel);
3073 if (!Method)
3075 Method = LookupMethodInQualifiedType(Sel, OCIType, true);
3077 if (!Method) {
3079 Method = ClassDecl->lookupPrivateMethod(Sel);
3081 if (!Method && getLangOpts().ObjCAutoRefCount) {
3088 if (!Method && (!Receiver || !isSelfExpr(Receiver))) {
3100 Method = Methods[0];
3103 Sel, ArgsIn, Method->isInstanceMethod(), Methods))
3104 Method = BestMethod;
3106 AreMultipleMethodsInGlobalPool(Sel, Method,
3111 if (Method && !forwardClass)
3118 if (Method &&
3119 SemaRef.DiagnoseUseOfDecl(Method, SelectorSlotLocs, forwardClass))
3130 (Method && Method->getMethodFamily() == OMF_init)
3134 if (Method && Method->isDirectMethod()) {
3138 Diag(Method->getLocation(), diag::note_direct_method_declared_at)
3139 << Method->getDeclName();
3152 RecRange, Method->getClassInterface()->getName()));
3155 Diag(Method->getLocation(), diag::note_direct_method_declared_at)
3156 << Method->getDeclName();
3165 SuperLoc, Method->getClassInterface()->getName()));
3170 Diag(Method->getLocation(), diag::note_direct_method_declared_at)
3171 << Method->getDeclName();
3230 Method, ClassMessage, SuperLoc.isValid(),
3234 if (Method && !Method->getReturnType()->isVoidType() &&
3236 LBracLoc, Method->getReturnType(),
3244 (Method ? Method->getMethodFamily() : Sel.getMethodFamily());
3247 if (Method)
3248 checkInitMethod(Method, ReceiverType);
3271 if (Method && NumArgs >= 1) {
3321 DiagnoseCStringFormatDirectiveInObjCAPI(SemaRef, Method, Sel, Args, NumArgs);
3328 ReceiverType, Sel, SelectorLocs, Method, ArrayRef(Args, NumArgs),
3332 Context, ReturnType, VK, LBracLoc, Receiver, Sel, SelectorLocs, Method,
3337 if (Method) {
3354 checkFoundationAPI(SemaRef, SelLoc, Method, ArrayRef(Args, NumArgs),
3379 if (!isImplicit && Method) {
3380 if (const ObjCPropertyDecl *Prop = Method->findPropertyDecl()) {
3438 /*Method=*/nullptr, LBracLoc, SelectorLocs,