diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-26 00:43:02 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-26 00:43:02 +0000 |
commit | 4fa23625abb476ac89b84d06ee2a45ef822eaf15 (patch) | |
tree | 005a1b93adaf38a3e73ea0b512bafce88140568f /clang/lib/Lex/TokenLexer.cpp | |
parent | cf8e1fa58e25fbc49b2358994e5f83498aff5dd3 (diff) | |
download | bcm5719-llvm-4fa23625abb476ac89b84d06ee2a45ef822eaf15.tar.gz bcm5719-llvm-4fa23625abb476ac89b84d06ee2a45ef822eaf15.zip |
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.
llvm-svn: 62978
Diffstat (limited to 'clang/lib/Lex/TokenLexer.cpp')
-rw-r--r-- | clang/lib/Lex/TokenLexer.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Lex/TokenLexer.cpp b/clang/lib/Lex/TokenLexer.cpp index dd5352c1b61..ea4ce669d1d 100644 --- a/clang/lib/Lex/TokenLexer.cpp +++ b/clang/lib/Lex/TokenLexer.cpp @@ -314,8 +314,9 @@ void TokenLexer::Lex(Token &Tok) { // that captures all of this. if (InstantiateLoc.isValid()) { // Don't do this for token streams. SourceManager &SrcMgr = PP.getSourceManager(); - Tok.setLocation(SrcMgr.getInstantiationLoc(Tok.getLocation(), - InstantiateLoc)); + Tok.setLocation(SrcMgr.createInstantiationLoc(Tok.getLocation(), + InstantiateLoc, + Tok.getLength())); } // If this is the first token, set the lexical properties of the token to @@ -398,7 +399,7 @@ bool TokenLexer::PasteTokens(Token &Tok) { "Should be a raw location into scratch buffer"); SourceManager &SourceMgr = PP.getSourceManager(); std::pair<FileID, unsigned> LocInfo = - SourceMgr.getDecomposedFileLoc(ResultTokLoc); + SourceMgr.getDecomposedLoc(ResultTokLoc); const char *ScratchBufStart =SourceMgr.getBufferData(LocInfo.first).first; |