Lines Matching defs:Method

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