Home | History | Annotate | Download | only in ARCMigrate

Lines Matching defs:Loc

47     SourceLocation Loc;
133 void insert(SourceLocation loc, llvm::StringRef text);
134 void insertAfterToken(SourceLocation loc, llvm::StringRef text);
140 void replaceText(SourceLocation loc, llvm::StringRef text,
150 bool canInsert(SourceLocation loc);
151 bool canInsertAfterToken(SourceLocation loc);
154 bool canReplaceText(SourceLocation loc, llvm::StringRef text);
156 void commitInsert(SourceLocation loc, StringRef text);
157 void commitInsertAfterToken(SourceLocation loc, StringRef text);
161 void commitReplaceText(SourceLocation loc, llvm::StringRef text,
167 void addInsertion(SourceLocation loc, StringRef text);
177 static SourceLocation getLocForEndOfToken(SourceLocation loc,
203 if (!canInsert(act.Loc))
207 if (!canInsertAfterToken(act.Loc))
224 if (!canReplaceText(act.Loc, act.Text1))
247 commitInsert(act.Loc, act.Text1);
250 commitInsertAfterToken(act.Loc, act.Text1);
262 commitReplaceText(act.Loc, act.Text1, act.Text2);
265 commitIncreaseIndentation(act.R1, act.Loc);
284 void TransformActionsImpl::insert(SourceLocation loc, StringRef text) {
289 data.Loc = loc;
294 void TransformActionsImpl::insertAfterToken(SourceLocation loc, StringRef text) {
299 data.Loc = loc;
337 void TransformActionsImpl::replaceText(SourceLocation loc, StringRef text,
343 data.Loc = loc;
363 data.Loc = parentIndent;
381 bool TransformActionsImpl::canInsert(SourceLocation loc) {
382 if (loc.isInvalid())
386 if (SM.isInSystemHeader(SM.getInstantiationLoc(loc)))
389 if (loc.isFileID())
391 return PP.isAtStartOfMacroExpansion(loc);
394 bool TransformActionsImpl::canInsertAfterToken(SourceLocation loc) {
395 if (loc.isInvalid())
399 if (SM.isInSystemHeader(SM.getInstantiationLoc(loc)))
402 if (loc.isFileID())
404 return PP.isAtEndOfMacroExpansion(loc);
416 bool TransformActionsImpl::canReplaceText(SourceLocation loc, StringRef text) {
417 if (!canInsert(loc))
421 loc = SM.getInstantiationLoc(loc);
424 std::pair<FileID, unsigned> locInfo = SM.getDecomposedLoc(loc);
435 void TransformActionsImpl::commitInsert(SourceLocation loc, StringRef text) {
436 addInsertion(loc, text);
439 void TransformActionsImpl::commitInsertAfterToken(SourceLocation loc,
441 addInsertion(getLocForEndOfToken(loc, Ctx.getSourceManager(), PP), text);
478 void TransformActionsImpl::commitReplaceText(SourceLocation loc,
482 loc = SM.getInstantiationLoc(loc);
483 // canReplaceText already checked if loc points at text.
484 SourceLocation afterText = loc.getFileLocWithOffset(text.size());
486 addRemoval(CharSourceRange::getCharRange(loc, afterText));
487 commitInsert(loc, replacementText);
504 void TransformActionsImpl::addInsertion(SourceLocation loc, StringRef text) {
506 loc = SM.getInstantiationLoc(loc);
509 if (!SM.isBeforeInTranslationUnit(loc, I->End))
511 if (I->Begin.isBeforeInTranslationUnitThan(loc))
515 Inserts[FullSourceLoc(loc, SM)].push_back(text);
558 SourceLocation loc = I->first;
561 receiver.insert(loc, *TI);
590 SourceLocation TransformActionsImpl::getLocForEndOfToken(SourceLocation loc,
593 if (loc.isMacroID())
594 loc = SM.getInstantiationRange(loc).second;
595 return PP.getLocForEndOfToken(loc);
624 void TransformActions::insert(SourceLocation loc, llvm::StringRef text) {
625 static_cast<TransformActionsImpl*>(Impl)->insert(loc, text);
628 void TransformActions::insertAfterToken(SourceLocation loc,
630 static_cast<TransformActionsImpl*>(Impl)->insertAfterToken(loc, text);
654 void TransformActions::replaceText(SourceLocation loc, llvm::StringRef text,
656 static_cast<TransformActionsImpl*>(Impl)->replaceText(loc, text,
675 void TransformActions::reportError(llvm::StringRef error, SourceLocation loc,
685 Diags.Report(loc, diagID) << range;
689 void TransformActions::reportNote(llvm::StringRef note, SourceLocation loc,
699 Diags.Report(loc, diagID) << range;