From 77e9de50a112dc3f0bee0d43469db4bde47225c9 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 20 Jul 2007 16:52:03 +0000 Subject: simplify the lexer ctor to take a SLoc instead of a sloc and a redundant buffer*. llvm-svn: 40104 --- clang/Lex/MacroExpander.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'clang/Lex/MacroExpander.cpp') diff --git a/clang/Lex/MacroExpander.cpp b/clang/Lex/MacroExpander.cpp index 9a80ac3c3fb..53ff3f14ca0 100644 --- a/clang/Lex/MacroExpander.cpp +++ b/clang/Lex/MacroExpander.cpp @@ -578,13 +578,8 @@ void MacroExpander::PasteTokens(LexerToken &Tok) { SourceManager &SourceMgr = PP.getSourceManager(); const char *ResultStrData = SourceMgr.getCharacterData(ResultTokLoc); - unsigned FileID = ResultTokLoc.getFileID(); - 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), - SourceLocation::getFileLoc(FileID, 0), PP, - ResultStrData, + Lexer *TL = new Lexer(ResultTokLoc, PP, ResultStrData, ResultStrData+LHSLen+RHSLen /*don't include null*/); // Lex a token in raw mode. This way it won't look up identifiers -- cgit v1.2.3