diff options
author | Chris Lattner <sabre@nondot.org> | 2007-07-20 16:37:10 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-07-20 16:37:10 +0000 |
commit | 9dc1f530c086d2c16f8cba758b0f59a5bf41323a (patch) | |
tree | a68f846d3ccbf60f1b03c6a382a7e706dfa917ee /Lex/MacroExpander.cpp | |
parent | 030d8846c7e520330007087e949f621989876e3a (diff) |
Reimplement SourceLocation. Instead of having a
fileid/offset pair, it now contains a bit discriminating between
mapped locations and file locations. This separates the tables for
macros and files in SourceManager, and allows better separation of
concepts in the rest of the compiler. This allows us to have *many*
macro instantiations before running out of 'addressing space'.
This is also more efficient, because testing whether something is a
macro expansion is now a bit test instead of a table lookup (which
also used to require having a srcmgr around, now it doesn't).
This is fully functional, but there are several refinements and
optimizations left.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40103 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Lex/MacroExpander.cpp')
-rw-r--r-- | Lex/MacroExpander.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lex/MacroExpander.cpp b/Lex/MacroExpander.cpp index e474906050..9a80ac3c3f 100644 --- a/Lex/MacroExpander.cpp +++ b/Lex/MacroExpander.cpp @@ -582,7 +582,8 @@ void MacroExpander::PasteTokens(LexerToken &Tok) { assert(FileID && "Could not get FileID for paste?"); // Make a lexer object so that we lex and expand the paste result. - Lexer *TL = new Lexer(SourceMgr.getBuffer(FileID), FileID, PP, + Lexer *TL = new Lexer(SourceMgr.getBuffer(FileID), + SourceLocation::getFileLoc(FileID, 0), PP, ResultStrData, ResultStrData+LHSLen+RHSLen /*don't include null*/); |