diff options
| author | Chris Lattner <sabre@nondot.org> | 2007-07-20 16:52:03 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2007-07-20 16:52:03 +0000 |
| commit | 77e9de50a112dc3f0bee0d43469db4bde47225c9 (patch) | |
| tree | 839d0805434f98057a49f5216acde711300486d3 /clang/Lex/Preprocessor.cpp | |
| parent | dc5c055fd1b31a0f5b11030a4e6ea5d6f2ed7d86 (diff) | |
| download | bcm5719-llvm-77e9de50a112dc3f0bee0d43469db4bde47225c9.tar.gz bcm5719-llvm-77e9de50a112dc3f0bee0d43469db4bde47225c9.zip | |
simplify the lexer ctor to take a SLoc instead of a sloc and a redundant buffer*.
llvm-svn: 40104
Diffstat (limited to 'clang/Lex/Preprocessor.cpp')
| -rw-r--r-- | clang/Lex/Preprocessor.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/clang/Lex/Preprocessor.cpp b/clang/Lex/Preprocessor.cpp index c3fd5542646..59ade23f5ce 100644 --- a/clang/Lex/Preprocessor.cpp +++ b/clang/Lex/Preprocessor.cpp @@ -281,8 +281,7 @@ SourceLocation Preprocessor::AdvanceToTokenCharacter(SourceLocation TokStart, // lexer to parse it correctly. if (CharNo != 0) { // Create a lexer starting at this token position. - const llvm::MemoryBuffer *SrcBuf =SourceMgr.getBuffer(TokStart.getFileID()); - Lexer TheLexer(SrcBuf, TokStart, *this, TokPtr); + Lexer TheLexer(TokStart, *this, TokPtr); LexerToken Tok; // Skip over characters the remaining characters. const char *TokStartPtr = TokPtr; @@ -390,9 +389,7 @@ void Preprocessor::EnterSourceFile(unsigned FileID, if (MaxIncludeStackDepth < IncludeMacroStack.size()) MaxIncludeStackDepth = IncludeMacroStack.size(); - const llvm::MemoryBuffer *Buffer = SourceMgr.getBuffer(FileID); - Lexer *TheLexer = new Lexer(Buffer, SourceLocation::getFileLoc(FileID, 0), - *this); + Lexer *TheLexer = new Lexer(SourceLocation::getFileLoc(FileID, 0), *this); if (isMainFile) TheLexer->setIsMainFile(); EnterSourceFileWithLexer(TheLexer, CurDir); } |

