diff options
Diffstat (limited to 'lib/Lex/Lexer.cpp')
-rw-r--r-- | lib/Lex/Lexer.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp index 2135cd4fb8..563248877e 100644 --- a/lib/Lex/Lexer.cpp +++ b/lib/Lex/Lexer.cpp @@ -449,7 +449,7 @@ static SourceLocation getBeginningOfFileToken(SourceLocation Loc, } // Create a lexer starting at the beginning of this token. - SourceLocation LexerStartLoc = Loc.getFileLocWithOffset(-LocInfo.second); + SourceLocation LexerStartLoc = Loc.getLocWithOffset(-LocInfo.second); Lexer TheLexer(LexerStartLoc, LangOpts, BufStart, LexStart, Buffer.end()); TheLexer.SetCommentRetentionState(true); @@ -490,7 +490,7 @@ SourceLocation Lexer::GetBeginningOfToken(SourceLocation Loc, std::pair<FileID, unsigned> BeginFileLocInfo= SM.getDecomposedLoc(BeginFileLoc); assert(FileLocInfo.first == BeginFileLocInfo.first && FileLocInfo.second >= BeginFileLocInfo.second); - return Loc.getFileLocWithOffset(SM.getDecomposedLoc(BeginFileLoc).second - + return Loc.getLocWithOffset(SM.getDecomposedLoc(BeginFileLoc).second - SM.getDecomposedLoc(FileLoc).second); } @@ -673,7 +673,7 @@ SourceLocation Lexer::AdvanceToTokenCharacter(SourceLocation TokStart, // chars, this method is extremely fast. while (Lexer::isObviouslySimpleCharacter(*TokPtr)) { if (CharNo == 0) - return TokStart.getFileLocWithOffset(PhysOffset); + return TokStart.getLocWithOffset(PhysOffset); ++TokPtr, --CharNo, ++PhysOffset; } @@ -693,7 +693,7 @@ SourceLocation Lexer::AdvanceToTokenCharacter(SourceLocation TokStart, if (!Lexer::isObviouslySimpleCharacter(*TokPtr)) PhysOffset += Lexer::SkipEscapedNewLines(TokPtr)-TokPtr; - return TokStart.getFileLocWithOffset(PhysOffset); + return TokStart.getLocWithOffset(PhysOffset); } /// \brief Computes the source location just past the end of the @@ -731,7 +731,7 @@ SourceLocation Lexer::getLocForEndOfToken(SourceLocation Loc, unsigned Offset, else return Loc; - return Loc.getFileLocWithOffset(Len); + return Loc.getLocWithOffset(Len); } /// \brief Returns true if the given MacroID location points at the first @@ -768,7 +768,7 @@ bool Lexer::isAtEndOfMacroExpansion(SourceLocation loc, return false; FileID FID = SM.getFileID(loc); - SourceLocation afterLoc = loc.getFileLocWithOffset(tokLen+1); + SourceLocation afterLoc = loc.getLocWithOffset(tokLen+1); if (SM.isInFileID(afterLoc, FID)) return false; // Still in the same FileID, does not point to the last token. @@ -954,7 +954,7 @@ static SourceLocation GetMappedTokenLoc(Preprocessor &PP, // Create a new SLoc which is expanded from Expansion(FileLoc) but whose // characters come from spelling(FileLoc)+Offset. SourceLocation SpellingLoc = SM.getSpellingLoc(FileLoc); - SpellingLoc = SpellingLoc.getFileLocWithOffset(CharNo); + SpellingLoc = SpellingLoc.getLocWithOffset(CharNo); // Figure out the expansion loc range, which is the range covered by the // original _Pragma(...) sequence. @@ -975,7 +975,7 @@ SourceLocation Lexer::getSourceLocation(const char *Loc, // the file id from FileLoc with the offset specified. unsigned CharNo = Loc-BufferStart; if (FileLoc.isFileID()) - return FileLoc.getFileLocWithOffset(CharNo); + return FileLoc.getLocWithOffset(CharNo); // Otherwise, this is the _Pragma lexer case, which pretends that all of the // tokens are lexed from where the _Pragma was defined. @@ -1126,7 +1126,7 @@ SourceLocation Lexer::findLocationAfterToken(SourceLocation Loc, NumWhitespaceChars++; } - return TokenLoc.getFileLocWithOffset(Tok.getLength() + NumWhitespaceChars); + return TokenLoc.getLocWithOffset(Tok.getLength() + NumWhitespaceChars); } /// getCharAndSizeSlow - Peek a single 'character' from the specified buffer, @@ -2250,7 +2250,7 @@ bool Lexer::HandleEndOfConflictMarker(const char *CurPtr) { bool Lexer::isCodeCompletionPoint(const char *CurPtr) const { if (PP && PP->isCodeCompletionEnabled()) { - SourceLocation Loc = FileLoc.getFileLocWithOffset(CurPtr-BufferStart); + SourceLocation Loc = FileLoc.getLocWithOffset(CurPtr-BufferStart); return Loc == PP->getCodeCompletionLoc(); } |