Home | History | Annotate | Download | only in Edit

Lines Matching full:commit

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