[cfe-commits] r81612 - /cfe/trunk/include/clang/Lex/Preprocessor.h

Benjamin Kramer benny.kra at googlemail.com
Sat Sep 12 02:45:29 PDT 2009


Author: d0k
Date: Sat Sep 12 04:45:28 2009
New Revision: 81612

URL: http://llvm.org/viewvc/llvm-project?rev=81612&view=rev
Log:
SmallVectorize preprocessor's token cache. Testing shows there is almost never
more than one token in the cache.

Modified:
    cfe/trunk/include/clang/Lex/Preprocessor.h

Modified: cfe/trunk/include/clang/Lex/Preprocessor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Preprocessor.h?rev=81612&r1=81611&r2=81612&view=diff

==============================================================================
--- cfe/trunk/include/clang/Lex/Preprocessor.h (original)
+++ cfe/trunk/include/clang/Lex/Preprocessor.h Sat Sep 12 04:45:28 2009
@@ -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 @@
   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.





More information about the cfe-commits mailing list