diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-17 08:45:21 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-17 08:45:21 +0000 |
commit | 3b4d5e955e819dd3a4bed37ea2e47d6e4cb05274 (patch) | |
tree | 0d9315c2e9e35acc7bb28187942346a41292cf45 /lib/Lex/Lexer.cpp | |
parent | 8350394c65b81bba3986dfe44ae17423873741de (diff) |
Rename SourceLocation::getFileID to getChunkID, because it returns
the chunk ID not the file ID. This exposes problems in
TextDiagnosticPrinter where it should have been using the canonical
file ID but wasn't. Fix these along the way.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62427 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Lexer.cpp')
-rw-r--r-- | lib/Lex/Lexer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp index 90785b5e19..6e5402e8a3 100644 --- a/lib/Lex/Lexer.cpp +++ b/lib/Lex/Lexer.cpp @@ -321,7 +321,7 @@ static SourceLocation GetMappedTokenLoc(Preprocessor &PP, // characters come from spelling(FileLoc)+Offset. SourceLocation InstLoc = SourceMgr.getInstantiationLoc(FileLoc); SourceLocation SpellingLoc = SourceMgr.getSpellingLoc(FileLoc); - SpellingLoc = SourceLocation::getFileLoc(SpellingLoc.getFileID(), CharNo); + SpellingLoc = SourceLocation::getFileLoc(SpellingLoc.getChunkID(), CharNo); return SourceMgr.getInstantiationLoc(SpellingLoc, InstLoc); } @@ -335,7 +335,7 @@ SourceLocation Lexer::getSourceLocation(const char *Loc) const { // the file id from FileLoc with the offset specified. unsigned CharNo = Loc-BufferStart; if (FileLoc.isFileID()) - return SourceLocation::getFileLoc(FileLoc.getFileID(), CharNo); + return SourceLocation::getFileLoc(FileLoc.getChunkID(), CharNo); // Otherwise, this is the _Pragma lexer case, which pretends that all of the // tokens are lexed from where the _Pragma was defined. |