diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-01-13 22:05:50 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-01-13 22:05:50 +0000 |
commit | f02f6f0ee3e05b958bcf67f00f4503671d67eccd (patch) | |
tree | a2d4befb57bb7099f7735aaf69ae6182c6c85443 /include/clang/Lex/PTHManager.h | |
parent | 3bd391b569e38c6ef7a6155641d4d3622b5616be (diff) |
PTH: Fix remaining cases where the spelling cache in the PTH file was being missed when it shouldn't. This shaves another 7% off PTH time for -Eonly on Cocoa.h
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62186 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex/PTHManager.h')
-rw-r--r-- | include/clang/Lex/PTHManager.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/include/clang/Lex/PTHManager.h b/include/clang/Lex/PTHManager.h index eefe574a54..60beee3645 100644 --- a/include/clang/Lex/PTHManager.h +++ b/include/clang/Lex/PTHManager.h @@ -34,10 +34,10 @@ class PTHManager; class PTHSpellingSearch { PTHManager& PTHMgr; - const char* TableBeg; - const char* TableEnd; + const char* const TableBeg; + const char* const TableEnd; - unsigned SpellingsLeft; + const unsigned NumSpellings; const char* LinearItr; public: @@ -50,7 +50,7 @@ public: : PTHMgr(pm), TableBeg(tableBeg), TableEnd(tableBeg + numSpellings*SpellingEntrySize), - SpellingsLeft(numSpellings), + NumSpellings(numSpellings), LinearItr(tableBeg) {} }; @@ -101,8 +101,6 @@ class PTHManager { /// getSpellingAtPTHOffset - Used by PTHLexer classes to get the cached /// spelling for a token. unsigned getSpellingAtPTHOffset(unsigned PTHOffset, const char*& Buffer); - - unsigned getSpelling(unsigned FileID, unsigned fpos, const char *& Buffer); public: @@ -111,11 +109,13 @@ public: /// Create - This method creates PTHManager objects. The 'file' argument /// is the name of the PTH file. This method returns NULL upon failure. static PTHManager* Create(const std::string& file, Preprocessor& PP); - + /// 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(unsigned FileID, const FileEntry* FE); + PTHLexer* CreateLexer(unsigned FileID, const FileEntry* FE); + + unsigned getSpelling(unsigned FileID, unsigned fpos, const char *& Buffer); }; } // end namespace clang |