Home | History | Annotate | Download | only in ARCMigrate

Lines Matching refs:loc

46     SourceLocation Loc;
134 void insert(SourceLocation loc, StringRef text);
135 void insertAfterToken(SourceLocation loc, StringRef text);
141 void replaceText(SourceLocation loc, StringRef text,
151 bool canInsert(SourceLocation loc);
152 bool canInsertAfterToken(SourceLocation loc);
155 bool canReplaceText(SourceLocation loc, StringRef text);
157 void commitInsert(SourceLocation loc, StringRef text);
158 void commitInsertAfterToken(SourceLocation loc, StringRef text);
162 void commitReplaceText(SourceLocation loc, StringRef text,
168 void addInsertion(SourceLocation loc, StringRef text);
178 static SourceLocation getLocForEndOfToken(SourceLocation loc,
204 if (!canInsert(act.Loc))
208 if (!canInsertAfterToken(act.Loc))
225 if (!canReplaceText(act.Loc, act.Text1))
248 commitInsert(act.Loc, act.Text1);
251 commitInsertAfterToken(act.Loc, act.Text1);
263 commitReplaceText(act.Loc, act.Text1, act.Text2);
266 commitIncreaseIndentation(act.R1, act.Loc);
285 void TransformActionsImpl::insert(SourceLocation loc, StringRef text) {
290 data.Loc = loc;
295 void TransformActionsImpl::insertAfterToken(SourceLocation loc, StringRef text) {
300 data.Loc = loc;
338 void TransformActionsImpl::replaceText(SourceLocation loc, StringRef text,
344 data.Loc = loc;
364 data.Loc = parentIndent;
382 bool TransformActionsImpl::canInsert(SourceLocation loc) {
383 if (loc.isInvalid())
387 if (SM.isInSystemHeader(SM.getExpansionLoc(loc)))
390 if (loc.isFileID())
392 return PP.isAtStartOfMacroExpansion(loc);
395 bool TransformActionsImpl::canInsertAfterToken(SourceLocation loc) {
396 if (loc.isInvalid())
400 if (SM.isInSystemHeader(SM.getExpansionLoc(loc)))
403 if (loc.isFileID())
405 return PP.isAtEndOfMacroExpansion(loc);
417 bool TransformActionsImpl::canReplaceText(SourceLocation loc, StringRef text) {
418 if (!canInsert(loc))
422 loc = SM.getExpansionLoc(loc);
425 std::pair<FileID, unsigned> locInfo = SM.getDecomposedLoc(loc);
436 void TransformActionsImpl::commitInsert(SourceLocation loc, StringRef text) {
437 addInsertion(loc, text);
440 void TransformActionsImpl::commitInsertAfterToken(SourceLocation loc,
442 addInsertion(getLocForEndOfToken(loc, Ctx.getSourceManager(), PP), text);
479 void TransformActionsImpl::commitReplaceText(SourceLocation loc,
483 loc = SM.getExpansionLoc(loc);
484 // canReplaceText already checked if loc points at text.
485 SourceLocation afterText = loc.getLocWithOffset(text.size());
487 addRemoval(CharSourceRange::getCharRange(loc, afterText));
488 commitInsert(loc, replacementText);
505 void TransformActionsImpl::addInsertion(SourceLocation loc, StringRef text) {
507 loc = SM.getExpansionLoc(loc);
510 if (!SM.isBeforeInTranslationUnit(loc, I->End))
512 if (I->Begin.isBeforeInTranslationUnitThan(loc))
516 Inserts[FullSourceLoc(loc, SM)].push_back(text);
559 SourceLocation loc = I->first;
562 receiver.insert(loc, *TI);
591 SourceLocation TransformActionsImpl::getLocForEndOfToken(SourceLocation loc,
594 if (loc.isMacroID())
595 loc = SM.getExpansionRange(loc).second;
596 return PP.getLocForEndOfToken(loc);
625 void TransformActions::insert(SourceLocation loc, StringRef text) {
626 static_cast<TransformActionsImpl*>(Impl)->insert(loc, text);
629 void TransformActions::insertAfterToken(SourceLocation loc,
631 static_cast<TransformActionsImpl*>(Impl)->insertAfterToken(loc, text);
655 void TransformActions::replaceText(SourceLocation loc, StringRef text,
657 static_cast<TransformActionsImpl*>(Impl)->replaceText(loc, text,
676 DiagnosticBuilder TransformActions::report(SourceLocation loc, unsigned diagId,
680 return Diags.Report(loc, diagId) << range;
683 void TransformActions::reportError(StringRef message, SourceLocation loc,
685 report(loc, diag::err_mt_message, range) << message;
688 void TransformActions::reportWarning(StringRef message, SourceLocation loc,
690 report(loc, diag::warn_mt_message, range) << message;
693 void TransformActions::reportNote(StringRef message, SourceLocation loc,
695 report(loc, diag::note_mt_message, range) << message;