aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/PTHLexer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-26 00:43:02 +0000
committerChris Lattner <sabre@nondot.org>2009-01-26 00:43:02 +0000
commitde7aeefc5573d669ed476d7bda7a8940d3bcadb7 (patch)
treeb5f4fa05086f338809a94ec330d26860961c1df2 /lib/Lex/PTHLexer.cpp
parent51abf6b3bfe03fe9a22d7865da65580e682f9672 (diff)
Check in the long promised SourceLocation rewrite. This lays the
ground work for implementing #line, and fixes the "out of macro ID's" problem. There is nothing particularly tricky about the code, other than the very performance sensitive SourceManager::getFileID() method. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62978 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PTHLexer.cpp')
-rw-r--r--lib/Lex/PTHLexer.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Lex/PTHLexer.cpp b/lib/Lex/PTHLexer.cpp
index ec76a29984..f6994e0976 100644
--- a/lib/Lex/PTHLexer.cpp
+++ b/lib/Lex/PTHLexer.cpp
@@ -321,7 +321,7 @@ unsigned PTHManager::getSpelling(FileID FID, unsigned FPos,
unsigned PTHManager::getSpelling(SourceLocation Loc, const char *&Buffer) {
SourceManager &SM = PP->getSourceManager();
Loc = SM.getSpellingLoc(Loc);
- std::pair<FileID, unsigned> LocInfo = SM.getDecomposedFileLoc(Loc);
+ std::pair<FileID, unsigned> LocInfo = SM.getDecomposedLoc(Loc);
return getSpelling(LocInfo.first, LocInfo.second, Buffer);
}
@@ -407,8 +407,7 @@ unsigned PTHSpellingSearch::getSpellingBinarySearch(unsigned FPos,
unsigned PTHLexer::getSpelling(SourceLocation Loc, const char *&Buffer) {
SourceManager &SM = PP->getSourceManager();
- Loc = SM.getSpellingLoc(Loc);
- std::pair<FileID, unsigned> LocInfo = SM.getDecomposedFileLoc(Loc);
+ std::pair<FileID, unsigned> LocInfo = SM.getDecomposedSpellingLoc(Loc);
FileID FID = LocInfo.first;
unsigned FPos = LocInfo.second;