From f46f68b5587b6933a92260220567ea7c36924a80 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 14 Jul 2007 22:15:50 +0000 Subject: [PATCH] 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 --- include/clang/Lex/MacroInfo.h | 5 +++-- 1 file 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 #include @@ -37,7 +38,7 @@ class MacroInfo { /// ReplacementTokens - This is the list of tokens that the macro is defined /// to. - std::vector ReplacementTokens; + llvm::SmallVector 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::const_iterator tokens_iterator; + typedef llvm::SmallVector::const_iterator tokens_iterator; tokens_iterator tokens_begin() const { return ReplacementTokens.begin(); } tokens_iterator tokens_end() const { return ReplacementTokens.end(); } -- 2.40.0