Lines Matching refs:commit
60 const NSAPI &NS, Commit &commit) { in rewriteObjCRedundantCallWithLiteral() argument
86 commit.replaceWithInner(Msg->getSourceRange(), in rewriteObjCRedundantCallWithLiteral()
174 static void maybePutParensOnReceiver(const Expr *Receiver, Commit &commit) { in maybePutParensOnReceiver() argument
177 commit.insertWrap("(", RecRange, ")"); in maybePutParensOnReceiver()
182 Commit &commit) { in rewriteToSubscriptGetCommon() argument
193 commit.replaceWithInner(CharSourceRange::getCharRange(MsgRange.getBegin(), in rewriteToSubscriptGetCommon()
196 commit.replaceWithInner(SourceRange(ArgRange.getBegin(), MsgRange.getEnd()), in rewriteToSubscriptGetCommon()
198 commit.insertWrap("[", ArgRange, "]"); in rewriteToSubscriptGetCommon()
199 maybePutParensOnReceiver(Rec, commit); in rewriteToSubscriptGetCommon()
206 Commit &commit) { in rewriteToArraySubscriptGet() argument
210 return rewriteToSubscriptGetCommon(Msg, commit); in rewriteToArraySubscriptGet()
216 Commit &commit) { in rewriteToDictionarySubscriptGet() argument
220 return rewriteToSubscriptGetCommon(Msg, commit); in rewriteToDictionarySubscriptGet()
226 Commit &commit) { in rewriteToArraySubscriptSet() argument
242 commit.replaceWithInner(CharSourceRange::getCharRange(MsgRange.getBegin(), in rewriteToArraySubscriptSet()
245 commit.replaceWithInner(CharSourceRange::getCharRange(Arg0Range.getBegin(), in rewriteToArraySubscriptSet()
248 commit.replaceWithInner(SourceRange(Arg1Range.getBegin(), MsgRange.getEnd()), in rewriteToArraySubscriptSet()
250 commit.insertWrap("[", CharSourceRange::getCharRange(Arg0Range.getBegin(), in rewriteToArraySubscriptSet()
253 maybePutParensOnReceiver(Rec, commit); in rewriteToArraySubscriptSet()
260 Commit &commit) { in rewriteToDictionarySubscriptSet() argument
277 commit.insertBefore(LocBeforeVal, "] = "); in rewriteToDictionarySubscriptSet()
278 commit.insertFromRange(LocBeforeVal, Arg1Range, /*afterToken=*/false, in rewriteToDictionarySubscriptSet()
280 commit.insertBefore(LocBeforeVal, "["); in rewriteToDictionarySubscriptSet()
281 commit.replaceWithInner(CharSourceRange::getCharRange(MsgRange.getBegin(), in rewriteToDictionarySubscriptSet()
284 commit.replaceWithInner(SourceRange(Arg0Range.getBegin(), MsgRange.getEnd()), in rewriteToDictionarySubscriptSet()
286 maybePutParensOnReceiver(Rec, commit); in rewriteToDictionarySubscriptSet()
291 const NSAPI &NS, Commit &commit) { in rewriteToObjCSubscriptSyntax() argument
306 return rewriteToArraySubscriptGet(IFace, Msg, NS, commit); in rewriteToObjCSubscriptSyntax()
309 return rewriteToDictionarySubscriptGet(IFace, Msg, NS, commit); in rewriteToObjCSubscriptSyntax()
315 return rewriteToArraySubscriptSet(IFace, Msg, NS, commit); in rewriteToObjCSubscriptSyntax()
318 return rewriteToDictionarySubscriptSet(IFace, Msg, NS, commit); in rewriteToObjCSubscriptSyntax()
328 const NSAPI &NS, Commit &commit,
331 const NSAPI &NS, Commit &commit);
333 const NSAPI &NS, Commit &commit);
335 const NSAPI &NS, Commit &commit);
337 const NSAPI &NS, Commit &commit);
340 const NSAPI &NS, Commit &commit, in rewriteToObjCLiteralSyntax() argument
347 return rewriteToArrayLiteral(Msg, NS, commit, PMap); in rewriteToObjCLiteralSyntax()
349 return rewriteToDictionaryLiteral(Msg, NS, commit); in rewriteToObjCLiteralSyntax()
351 return rewriteToNumberLiteral(Msg, NS, commit); in rewriteToObjCLiteralSyntax()
353 return rewriteToStringBoxedExpression(Msg, NS, commit); in rewriteToObjCLiteralSyntax()
376 static void objectifyExpr(const Expr *E, Commit &commit);
379 const NSAPI &NS, Commit &commit, in rewriteToArrayLiteral() argument
394 commit.replace(MsgRange, "@[]"); in rewriteToArrayLiteral()
401 objectifyExpr(Msg->getArg(0), commit); in rewriteToArrayLiteral()
403 commit.replaceWithInner(MsgRange, ArgRange); in rewriteToArrayLiteral()
404 commit.insertWrap("@[", ArgRange, "]"); in rewriteToArrayLiteral()
417 objectifyExpr(Msg->getArg(i), commit); in rewriteToArrayLiteral()
420 commit.replace(MsgRange, "@[]"); in rewriteToArrayLiteral()
425 commit.replaceWithInner(MsgRange, ArgRange); in rewriteToArrayLiteral()
426 commit.insertWrap("@[", ArgRange, "]"); in rewriteToArrayLiteral()
491 const NSAPI &NS, Commit &commit) { in rewriteToDictionaryLiteral() argument
498 commit.replace(MsgRange, "@{}"); in rewriteToDictionaryLiteral()
507 objectifyExpr(Msg->getArg(0), commit); in rewriteToDictionaryLiteral()
508 objectifyExpr(Msg->getArg(1), commit); in rewriteToDictionaryLiteral()
513 commit.insertBefore(ValRange.getBegin(), ": "); in rewriteToDictionaryLiteral()
514 commit.insertFromRange(ValRange.getBegin(), in rewriteToDictionaryLiteral()
517 commit.insertBefore(ValRange.getBegin(), "@{"); in rewriteToDictionaryLiteral()
518 commit.insertAfterToken(ValRange.getEnd(), "}"); in rewriteToDictionaryLiteral()
519 commit.replaceWithInner(MsgRange, ValRange); in rewriteToDictionaryLiteral()
534 commit.replace(MsgRange, "@{}"); in rewriteToDictionaryLiteral()
539 objectifyExpr(Msg->getArg(i), commit); in rewriteToDictionaryLiteral()
540 objectifyExpr(Msg->getArg(i+1), commit); in rewriteToDictionaryLiteral()
545 commit.insertAfterToken(KeyRange.getEnd(), ": "); in rewriteToDictionaryLiteral()
546 commit.insertFromRange(KeyRange.getEnd(), ValRange, /*afterToken=*/true); in rewriteToDictionaryLiteral()
547 commit.remove(CharSourceRange::getCharRange(ValRange.getBegin(), in rewriteToDictionaryLiteral()
555 commit.insertWrap("@{", ArgRange, "}"); in rewriteToDictionaryLiteral()
556 commit.replaceWithInner(MsgRange, ArgRange); in rewriteToDictionaryLiteral()
578 commit.replace(MsgRange, "@{}"); in rewriteToDictionaryLiteral()
583 objectifyExpr(Vals[i], commit); in rewriteToDictionaryLiteral()
584 objectifyExpr(Keys[i], commit); in rewriteToDictionaryLiteral()
589 commit.insertAfterToken(KeyRange.getEnd(), ": "); in rewriteToDictionaryLiteral()
590 commit.insertFromRange(KeyRange.getEnd(), ValRange, /*afterToken=*/true); in rewriteToDictionaryLiteral()
596 commit.insertWrap("@{", ArgRange, "}"); in rewriteToDictionaryLiteral()
597 commit.replaceWithInner(MsgRange, ArgRange); in rewriteToDictionaryLiteral()
646 const NSAPI &NS, Commit &commit) { in rewriteToCharLiteral() argument
652 commit.replaceWithInner(Msg->getSourceRange(), ArgRange); in rewriteToCharLiteral()
653 commit.insert(ArgRange.getBegin(), "@"); in rewriteToCharLiteral()
657 return rewriteToNumericBoxedExpression(Msg, NS, commit); in rewriteToCharLiteral()
662 const NSAPI &NS, Commit &commit) { in rewriteToBoolLiteral() argument
666 commit.replaceWithInner(Msg->getSourceRange(), ArgRange); in rewriteToBoolLiteral()
667 commit.insert(ArgRange.getBegin(), "@"); in rewriteToBoolLiteral()
671 return rewriteToNumericBoxedExpression(Msg, NS, commit); in rewriteToBoolLiteral()
755 const NSAPI &NS, Commit &commit) { in rewriteToNumberLiteral() argument
761 return rewriteToCharLiteral(Msg, CharE, NS, commit); in rewriteToNumberLiteral()
763 return rewriteToBoolLiteral(Msg, BE, NS, commit); in rewriteToNumberLiteral()
765 return rewriteToBoolLiteral(Msg, BE, NS, commit); in rewriteToNumberLiteral()
776 return rewriteToNumericBoxedExpression(Msg, NS, commit); in rewriteToNumberLiteral()
796 return rewriteToNumericBoxedExpression(Msg, NS, commit); in rewriteToNumberLiteral()
830 commit.replaceWithInner(Msg->getSourceRange(), ArgRange); in rewriteToNumberLiteral()
831 commit.insert(ArgRange.getBegin(), "@"); in rewriteToNumberLiteral()
838 return rewriteToNumericBoxedExpression(Msg, NS, commit); in rewriteToNumberLiteral()
845 return rewriteToNumericBoxedExpression(Msg, NS, commit); in rewriteToNumberLiteral()
856 return rewriteToNumericBoxedExpression(Msg, NS, commit); in rewriteToNumberLiteral()
860 return rewriteToNumericBoxedExpression(Msg, NS, commit); in rewriteToNumberLiteral()
865 commit.replaceWithInner(CharSourceRange::getTokenRange(Msg->getSourceRange()), in rewriteToNumberLiteral()
867 commit.insert(LitB, "@"); in rewriteToNumberLiteral()
870 commit.insert(LitE, ".0"); in rewriteToNumberLiteral()
874 commit.insert(LitE, LitInfo.F); in rewriteToNumberLiteral()
877 commit.insert(LitE, LitInfo.U); in rewriteToNumberLiteral()
880 commit.insert(LitE, LitInfo.L); in rewriteToNumberLiteral()
882 commit.insert(LitE, LitInfo.LL); in rewriteToNumberLiteral()
940 static void objectifyExpr(const Expr *E, Commit &commit) { in objectifyExpr() argument
957 commit.insertWrap("(", Range, ")"); in objectifyExpr()
958 commit.insertBefore(Range.getBegin(), "(id)"); in objectifyExpr()
974 const NSAPI &NS, Commit &commit) { in rewriteToNumericBoxedExpression() argument
1094 commit.replaceWithInner(Msg->getSourceRange(), ArgRange); in rewriteToNumericBoxedExpression()
1097 commit.insertBefore(ArgRange.getBegin(), "@"); in rewriteToNumericBoxedExpression()
1099 commit.insertWrap("@(", ArgRange, ")"); in rewriteToNumericBoxedExpression()
1110 const NSAPI &NS, Commit &commit) { in doRewriteToUTF8StringBoxedExpressionHelper() argument
1124 commit.replaceWithInner(Msg->getSourceRange(), StrE->getSourceRange()); in doRewriteToUTF8StringBoxedExpressionHelper()
1125 commit.insert(StrE->getLocStart(), "@"); in doRewriteToUTF8StringBoxedExpressionHelper()
1133 commit.replaceWithInner(Msg->getSourceRange(), ArgRange); in doRewriteToUTF8StringBoxedExpressionHelper()
1136 commit.insertBefore(ArgRange.getBegin(), "@"); in doRewriteToUTF8StringBoxedExpressionHelper()
1138 commit.insertWrap("@(", ArgRange, ")"); in doRewriteToUTF8StringBoxedExpressionHelper()
1148 const NSAPI &NS, Commit &commit) { in rewriteToStringBoxedExpression() argument
1155 return doRewriteToUTF8StringBoxedExpressionHelper(Msg, NS, commit); in rewriteToStringBoxedExpression()
1165 return doRewriteToUTF8StringBoxedExpressionHelper(Msg, NS, commit); in rewriteToStringBoxedExpression()