summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/Lexer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-17 08:45:21 +0000
committerChris Lattner <sabre@nondot.org>2009-01-17 08:45:21 +0000
commit71dc14b9f0ea58d1c113ab7226bc67793347e4a3 (patch)
treebe04630aeca6bdb5544c8800baa930b929109f7b /clang/lib/Lex/Lexer.cpp
parent5509d533f6843a977e8f11819b747f6cd09f3273 (diff)
downloadbcm5719-llvm-71dc14b9f0ea58d1c113ab7226bc67793347e4a3.tar.gz
bcm5719-llvm-71dc14b9f0ea58d1c113ab7226bc67793347e4a3.zip
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. llvm-svn: 62427
Diffstat (limited to 'clang/lib/Lex/Lexer.cpp')
-rw-r--r--clang/lib/Lex/Lexer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp
index 90785b5e193..6e5402e8a37 100644
--- a/clang/lib/Lex/Lexer.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud