Lines Matching refs:loc
133 void insert(SourceLocation loc, StringRef text);
134 void insertAfterToken(SourceLocation loc, StringRef text);
140 void replaceText(SourceLocation loc, StringRef text,
150 bool canInsert(SourceLocation loc);
151 bool canInsertAfterToken(SourceLocation loc);
154 bool canReplaceText(SourceLocation loc, StringRef text);
156 void commitInsert(SourceLocation loc, StringRef text);
157 void commitInsertAfterToken(SourceLocation loc, StringRef text);
161 void commitReplaceText(SourceLocation loc, StringRef text,
167 void addInsertion(SourceLocation loc, StringRef text);
177 static SourceLocation getLocForEndOfToken(SourceLocation loc,
284 void TransformActionsImpl::insert(SourceLocation loc, StringRef text) { in insert() argument
289 data.Loc = loc; in insert()
294 void TransformActionsImpl::insertAfterToken(SourceLocation loc, StringRef text) { in insertAfterToken() argument
299 data.Loc = loc; in insertAfterToken()
339 void TransformActionsImpl::replaceText(SourceLocation loc, StringRef text, in replaceText() argument
345 data.Loc = loc; in replaceText()
383 bool TransformActionsImpl::canInsert(SourceLocation loc) { in canInsert() argument
384 if (loc.isInvalid()) in canInsert()
388 if (SM.isInSystemHeader(SM.getExpansionLoc(loc))) in canInsert()
391 if (loc.isFileID()) in canInsert()
393 return PP.isAtStartOfMacroExpansion(loc); in canInsert()
396 bool TransformActionsImpl::canInsertAfterToken(SourceLocation loc) { in canInsertAfterToken() argument
397 if (loc.isInvalid()) in canInsertAfterToken()
401 if (SM.isInSystemHeader(SM.getExpansionLoc(loc))) in canInsertAfterToken()
404 if (loc.isFileID()) in canInsertAfterToken()
406 return PP.isAtEndOfMacroExpansion(loc); in canInsertAfterToken()
418 bool TransformActionsImpl::canReplaceText(SourceLocation loc, StringRef text) { in canReplaceText() argument
419 if (!canInsert(loc)) in canReplaceText()
423 loc = SM.getExpansionLoc(loc); in canReplaceText()
426 std::pair<FileID, unsigned> locInfo = SM.getDecomposedLoc(loc); in canReplaceText()
437 void TransformActionsImpl::commitInsert(SourceLocation loc, StringRef text) { in commitInsert() argument
438 addInsertion(loc, text); in commitInsert()
441 void TransformActionsImpl::commitInsertAfterToken(SourceLocation loc, in commitInsertAfterToken() argument
443 addInsertion(getLocForEndOfToken(loc, Ctx.getSourceManager(), PP), text); in commitInsertAfterToken()
480 void TransformActionsImpl::commitReplaceText(SourceLocation loc, in commitReplaceText() argument
484 loc = SM.getExpansionLoc(loc); in commitReplaceText()
486 SourceLocation afterText = loc.getLocWithOffset(text.size()); in commitReplaceText()
488 addRemoval(CharSourceRange::getCharRange(loc, afterText)); in commitReplaceText()
489 commitInsert(loc, replacementText); in commitReplaceText()
506 void TransformActionsImpl::addInsertion(SourceLocation loc, StringRef text) { in addInsertion() argument
508 loc = SM.getExpansionLoc(loc); in addInsertion()
510 if (!SM.isBeforeInTranslationUnit(loc, I.End)) in addInsertion()
512 if (I.Begin.isBeforeInTranslationUnitThan(loc)) in addInsertion()
516 Inserts[FullSourceLoc(loc, SM)].push_back(text); in addInsertion()
560 SourceLocation loc = I->first; in applyRewrites() local
563 receiver.insert(loc, *TI); in applyRewrites()
591 SourceLocation TransformActionsImpl::getLocForEndOfToken(SourceLocation loc, in getLocForEndOfToken() argument
594 if (loc.isMacroID()) { in getLocForEndOfToken()
595 CharSourceRange Exp = SM.getExpansionRange(loc); in getLocForEndOfToken()
598 loc = Exp.getEnd(); in getLocForEndOfToken()
600 return PP.getLocForEndOfToken(loc); in getLocForEndOfToken()
629 void TransformActions::insert(SourceLocation loc, StringRef text) { in insert() argument
630 static_cast<TransformActionsImpl*>(Impl)->insert(loc, text); in insert()
633 void TransformActions::insertAfterToken(SourceLocation loc, in insertAfterToken() argument
635 static_cast<TransformActionsImpl*>(Impl)->insertAfterToken(loc, text); in insertAfterToken()
659 void TransformActions::replaceText(SourceLocation loc, StringRef text, in replaceText() argument
661 static_cast<TransformActionsImpl*>(Impl)->replaceText(loc, text, in replaceText()
680 DiagnosticBuilder TransformActions::report(SourceLocation loc, unsigned diagId, in report() argument
684 return Diags.Report(loc, diagId) << range; in report()
687 void TransformActions::reportError(StringRef message, SourceLocation loc, in reportError() argument
689 report(loc, diag::err_mt_message, range) << message; in reportError()
692 void TransformActions::reportWarning(StringRef message, SourceLocation loc, in reportWarning() argument
694 report(loc, diag::warn_mt_message, range) << message; in reportWarning()
697 void TransformActions::reportNote(StringRef message, SourceLocation loc, in reportNote() argument
699 report(loc, diag::note_mt_message, range) << message; in reportNote()