Lines Matching refs:Method

148                                  Selector Sel, const ObjCMethodDecl *Method) {
149 if (!Method) {
156 QualType ReturnType = Method->getReturnType();
160 S.Diag(Method->getLocation(), diag::note_objc_literal_method_return)
282 ObjCMethodDecl *Method = S.NSNumberDecl->lookupClassMethod(Sel);
283 if (!Method && S.getLangOpts().DebuggerObjCLiteral) {
286 Method =
294 ParmVarDecl *value = ParmVarDecl::Create(S.Context, Method,
299 Method->setMethodParams(S.Context, value, None);
302 if (!validateBoxingMethod(S, Loc, S.NSNumberDecl, Sel, Method))
308 S.NSNumberLiteralMethods[*Kind] = Method;
309 return Method;
343 ObjCMethodDecl *Method = getNSNumberFactoryMethod(*this, AtLoc, NumberType,
345 if (!Method)
349 ParmVarDecl *ParamDecl = Method->parameters()[0];
361 new (Context) ObjCBoxedExpr(Number, NSNumberPointer, Method,
782 ObjCMethodDecl *Method = NSArrayDecl->lookupClassMethod(Sel);
783 if (!Method && getLangOpts().DebuggerObjCLiteral) {
785 Method = ObjCMethodDecl::Create(
793 ParmVarDecl *objects = ParmVarDecl::Create(Context, Method,
801 ParmVarDecl *cnt = ParmVarDecl::Create(Context, Method,
809 Method->setMethodParams(Context, Params, None);
812 if (!validateBoxingMethod(*this, Loc, NSArrayDecl, Sel, Method))
816 QualType T = Method->parameters()[0]->getType();
822 Diag(Method->parameters()[0]->getLocation(),
830 if (!Method->parameters()[1]->getType()->isIntegerType()) {
833 Diag(Method->parameters()[1]->getLocation(),
836 << Method->parameters()[1]->getType()
842 ArrayWithObjectsMethod = Method;
888 ObjCMethodDecl *Method = NSDictionaryDecl->lookupClassMethod(Sel);
889 if (!Method && getLangOpts().DebuggerObjCLiteral) {
890 Method = ObjCMethodDecl::Create(Context,
901 ParmVarDecl *objects = ParmVarDecl::Create(Context, Method,
909 ParmVarDecl *keys = ParmVarDecl::Create(Context, Method,
917 ParmVarDecl *cnt = ParmVarDecl::Create(Context, Method,
925 Method->setMethodParams(Context, Params, None);
929 Method))
933 QualType ValueT = Method->parameters()[0]->getType();
939 Diag(Method->parameters()[0]->getLocation(),
947 QualType KeyT = Method->parameters()[1]->getType();
976 Diag(Method->parameters()[1]->getLocation(),
985 QualType CountType = Method->parameters()[2]->getType();
989 Diag(Method->parameters()[2]->getLocation(),
997 DictionaryWithObjectsMethod = Method;
1102 ObjCMethodDecl *Method,
1108 if (MatchingMethodDecl == Method ||
1110 MatchingMethodDecl->getSelector() != Method->getSelector())
1112 if (!S.MatchTwoMethodDeclarations(Method,
1117 << Method->getSelector() << FixItHint::CreateInsertion(LParenLoc, "(")
1119 S.Diag(Method->getLocation(), diag::note_method_declared_at)
1120 << Method->getDeclName();
1130 ObjCMethodDecl *Method,
1143 Method, InstMethList))
1149 Method, ClsMethList) || Warned)
1160 ObjCMethodDecl *Method = LookupInstanceMethodInGlobalPool(Sel,
1162 if (!Method)
1163 Method = LookupFactoryMethodInGlobalPool(Sel,
1165 if (!Method) {
1177 DiagnoseMismatchedSelectors(*this, AtLoc, Method, LParenLoc, RParenLoc,
1180 if (Method &&
1181 Method->getImplementationControl() != ObjCMethodDecl::Optional &&
1182 !getSourceManager().isInSystemHeader(Method->getLocation()))
1278 ObjCMethodDecl *Method,
1281 assert(Method && "Must have a method");
1282 if (!Method->hasRelatedResultType())
1283 return Method->getSendResultType(ReceiverType);
1291 if (auto nullability = Method->getSendResultType(ReceiverType)
1310 if (Method->isInstanceMethod() && isClassMessage)
1312 Method->getSendResultType(ReceiverType));
1333 Method->getSendResultType(ReceiverType));
1342 ObjCMethodDecl *Method,
1347 Method,
1475 const ObjCMethodDecl *Method = MsgSend->getMethodDecl();
1476 if (!Method)
1479 if (!Method->hasRelatedResultType())
1483 Method->getReturnType().getNonReferenceType(), MsgSend->getType()))
1486 if (!Context.hasSameUnqualifiedType(Method->getReturnType(),
1490 Diag(Method->getLocation(), diag::note_related_result_type_inferred)
1491 << Method->isInstanceMethod() << Method->getSelector()
1499 ObjCMethodDecl *Method,
1510 if (!Method) {
1580 ReturnType = getMessageSendResultType(ReceiverType, Method, isClassMessage,
1582 VK = Expr::getValueKindForType(Method->getReturnType());
1585 // Method might have more arguments than selector indicates. This is due
1587 if (Method->param_size() > Sel.getNumArgs())
1588 NumNamedArgs = Method->param_size();
1599 = ReceiverType->getObjCSubstitutions(Method->getDeclContext());
1608 ParmVarDecl *param = Method->parameters()[i];
1668 if (Method->isVariadic()) {
1684 << Method->getSourceRange()
1690 DiagnoseSentinelCalls(Method, SelLoc, Args);
1694 Method, SelLoc, makeArrayRef(Args.data(), Args.size()));
1701 ObjCMethodDecl *Method =
1703 return isSelfExpr(RExpr, Method);
2023 ObjCInterfaceOrSuperCCC(ObjCMethodDecl *Method) {
2025 if (Method && Method->getClassInterface())
2026 WantObjCSuper = Method->getClassInterface()->getSuperClass();
2060 if (ObjCMethodDecl *Method = getCurMethodDecl()) {
2061 if (!Method->getClassInterface()) {
2067 if (Method->getClassInterface()->lookupInstanceVariable(Name,
2143 ObjCMethodDecl *Method = tryCaptureObjCSelf(SuperLoc);
2144 if (!Method) {
2149 ObjCInterfaceDecl *Class = Method->getClassInterface();
2152 << Method->getDeclName();
2166 if (Method->getSelector() == Sel)
2169 if (Method->isInstanceMethod()) {
2174 Sel, /*Method=*/nullptr,
2182 SuperLoc, Sel, /*Method=*/nullptr,
2191 ObjCMethodDecl *Method,
2199 Sel, Method, Loc, Loc, Loc, Args,
2252 ObjCMethodDecl *Method,
2262 else if (Method) {
2263 for (const auto *I : Method->specific_attrs<FormatAttr>()) {
2280 if (Method)
2281 S.Diag(Method->getLocation(), diag::note_method_declared_at)
2282 << Method->getDeclName();
2307 /// \param Method The method that this class message is invoking, if
2319 ObjCMethodDecl *Method,
2346 SelectorLocs, /*Method=*/nullptr, makeArrayRef(Args, NumArgs), RBracLoc,
2363 if (!Method) {
2373 Method = LookupFactoryMethodInGlobalPool(Sel,
2375 if (Method && !getLangOpts().ObjCAutoRefCount)
2376 Diag(Method->getLocation(), diag::note_method_sent_forward_class)
2377 << Method->getDeclName();
2379 if (!Method)
2380 Method = Class->lookupClassMethod(Sel);
2383 if (!Method)
2384 Method = Class->lookupPrivateClassMethod(Sel);
2386 if (Method && DiagnoseUseOfDecl(Method, SelLoc))
2398 Method, true,
2404 if (Method && !Method->getReturnType()->isVoidType() &&
2405 RequireCompleteType(LBracLoc, Method->getReturnType(),
2410 if (Method && Method->getMethodFamily() == OMF_initialize) {
2413 dyn_cast<ObjCInterfaceDecl>(Method->getDeclContext());
2416 Diag(Method->getLocation(), diag::note_method_declared_at)
2417 << Method->getDeclName();
2424 Diag(Method->getLocation(), diag::note_method_declared_at)
2425 << Method->getDeclName();
2432 DiagnoseCStringFormatDirectiveInObjCAPI(*this, Method, Sel, Args, NumArgs);
2440 Method, makeArrayRef(Args, NumArgs),
2445 Method, makeArrayRef(Args, NumArgs),
2474 /*Method=*/nullptr, LBracLoc, SelectorLocs, RBracLoc,
2482 ObjCMethodDecl *Method,
2486 Sel, Method, Loc, Loc, Loc, Args,
2510 /// \param Method The method that this instance message is invoking, if
2522 ObjCMethodDecl *Method,
2565 SelectorLocs, /*Method=*/nullptr, makeArrayRef(Args, NumArgs),
2621 if (!Method) {
2631 Method = LookupInstanceMethodInGlobalPool(Sel,
2634 if (!Method)
2635 Method = LookupFactoryMethodInGlobalPool(Sel,
2638 if (Method) {
2640 SelectBestMethod(Sel, ArgsIn, Method->isInstanceMethod()))
2641 Method = BestMethod;
2642 if (!AreMultipleMethodsInGlobalPool(Sel, Method,
2645 DiagnoseUseOfDecl(Method, SelLoc);
2658 Method = LookupMethodInQualifiedType(Sel, QClassTy, false);
2659 if (!Method) {
2660 Method = LookupMethodInQualifiedType(Sel, QClassTy, true);
2662 if (Method) {
2664 << Method->getSelector() << Sel;
2665 Diag(Method->getLocation(), diag::note_method_declared_at)
2666 << Method->getDeclName();
2673 Method = ClassDecl->lookupClassMethod(Sel);
2675 if (!Method)
2676 Method = ClassDecl->lookupPrivateClassMethod(Sel);
2678 if (Method && DiagnoseUseOfDecl(Method, SelLoc))
2681 if (!Method) {
2684 Method = LookupFactoryMethodInGlobalPool(Sel,
2686 if (!Method) {
2689 Method = LookupInstanceMethodInGlobalPool(Sel,
2691 if (Method)
2693 dyn_cast<ObjCInterfaceDecl>(Method->getDeclContext())) {
2699 if (Method)
2701 SelectBestMethod(Sel, ArgsIn, Method->isInstanceMethod()))
2702 Method = BestMethod;
2715 Method = LookupMethodInQualifiedType(Sel, QIdTy, true);
2716 if (!Method)
2717 Method = LookupMethodInQualifiedType(Sel, QIdTy, false);
2718 if (Method && DiagnoseUseOfDecl(Method, SelLoc))
2742 Method = nullptr;
2744 Method = ClassDecl->lookupInstanceMethod(Sel);
2747 if (!Method)
2749 Method = LookupMethodInQualifiedType(Sel, OCIType, true);
2751 if (!Method) {
2753 Method = ClassDecl->lookupPrivateMethod(Sel);
2755 if (!Method && getLangOpts().ObjCAutoRefCount) {
2762 if (!Method && (!Receiver || !isSelfExpr(Receiver))) {
2767 Method = LookupInstanceMethodInGlobalPool(Sel,
2769 if (Method) {
2771 SelectBestMethod(Sel, ArgsIn, Method->isInstanceMethod()))
2772 Method = BestMethod;
2773 AreMultipleMethodsInGlobalPool(Sel, Method,
2777 if (Method && !forwardClass)
2784 if (Method && DiagnoseUseOfDecl(Method, SelLoc, forwardClass))
2796 (Method && Method->getMethodFamily() == OMF_init)
2849 Sel, SelectorLocs, Method,
2854 if (Method && !Method->getReturnType()->isVoidType() &&
2855 RequireCompleteType(LBracLoc, Method->getReturnType(),
2863 (Method ? Method->getMethodFamily() : Sel.getMethodFamily());
2866 if (Method)
2867 checkInitMethod(Method, ReceiverType);
2889 if (Method && NumArgs >= 1) {
2939 DiagnoseCStringFormatDirectiveInObjCAPI(*this, Method, Sel, Args, NumArgs);
2946 ReceiverType, Sel, SelectorLocs, Method,
2951 Receiver, Sel, SelectorLocs, Method,
2977 if (!isImplicit && Method) {
2978 if (const ObjCPropertyDecl *Prop = Method->findPropertyDecl()) {
3035 /*Method=*/nullptr, LBracLoc, SelectorLocs,