[cfe-commits] r62424 - in /cfe/trunk: include/clang/Lex/PTHManager.h lib/Lex/PPLexerChange.cpp lib/Lex/PTHLexer.cpp
Chris Lattner
sabre at nondot.org
Sat Jan 17 00:06:50 PST 2009
Author: lattner
Date: Sat Jan 17 02:06:50 2009
New Revision: 62424
URL: http://llvm.org/viewvc/llvm-project?rev=62424&view=rev
Log:
simplify PTHManager::CreateLexer
Modified:
cfe/trunk/include/clang/Lex/PTHManager.h
cfe/trunk/lib/Lex/PPLexerChange.cpp
cfe/trunk/lib/Lex/PTHLexer.cpp
Modified: cfe/trunk/include/clang/Lex/PTHManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/PTHManager.h?rev=62424&r1=62423&r2=62424&view=diff
==============================================================================
--- cfe/trunk/include/clang/Lex/PTHManager.h (original)
+++ cfe/trunk/include/clang/Lex/PTHManager.h Sat Jan 17 02:06:50 2009
@@ -128,7 +128,7 @@
/// CreateLexer - Return a PTHLexer that "lexes" the cached tokens for the
/// specified file. This method returns NULL if no cached tokens exist.
/// It is the responsibility of the caller to 'delete' the returned object.
- PTHLexer *CreateLexer(FileID FID, const FileEntry *FE);
+ PTHLexer *CreateLexer(FileID FID);
unsigned getSpelling(SourceLocation Loc, const char *&Buffer);
private:
Modified: cfe/trunk/lib/Lex/PPLexerChange.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPLexerChange.cpp?rev=62424&r1=62423&r2=62424&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPLexerChange.cpp (original)
+++ cfe/trunk/lib/Lex/PPLexerChange.cpp Sat Jan 17 02:06:50 2009
@@ -74,7 +74,7 @@
MaxIncludeStackDepth = IncludeMacroStack.size();
if (PTH) {
- if (PTHLexer *PL = PTH->CreateLexer(FID, SourceMgr.getFileEntryForID(FID)))
+ if (PTHLexer *PL = PTH->CreateLexer(FID))
return EnterSourceFileWithPTH(PL, CurDir);
}
EnterSourceFileWithLexer(new Lexer(FID, *this), CurDir);
Modified: cfe/trunk/lib/Lex/PTHLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PTHLexer.cpp?rev=62424&r1=62423&r2=62424&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PTHLexer.cpp (original)
+++ cfe/trunk/lib/Lex/PTHLexer.cpp Sat Jan 17 02:06:50 2009
@@ -668,7 +668,8 @@
}
-PTHLexer* PTHManager::CreateLexer(FileID FID, const FileEntry* FE) {
+PTHLexer *PTHManager::CreateLexer(FileID FID) {
+ const FileEntry *FE = PP->getSourceManager().getFileEntryForID(FID);
if (!FE)
return 0;
More information about the cfe-commits
mailing list