aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Lex/PTHLexer.h
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-01-27 00:01:05 +0000
committerTed Kremenek <kremenek@apple.com>2009-01-27 00:01:05 +0000
commit277faca30c9f8f72b79f55695cbe3395ec246e7c (patch)
tree80ed507b156a6d73ba2cf5651e772dd55f7adee0 /include/clang/Lex/PTHLexer.h
parent528473335419f072f6eff25a4af07925c1692121 (diff)
PTH: Use Token::setLiteralData() to directly store a pointer to cached spelling data in the PTH file. This removes a ton of code for looking up spellings using sourcelocations in the PTH file. This simplifies both PTH-generation and reading.
Performance impact for -fsyntax-only on Cocoa.h (with Cocoa.h in the PTH file): - PTH generation time improves by 5% - PTH reading improves by 0.3%. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63072 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex/PTHLexer.h')
-rw-r--r--include/clang/Lex/PTHLexer.h17
1 files changed, 1 insertions, 16 deletions
diff --git a/include/clang/Lex/PTHLexer.h b/include/clang/Lex/PTHLexer.h
index c6837d2a8b..369b818a1f 100644
--- a/include/clang/Lex/PTHLexer.h
+++ b/include/clang/Lex/PTHLexer.h
@@ -45,10 +45,6 @@ class PTHLexer : public PreprocessorLexer {
/// to process when doing quick skipping of preprocessor blocks.
const unsigned char* CurPPCondPtr;
- /// MySpellingMgr - Reference to the spelling manager used to get spellings
- /// for the source file indicated by \c FileID.
- PTHSpellingSearch& MySpellingSrch;
-
PTHLexer(const PTHLexer&); // DO NOT IMPLEMENT
void operator=(const PTHLexer&); // DO NOT IMPLEMENT
@@ -65,8 +61,7 @@ protected:
/// Create a PTHLexer for the specified token stream.
PTHLexer(Preprocessor& pp, FileID FID, const unsigned char *D,
- const unsigned char* ppcond,
- PTHSpellingSearch& mySpellingSrch, PTHManager &PM);
+ const unsigned char* ppcond, PTHManager &PM);
public:
~PTHLexer() {}
@@ -95,16 +90,6 @@ public:
/// IndirectLex - An indirect call to 'Lex' that can be invoked via
/// the PreprocessorLexer interface.
void IndirectLex(Token &Result) { Lex(Result); }
-
- /// Returns the cached spelling of a token.
- /// \param[in] sloc The SourceLocation of the token.
- /// \param[out] Buffer If a token's spelling is found in the PTH file then
- /// upon exit from this method \c Buffer will be set to the address of
- /// the character array representing that spelling. No characters
- /// are copied.
- /// \returns The number of characters for the spelling of the token. This
- /// value is 0 if the spelling could not be found in the PTH file.
- unsigned getSpelling(SourceLocation sloc, const char *&Buffer);
/// getSourceLocation - Return a source location for the token in
/// the current file.