Lines Matching full:commit
19 #include "clang/Edit/Commit.h"
59 const NSAPI &NS, Commit &commit) { in rewriteObjCRedundantCallWithLiteral() argument
85 commit.replaceWithInner(Msg->getSourceRange(), in rewriteObjCRedundantCallWithLiteral()
173 static void maybePutParensOnReceiver(const Expr *Receiver, Commit &commit) { in maybePutParensOnReceiver() argument
176 commit.insertWrap("(", RecRange, ")"); in maybePutParensOnReceiver()
181 Commit &commit) { in rewriteToSubscriptGetCommon() argument
192 commit.replaceWithInner(CharSourceRange::getCharRange(MsgRange.getBegin(), in rewriteToSubscriptGetCommon()
195 commit.replaceWithInner(SourceRange(ArgRange.getBegin(), MsgRange.getEnd()), in rewriteToSubscriptGetCommon()
197 commit.insertWrap("[", ArgRange, "]"); in rewriteToSubscriptGetCommon()
198 maybePutParensOnReceiver(Rec, commit); in rewriteToSubscriptGetCommon()
205 Commit &commit) { in rewriteToArraySubscriptGet() argument
209 return rewriteToSubscriptGetCommon(Msg, commit); in rewriteToArraySubscriptGet()
215 Commit &commit) { in rewriteToDictionarySubscriptGet() argument
219 return rewriteToSubscriptGetCommon(Msg, commit); in rewriteToDictionarySubscriptGet()
225 Commit &commit) { in rewriteToArraySubscriptSet() argument
241 commit.replaceWithInner(CharSourceRange::getCharRange(MsgRange.getBegin(), in rewriteToArraySubscriptSet()
244 commit.replaceWithInner(CharSourceRange::getCharRange(Arg0Range.getBegin(), in rewriteToArraySubscriptSet()
247 commit.replaceWithInner(SourceRange(Arg1Range.getBegin(), MsgRange.getEnd()), in rewriteToArraySubscriptSet()
249 commit.insertWrap("[", CharSourceRange::getCharRange(Arg0Range.getBegin(), in rewriteToArraySubscriptSet()
252 maybePutParensOnReceiver(Rec, commit); in rewriteToArraySubscriptSet()
259 Commit &commit) { in rewriteToDictionarySubscriptSet() argument
276 commit.insertBefore(LocBeforeVal, "] = "); in rewriteToDictionarySubscriptSet()
277 commit.insertFromRange(LocBeforeVal, Arg1Range, /*afterToken=*/false, in rewriteToDictionarySubscriptSet()
279 commit.insertBefore(LocBeforeVal, "["); in rewriteToDictionarySubscriptSet()
280 commit.replaceWithInner(CharSourceRange::getCharRange(MsgRange.getBegin(), in rewriteToDictionarySubscriptSet()
283 commit.replaceWithInner(SourceRange(Arg0Range.getBegin(), MsgRange.getEnd()), in rewriteToDictionarySubscriptSet()
285 maybePutParensOnReceiver(Rec, commit); in rewriteToDictionarySubscriptSet()
290 const NSAPI &NS, Commit &commit) { in rewriteToObjCSubscriptSyntax() argument
305 return rewriteToArraySubscriptGet(IFace, Msg, NS, commit); in rewriteToObjCSubscriptSyntax()
308 return rewriteToDictionarySubscriptGet(IFace, Msg, NS, commit); in rewriteToObjCSubscriptSyntax()
314 return rewriteToArraySubscriptSet(IFace, Msg, NS, commit); 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
346 return rewriteToArrayLiteral(Msg, NS, commit, PMap); in rewriteToObjCLiteralSyntax()
348 return rewriteToDictionaryLiteral(Msg, NS, commit); in rewriteToObjCLiteralSyntax()
350 return rewriteToNumberLiteral(Msg, NS, commit); in rewriteToObjCLiteralSyntax()
352 return rewriteToStringBoxedExpression(Msg, NS, commit); in rewriteToObjCLiteralSyntax()
375 static void objectifyExpr(const Expr *E, Commit &commit);
378 const NSAPI &NS, Commit &commit, in rewriteToArrayLiteral() argument
393 commit.replace(MsgRange, "@[]"); in rewriteToArrayLiteral()
400 objectifyExpr(Msg->getArg(0), commit); in rewriteToArrayLiteral()
402 commit.replaceWithInner(MsgRange, ArgRange); in rewriteToArrayLiteral()
403 commit.insertWrap("@[", ArgRange, "]"); in rewriteToArrayLiteral()
416 objectifyExpr(Msg->getArg(i), commit); in rewriteToArrayLiteral()
419 commit.replace(MsgRange, "@[]"); in rewriteToArrayLiteral()
424 commit.replaceWithInner(MsgRange, ArgRange); in rewriteToArrayLiteral()
425 commit.insertWrap("@[", ArgRange, "]"); in rewriteToArrayLiteral()
490 const NSAPI &NS, Commit &commit) { in rewriteToDictionaryLiteral() argument
497 commit.replace(MsgRange, "@{}"); in rewriteToDictionaryLiteral()
506 objectifyExpr(Msg->getArg(0), commit); in rewriteToDictionaryLiteral()
507 objectifyExpr(Msg->getArg(1), commit); in rewriteToDictionaryLiteral()
512 commit.insertBefore(ValRange.getBegin(), ": "); in rewriteToDictionaryLiteral()
513 commit.insertFromRange(ValRange.getBegin(), in rewriteToDictionaryLiteral()
516 commit.insertBefore(ValRange.getBegin(), "@{"); in rewriteToDictionaryLiteral()
517 commit.insertAfterToken(ValRange.getEnd(), "}"); in rewriteToDictionaryLiteral()
518 commit.replaceWithInner(MsgRange, ValRange); in rewriteToDictionaryLiteral()
533 commit.replace(MsgRange, "@{}"); in rewriteToDictionaryLiteral()
538 objectifyExpr(Msg->getArg(i), commit); in rewriteToDictionaryLiteral()
539 objectifyExpr(Msg->getArg(i+1), commit); in rewriteToDictionaryLiteral()
544 commit.insertAfterToken(KeyRange.getEnd(), ": "); in rewriteToDictionaryLiteral()
545 commit.insertFromRange(KeyRange.getEnd(), ValRange, /*afterToken=*/true); in rewriteToDictionaryLiteral()
546 commit.remove(CharSourceRange::getCharRange(ValRange.getBegin(), in rewriteToDictionaryLiteral()
554 commit.insertWrap("@{", ArgRange, "}"); in rewriteToDictionaryLiteral()
555 commit.replaceWithInner(MsgRange, ArgRange); in rewriteToDictionaryLiteral()
577 commit.replace(MsgRange, "@{}"); in rewriteToDictionaryLiteral()
582 objectifyExpr(Vals[i], commit); in rewriteToDictionaryLiteral()
583 objectifyExpr(Keys[i], commit); in rewriteToDictionaryLiteral()
588 commit.insertAfterToken(KeyRange.getEnd(), ": "); in rewriteToDictionaryLiteral()
589 commit.insertFromRange(KeyRange.getEnd(), ValRange, /*afterToken=*/true); in rewriteToDictionaryLiteral()
594 commit.insertWrap("@{", ArgRange, "}"); in rewriteToDictionaryLiteral()
595 commit.replaceWithInner(MsgRange, ArgRange); in rewriteToDictionaryLiteral()
644 const NSAPI &NS, Commit &commit) { in rewriteToCharLiteral() argument
650 commit.replaceWithInner(Msg->getSourceRange(), ArgRange); in rewriteToCharLiteral()
651 commit.insert(ArgRange.getBegin(), "@"); in rewriteToCharLiteral()
655 return rewriteToNumericBoxedExpression(Msg, NS, commit); in rewriteToCharLiteral()
660 const NSAPI &NS, Commit &commit) { in rewriteToBoolLiteral() argument
664 commit.replaceWithInner(Msg->getSourceRange(), ArgRange); in rewriteToBoolLiteral()
665 commit.insert(ArgRange.getBegin(), "@"); 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()
794 return rewriteToNumericBoxedExpression(Msg, NS, commit); in rewriteToNumberLiteral()
832 commit.replaceWithInner(Msg->getSourceRange(), ArgRange); in rewriteToNumberLiteral()
833 commit.insert(ArgRange.getBegin(), "@"); 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()
867 commit.replaceWithInner(CharSourceRange::getTokenRange(Msg->getSourceRange()), in rewriteToNumberLiteral()
869 commit.insert(LitB, "@"); in rewriteToNumberLiteral()
872 commit.insert(LitE, ".0"); in rewriteToNumberLiteral()
876 commit.insert(LitE, LitInfo.F); in rewriteToNumberLiteral()
879 commit.insert(LitE, LitInfo.U); in rewriteToNumberLiteral()
882 commit.insert(LitE, LitInfo.L); in rewriteToNumberLiteral()
884 commit.insert(LitE, LitInfo.LL); in rewriteToNumberLiteral()
942 static void objectifyExpr(const Expr *E, Commit &commit) { in objectifyExpr() argument
959 commit.insertWrap("(", Range, ")"); in objectifyExpr()
960 commit.insertBefore(Range.getBegin(), "(id)"); in objectifyExpr()
976 const NSAPI &NS, Commit &commit) { in rewriteToNumericBoxedExpression() argument
1109 commit.replaceWithInner(Msg->getSourceRange(), ArgRange); in rewriteToNumericBoxedExpression()
1112 commit.insertBefore(ArgRange.getBegin(), "@"); in rewriteToNumericBoxedExpression()
1114 commit.insertWrap("@(", ArgRange, ")"); in rewriteToNumericBoxedExpression()
1125 const NSAPI &NS, Commit &commit) { in doRewriteToUTF8StringBoxedExpressionHelper() argument
1139 commit.replaceWithInner(Msg->getSourceRange(), StrE->getSourceRange()); in doRewriteToUTF8StringBoxedExpressionHelper()
1140 commit.insert(StrE->getBeginLoc(), "@"); in doRewriteToUTF8StringBoxedExpressionHelper()
1148 commit.replaceWithInner(Msg->getSourceRange(), ArgRange); in doRewriteToUTF8StringBoxedExpressionHelper()
1151 commit.insertBefore(ArgRange.getBegin(), "@"); in doRewriteToUTF8StringBoxedExpressionHelper()
1153 commit.insertWrap("@(", ArgRange, ")"); in doRewriteToUTF8StringBoxedExpressionHelper()
1163 const NSAPI &NS, Commit &commit) { in rewriteToStringBoxedExpression() argument
1171 return doRewriteToUTF8StringBoxedExpressionHelper(Msg, NS, commit); in rewriteToStringBoxedExpression()
1181 return doRewriteToUTF8StringBoxedExpressionHelper(Msg, NS, commit); in rewriteToStringBoxedExpression()