diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2009-09-12 09:45:28 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2009-09-12 09:45:28 +0000 |
commit | f4d5eb4866a27d497f0bb75b12c2ffd48ad4d9c0 (patch) | |
tree | c43553f9771984ba443a23933ccb6c366c82d5fa /include/clang/Lex/Preprocessor.h | |
parent | 32baf62b9a3aea3b63be6925b64aa182b0a2278e (diff) |
SmallVectorize preprocessor's token cache. Testing shows there is almost never
more than one token in the cache.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81612 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex/Preprocessor.h')
-rw-r--r-- | include/clang/Lex/Preprocessor.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h index d1c508a542..0765ac391b 100644 --- a/include/clang/Lex/Preprocessor.h +++ b/include/clang/Lex/Preprocessor.h @@ -25,6 +25,7 @@ #include "clang/Basic/SourceLocation.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/OwningPtr.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/Support/Allocator.h" #include <vector> @@ -186,7 +187,7 @@ class Preprocessor { TokenLexer *TokenLexerCache[TokenLexerCacheSize]; private: // Cached tokens state. - typedef std::vector<Token> CachedTokensTy; + typedef llvm::SmallVector<Token, 1> CachedTokensTy; /// CachedTokens - Cached tokens are stored here when we do backtracking or /// lookahead. They are "lexed" by the CachingLex() method. |