Lines Matching refs:loc
43 bool Commit::insert(SourceLocation loc, StringRef text, in insert() argument
49 if ((!afterToken && !canInsert(loc, Offs)) || in insert()
50 ( afterToken && !canInsertAfterToken(loc, Offs, loc))) { in insert()
55 addInsert(loc, Offs, text, beforePreviousInsertions); in insert()
59 bool Commit::insertFromRange(SourceLocation loc, in insertFromRange() argument
70 if ((!afterToken && !canInsert(loc, Offs)) || in insertFromRange()
71 ( afterToken && !canInsertAfterToken(loc, Offs, loc))) { in insertFromRange()
77 PPRec->areInDifferentConditionalDirectiveRegion(loc, range.getBegin())) { in insertFromRange()
82 addInsertFromRange(loc, Offs, RangeOffs, RangeLen, beforePreviousInsertions); in insertFromRange()
160 bool Commit::replaceText(SourceLocation loc, StringRef text, in replaceText() argument
167 if (!canReplaceText(loc, replacementText, Offs, Len)) { in replaceText()
172 addRemove(loc, Offs, Len); in replaceText()
173 addInsert(loc, Offs, text, false); in replaceText()
220 bool Commit::canInsert(SourceLocation loc, FileOffset &offs) { in canInsert() argument
221 if (loc.isInvalid()) in canInsert()
224 if (loc.isMacroID()) in canInsert()
225 isAtStartOfMacroExpansion(loc, &loc); in canInsert()
228 while (SM.isMacroArgExpansion(loc)) in canInsert()
229 loc = SM.getImmediateSpellingLoc(loc); in canInsert()
231 if (loc.isMacroID()) in canInsert()
232 if (!isAtStartOfMacroExpansion(loc, &loc)) in canInsert()
235 if (SM.isInSystemHeader(loc)) in canInsert()
238 std::pair<FileID, unsigned> locInfo = SM.getDecomposedLoc(loc); in canInsert()
242 return canInsertInOffset(loc, offs); in canInsert()
245 bool Commit::canInsertAfterToken(SourceLocation loc, FileOffset &offs, in canInsertAfterToken() argument
247 if (loc.isInvalid()) in canInsertAfterToken()
251 SourceLocation spellLoc = SourceMgr.getSpellingLoc(loc); in canInsertAfterToken()
253 AfterLoc = loc.getLocWithOffset(tokLen); in canInsertAfterToken()
255 if (loc.isMacroID()) in canInsertAfterToken()
256 isAtEndOfMacroExpansion(loc, &loc); in canInsertAfterToken()
259 while (SM.isMacroArgExpansion(loc)) in canInsertAfterToken()
260 loc = SM.getImmediateSpellingLoc(loc); in canInsertAfterToken()
262 if (loc.isMacroID()) in canInsertAfterToken()
263 if (!isAtEndOfMacroExpansion(loc, &loc)) in canInsertAfterToken()
266 if (SM.isInSystemHeader(loc)) in canInsertAfterToken()
269 loc = Lexer::getLocForEndOfToken(loc, 0, SourceMgr, LangOpts); in canInsertAfterToken()
270 if (loc.isInvalid()) in canInsertAfterToken()
273 std::pair<FileID, unsigned> locInfo = SM.getDecomposedLoc(loc); in canInsertAfterToken()
277 return canInsertInOffset(loc, offs); in canInsertAfterToken()
322 bool Commit::canReplaceText(SourceLocation loc, StringRef text, in canReplaceText() argument
326 if (!canInsert(loc, Offs)) in canReplaceText()
339 bool Commit::isAtStartOfMacroExpansion(SourceLocation loc, in isAtStartOfMacroExpansion() argument
341 return Lexer::isAtStartOfMacroExpansion(loc, SourceMgr, LangOpts, MacroBegin); in isAtStartOfMacroExpansion()
343 bool Commit::isAtEndOfMacroExpansion(SourceLocation loc, in isAtEndOfMacroExpansion() argument
345 return Lexer::isAtEndOfMacroExpansion(loc, SourceMgr, LangOpts, MacroEnd); in isAtEndOfMacroExpansion()