summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-17 08:06:50 +0000
committerChris Lattner <sabre@nondot.org>2009-01-17 08:06:50 +0000
commitab1d4b8abd54eb55ef8e9112abc8f012546b64b6 (patch)
tree5b9605be8970ece3332eb8596ce182ba30cbefb3
parent3f634fe364dc576638b2c06e0ab803b51d9c069a (diff)
downloadbcm5719-llvm-ab1d4b8abd54eb55ef8e9112abc8f012546b64b6.tar.gz
bcm5719-llvm-ab1d4b8abd54eb55ef8e9112abc8f012546b64b6.zip
simplify PTHManager::CreateLexer
llvm-svn: 62424
-rw-r--r--clang/include/clang/Lex/PTHManager.h2
-rw-r--r--clang/lib/Lex/PPLexerChange.cpp2
-rw-r--r--clang/lib/Lex/PTHLexer.cpp3
3 files changed, 4 insertions, 3 deletions
diff --git a/clang/include/clang/Lex/PTHManager.h b/clang/include/clang/Lex/PTHManager.h
index c4ecfd6ed12..67e36667583 100644
--- a/clang/include/clang/Lex/PTHManager.h
+++ b/clang/include/clang/Lex/PTHManager.h
@@ -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:
diff --git a/clang/lib/Lex/PPLexerChange.cpp b/clang/lib/Lex/PPLexerChange.cpp
index 60d42386d7a..f8c8636fcb1 100644
--- a/clang/lib/Lex/PPLexerChange.cpp
+++ b/clang/lib/Lex/PPLexerChange.cpp
@@ -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);
diff --git a/clang/lib/Lex/PTHLexer.cpp b/clang/lib/Lex/PTHLexer.cpp
index fd7c367c70a..12f8330b20b 100644
--- a/clang/lib/Lex/PTHLexer.cpp
+++ b/clang/lib/Lex/PTHLexer.cpp
@@ -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;
OpenPOWER on IntegriCloud