]> granicus.if.org Git - clang/commitdiff
simplify PTHManager::CreateLexer
authorChris Lattner <sabre@nondot.org>
Sat, 17 Jan 2009 08:06:50 +0000 (08:06 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 17 Jan 2009 08:06:50 +0000 (08:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62424 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Lex/PTHManager.h
lib/Lex/PPLexerChange.cpp
lib/Lex/PTHLexer.cpp

index c4ecfd6ed12bd40ff0041032ba0c9d0b5e44bf63..67e36667583ae803e5323c69b75b9c29c68e9731 100644 (file)
@@ -128,7 +128,7 @@ public:
   /// 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:
index 60d42386d7a0ca12787960bde0f73faef9ceed3d..f8c8636fcb1c15ba8462c1a95583d7a3dc4b376d 100644 (file)
@@ -74,7 +74,7 @@ void Preprocessor::EnterSourceFile(FileID FID, const DirectoryLookup *CurDir) {
     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);
index fd7c367c70ae3310ed10a2040d13e8c693f4619e..12f8330b20b34f6ff7721b23e1f81be8284ade22 100644 (file)
@@ -668,7 +668,8 @@ IdentifierInfo* PTHManager::get(const char *NameStart, const char *NameEnd) {
 }
 
 
-PTHLexer* PTHManager::CreateLexer(FileID FID, const FileEntry* FE) {
+PTHLexer *PTHManager::CreateLexer(FileID FID) {
+  const FileEntry *FE = PP->getSourceManager().getFileEntryForID(FID);
   if (!FE)
     return 0;