summaryrefslogtreecommitdiffstats
path: root/clang/Lex/MacroExpander.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-07-20 16:37:10 +0000
committerChris Lattner <sabre@nondot.org>2007-07-20 16:37:10 +0000
commitdc5c055fd1b31a0f5b11030a4e6ea5d6f2ed7d86 (patch)
treec1d6d2527bec792b27987d1fa1a0fcc25486f533 /clang/Lex/MacroExpander.cpp
parente31a61eeca5bb2893a8a683de8e4cf2189a13050 (diff)
downloadbcm5719-llvm-dc5c055fd1b31a0f5b11030a4e6ea5d6f2ed7d86.tar.gz
bcm5719-llvm-dc5c055fd1b31a0f5b11030a4e6ea5d6f2ed7d86.zip
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. llvm-svn: 40103
Diffstat (limited to 'clang/Lex/MacroExpander.cpp')
-rw-r--r--clang/Lex/MacroExpander.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/Lex/MacroExpander.cpp b/clang/Lex/MacroExpander.cpp
index e474906050b..9a80ac3c3fb 100644
--- a/clang/Lex/MacroExpander.cpp
+++ b/clang/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*/);
OpenPOWER on IntegriCloud