]> granicus.if.org Git - clang/commitdiff
SmallVectorize preprocessor's token cache. Testing shows there is almost never
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 12 Sep 2009 09:45:28 +0000 (09:45 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 12 Sep 2009 09:45:28 +0000 (09:45 +0000)
more than one token in the cache.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81612 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Lex/Preprocessor.h

index d1c508a542aa9f745ff04f83feb20dd608fbcc46..0765ac391be3f3a53c5d8f1267c80eab0cd46e71 100644 (file)
@@ -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.