diff options
author | Chris Lattner <sabre@nondot.org> | 2007-07-14 22:15:50 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-07-14 22:15:50 +0000 |
commit | f46f68b5587b6933a92260220567ea7c36924a80 (patch) | |
tree | 4a2f2d99d605a5a402d43b29d923588f7c5b9aab | |
parent | c215bd659d8266a1d6b66ce231a63405a4c61daf (diff) |
switch from using a vector to a smallvector for macro replacement tokens
This speeds up parsing carbon.h by 3.3% by avoiding some malloc traffic for
small macros.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39861 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Lex/MacroInfo.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/clang/Lex/MacroInfo.h b/include/clang/Lex/MacroInfo.h index b7495bf548..2a5a88b1eb 100644 --- a/include/clang/Lex/MacroInfo.h +++ b/include/clang/Lex/MacroInfo.h @@ -15,6 +15,7 @@ #define LLVM_CLANG_MACROINFO_H #include "clang/Lex/LexerToken.h" +#include "llvm/ADT/SmallVector.h" #include <vector> #include <cassert> @@ -37,7 +38,7 @@ class MacroInfo { /// ReplacementTokens - This is the list of tokens that the macro is defined /// to. - std::vector<LexerToken> ReplacementTokens; + llvm::SmallVector<LexerToken, 8> ReplacementTokens; /// IsFunctionLike - True if this macro is a function-like macro, false if it /// is an object-like macro. @@ -157,7 +158,7 @@ public: return ReplacementTokens[Tok]; } - typedef std::vector<LexerToken>::const_iterator tokens_iterator; + typedef llvm::SmallVector<LexerToken, 8>::const_iterator tokens_iterator; tokens_iterator tokens_begin() const { return ReplacementTokens.begin(); } tokens_iterator tokens_end() const { return ReplacementTokens.end(); } |