From: Richard Smith Date: Mon, 16 May 2016 22:53:19 +0000 (+0000) Subject: Switch from SmallVector to TinyPtrVector for the list of attributes on a declaration... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=34805ee8ae799e69f9a501d8f822e52c06a39003;p=clang Switch from SmallVector to TinyPtrVector for the list of attributes on a declaration. This removes a memory allocation for the common case where the declaration has only one attribute. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269717 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/AttrIterator.h b/include/clang/AST/AttrIterator.h index a0c803096a..b768e5636a 100644 --- a/include/clang/AST/AttrIterator.h +++ b/include/clang/AST/AttrIterator.h @@ -15,6 +15,7 @@ #define LLVM_CLANG_AST_ATTRITERATOR_H #include "clang/Basic/LLVM.h" +#include "llvm/ADT/TinyPtrVector.h" #include namespace clang { @@ -39,8 +40,8 @@ void operator delete[](void *Ptr, const clang::ASTContext &C, size_t); namespace clang { /// AttrVec - A vector of Attr, which is how they are stored on the AST. -typedef SmallVector AttrVec; -typedef SmallVector ConstAttrVec; +typedef llvm::TinyPtrVector AttrVec; +typedef llvm::TinyPtrVector ConstAttrVec; /// specific_attr_iterator - Iterates over a subrange of an AttrVec, only /// providing attributes that are of a specific type.