Lines Matching refs:NS

59                                               const NSAPI &NS, Commit &commit) {  in rewriteObjCRedundantCallWithLiteral()  argument
61 if (!checkForLiteralCreation(Msg, II, NS.getASTContext().getLangOpts())) in rewriteObjCRedundantCallWithLiteral()
70 NS.getNSClassId(NSAPI::ClassId_NSString) == II && in rewriteObjCRedundantCallWithLiteral()
71 (NS.getNSStringSelector(NSAPI::NSStr_stringWithString) == Sel || in rewriteObjCRedundantCallWithLiteral()
72 NS.getNSStringSelector(NSAPI::NSStr_initWithString) == Sel)) || in rewriteObjCRedundantCallWithLiteral()
75 NS.getNSClassId(NSAPI::ClassId_NSArray) == II && in rewriteObjCRedundantCallWithLiteral()
76 (NS.getNSArraySelector(NSAPI::NSArr_arrayWithArray) == Sel || in rewriteObjCRedundantCallWithLiteral()
77 NS.getNSArraySelector(NSAPI::NSArr_initWithArray) == Sel)) || in rewriteObjCRedundantCallWithLiteral()
80 NS.getNSClassId(NSAPI::ClassId_NSDictionary) == II && in rewriteObjCRedundantCallWithLiteral()
81 (NS.getNSDictionarySelector( in rewriteObjCRedundantCallWithLiteral()
83 NS.getNSDictionarySelector(NSAPI::NSDict_initWithDictionary) == Sel))) { in rewriteObjCRedundantCallWithLiteral()
204 const NSAPI &NS, in rewriteToArraySubscriptGet() argument
206 if (!canRewriteToSubscriptSyntax(IFace, Msg, NS.getASTContext(), in rewriteToArraySubscriptGet()
207 NS.getObjectAtIndexedSubscriptSelector())) in rewriteToArraySubscriptGet()
214 const NSAPI &NS, in rewriteToDictionarySubscriptGet() argument
216 if (!canRewriteToSubscriptSyntax(IFace, Msg, NS.getASTContext(), in rewriteToDictionarySubscriptGet()
217 NS.getObjectForKeyedSubscriptSelector())) in rewriteToDictionarySubscriptGet()
224 const NSAPI &NS, in rewriteToArraySubscriptSet() argument
226 if (!canRewriteToSubscriptSyntax(IFace, Msg, NS.getASTContext(), in rewriteToArraySubscriptSet()
227 NS.getSetObjectAtIndexedSubscriptSelector())) in rewriteToArraySubscriptSet()
258 const NSAPI &NS, in rewriteToDictionarySubscriptSet() argument
260 if (!canRewriteToSubscriptSyntax(IFace, Msg, NS.getASTContext(), in rewriteToDictionarySubscriptSet()
261 NS.getSetObjectForKeyedSubscriptSelector())) in rewriteToDictionarySubscriptSet()
290 const NSAPI &NS, Commit &commit) { in rewriteToObjCSubscriptSyntax() argument
299 NS.getASTContext().getObjContainingInterface(Method); in rewriteToObjCSubscriptSyntax()
304 if (Sel == NS.getNSArraySelector(NSAPI::NSArr_objectAtIndex)) in rewriteToObjCSubscriptSyntax()
305 return rewriteToArraySubscriptGet(IFace, Msg, NS, commit); in rewriteToObjCSubscriptSyntax()
307 if (Sel == NS.getNSDictionarySelector(NSAPI::NSDict_objectForKey)) in rewriteToObjCSubscriptSyntax()
308 return rewriteToDictionarySubscriptGet(IFace, Msg, NS, commit); in rewriteToObjCSubscriptSyntax()
313 if (Sel == NS.getNSArraySelector(NSAPI::NSMutableArr_replaceObjectAtIndex)) in rewriteToObjCSubscriptSyntax()
314 return rewriteToArraySubscriptSet(IFace, Msg, NS, commit); in rewriteToObjCSubscriptSyntax()
316 if (Sel == NS.getNSDictionarySelector(NSAPI::NSMutableDict_setObjectForKey)) in rewriteToObjCSubscriptSyntax()
317 return rewriteToDictionarySubscriptSet(IFace, Msg, NS, commit); in rewriteToObjCSubscriptSyntax()
327 const NSAPI &NS, Commit &commit,
330 const NSAPI &NS, Commit &commit);
332 const NSAPI &NS, Commit &commit);
334 const NSAPI &NS, Commit &commit);
336 const NSAPI &NS, Commit &commit);
339 const NSAPI &NS, Commit &commit, in rewriteToObjCLiteralSyntax() argument
342 if (!checkForLiteralCreation(Msg, II, NS.getASTContext().getLangOpts())) in rewriteToObjCLiteralSyntax()
345 if (II == NS.getNSClassId(NSAPI::ClassId_NSArray)) in rewriteToObjCLiteralSyntax()
346 return rewriteToArrayLiteral(Msg, NS, commit, PMap); in rewriteToObjCLiteralSyntax()
347 if (II == NS.getNSClassId(NSAPI::ClassId_NSDictionary)) in rewriteToObjCLiteralSyntax()
348 return rewriteToDictionaryLiteral(Msg, NS, commit); in rewriteToObjCLiteralSyntax()
349 if (II == NS.getNSClassId(NSAPI::ClassId_NSNumber)) in rewriteToObjCLiteralSyntax()
350 return rewriteToNumberLiteral(Msg, NS, commit); in rewriteToObjCLiteralSyntax()
351 if (II == NS.getNSClassId(NSAPI::ClassId_NSString)) in rewriteToObjCLiteralSyntax()
352 return rewriteToStringBoxedExpression(Msg, NS, commit); in rewriteToObjCLiteralSyntax()
368 const NSAPI &NS);
378 const NSAPI &NS, Commit &commit, in rewriteToArrayLiteral() argument
383 if (shouldNotRewriteImmediateMessageArgs(ParentMsg, NS)) in rewriteToArrayLiteral()
390 if (Sel == NS.getNSArraySelector(NSAPI::NSArr_array)) { in rewriteToArrayLiteral()
397 if (Sel == NS.getNSArraySelector(NSAPI::NSArr_arrayWithObject)) { in rewriteToArrayLiteral()
407 if (Sel == NS.getNSArraySelector(NSAPI::NSArr_arrayWithObjects) || in rewriteToArrayLiteral()
408 Sel == NS.getNSArraySelector(NSAPI::NSArr_initWithObjects)) { in rewriteToArrayLiteral()
412 if (!NS.getASTContext().isSentinelNullExpr(SentinelExpr)) in rewriteToArrayLiteral()
439 static bool getNSArrayObjects(const Expr *E, const NSAPI &NS, in getNSArrayObjects() argument
450 if (!checkForLiteralCreation(Msg, Cls, NS.getASTContext().getLangOpts())) in getNSArrayObjects()
453 if (Cls != NS.getNSClassId(NSAPI::ClassId_NSArray)) in getNSArrayObjects()
457 if (Sel == NS.getNSArraySelector(NSAPI::NSArr_array)) in getNSArrayObjects()
460 if (Sel == NS.getNSArraySelector(NSAPI::NSArr_arrayWithObject)) { in getNSArrayObjects()
467 if (Sel == NS.getNSArraySelector(NSAPI::NSArr_arrayWithObjects) || in getNSArrayObjects()
468 Sel == NS.getNSArraySelector(NSAPI::NSArr_initWithObjects)) { in getNSArrayObjects()
472 if (!NS.getASTContext().isSentinelNullExpr(SentinelExpr)) in getNSArrayObjects()
490 const NSAPI &NS, Commit &commit) { in rewriteToDictionaryLiteral() argument
494 if (Sel == NS.getNSDictionarySelector(NSAPI::NSDict_dictionary)) { in rewriteToDictionaryLiteral()
501 if (Sel == NS.getNSDictionarySelector( in rewriteToDictionaryLiteral()
522 if (Sel == NS.getNSDictionarySelector( in rewriteToDictionaryLiteral()
524 Sel == NS.getNSDictionarySelector(NSAPI::NSDict_initWithObjectsAndKeys)) { in rewriteToDictionaryLiteral()
529 if (!NS.getASTContext().isSentinelNullExpr(SentinelExpr)) in rewriteToDictionaryLiteral()
559 if (Sel == NS.getNSDictionarySelector( in rewriteToDictionaryLiteral()
561 Sel == NS.getNSDictionarySelector(NSAPI::NSDict_initWithObjectsForKeys)) { in rewriteToDictionaryLiteral()
566 if (!getNSArrayObjects(Msg->getArg(0), NS, Vals)) in rewriteToDictionaryLiteral()
570 if (!getNSArrayObjects(Msg->getArg(1), NS, Keys)) in rewriteToDictionaryLiteral()
603 const NSAPI &NS) { in shouldNotRewriteImmediateMessageArgs() argument
608 if (!checkForLiteralCreation(Msg, II, NS.getASTContext().getLangOpts())) in shouldNotRewriteImmediateMessageArgs()
611 if (II != NS.getNSClassId(NSAPI::ClassId_NSDictionary)) in shouldNotRewriteImmediateMessageArgs()
615 if (Sel == NS.getNSDictionarySelector( in shouldNotRewriteImmediateMessageArgs()
617 Sel == NS.getNSDictionarySelector(NSAPI::NSDict_initWithObjectsForKeys)) { in shouldNotRewriteImmediateMessageArgs()
622 if (!getNSArrayObjects(Msg->getArg(0), NS, Vals)) in shouldNotRewriteImmediateMessageArgs()
626 if (!getNSArrayObjects(Msg->getArg(1), NS, Keys)) in shouldNotRewriteImmediateMessageArgs()
644 const NSAPI &NS, Commit &commit) { in rewriteToCharLiteral() argument
647 if (NS.isNSNumberLiteralSelector(NSAPI::NSNumberWithChar, in rewriteToCharLiteral()
655 return rewriteToNumericBoxedExpression(Msg, NS, commit); in rewriteToCharLiteral()
660 const NSAPI &NS, Commit &commit) { in rewriteToBoolLiteral() argument
661 if (NS.isNSNumberLiteralSelector(NSAPI::NSNumberWithBool, in rewriteToBoolLiteral()
669 return rewriteToNumericBoxedExpression(Msg, NS, commit); in rewriteToBoolLiteral()
753 const NSAPI &NS, Commit &commit) { in rewriteToNumberLiteral() argument
759 return rewriteToCharLiteral(Msg, CharE, NS, commit); in rewriteToNumberLiteral()
761 return rewriteToBoolLiteral(Msg, BE, NS, commit); in rewriteToNumberLiteral()
763 return rewriteToBoolLiteral(Msg, BE, NS, commit); in rewriteToNumberLiteral()
774 return rewriteToNumericBoxedExpression(Msg, NS, commit); in rewriteToNumberLiteral()
776 ASTContext &Ctx = NS.getASTContext(); in rewriteToNumberLiteral()
779 MKOpt = NS.getNSNumberLiteralMethodKind(Sel); in rewriteToNumberLiteral()
794 return rewriteToNumericBoxedExpression(Msg, NS, commit); in rewriteToNumberLiteral()
840 return rewriteToNumericBoxedExpression(Msg, NS, commit); in rewriteToNumberLiteral()
847 return rewriteToNumericBoxedExpression(Msg, NS, commit); in rewriteToNumberLiteral()
858 return rewriteToNumericBoxedExpression(Msg, NS, commit); in rewriteToNumberLiteral()
862 return rewriteToNumericBoxedExpression(Msg, NS, commit); in rewriteToNumberLiteral()
976 const NSAPI &NS, Commit &commit) { in rewriteToNumericBoxedExpression() argument
984 ASTContext &Ctx = NS.getASTContext(); in rewriteToNumericBoxedExpression()
987 MKOpt = NS.getNSNumberLiteralMethodKind(Sel); in rewriteToNumericBoxedExpression()
1126 const NSAPI &NS, Commit &commit) { in doRewriteToUTF8StringBoxedExpressionHelper() argument
1131 ASTContext &Ctx = NS.getASTContext(); in doRewriteToUTF8StringBoxedExpressionHelper()
1164 const NSAPI &NS, Commit &commit) { in rewriteToStringBoxedExpression() argument
1167 if (Sel == NS.getNSStringSelector(NSAPI::NSStr_stringWithUTF8String) || in rewriteToStringBoxedExpression()
1168 Sel == NS.getNSStringSelector(NSAPI::NSStr_stringWithCString) || in rewriteToStringBoxedExpression()
1169 Sel == NS.getNSStringSelector(NSAPI::NSStr_initWithUTF8String)) { in rewriteToStringBoxedExpression()
1172 return doRewriteToUTF8StringBoxedExpressionHelper(Msg, NS, commit); in rewriteToStringBoxedExpression()
1175 if (Sel == NS.getNSStringSelector(NSAPI::NSStr_stringWithCStringEncoding)) { in rewriteToStringBoxedExpression()
1180 if (NS.isNSUTF8StringEncodingConstant(encodingArg) || in rewriteToStringBoxedExpression()
1181 NS.isNSASCIIStringEncodingConstant(encodingArg)) in rewriteToStringBoxedExpression()
1182 return doRewriteToUTF8StringBoxedExpressionHelper(Msg, NS, commit); in rewriteToStringBoxedExpression()