summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-05-16 22:53:19 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-05-16 22:53:19 +0000
commitbefb94933438fd88f3375a418241cff4157e556e (patch)
tree1b30e3a1372d821c733ac7a61c4688b9f541713c
parentd18ab80b136a0edadd30ce2734452a3e3a94bf02 (diff)
downloadbcm5719-llvm-befb94933438fd88f3375a418241cff4157e556e.tar.gz
bcm5719-llvm-befb94933438fd88f3375a418241cff4157e556e.zip
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.
llvm-svn: 269717
-rw-r--r--clang/include/clang/AST/AttrIterator.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/include/clang/AST/AttrIterator.h b/clang/include/clang/AST/AttrIterator.h
index a0c803096af..b768e5636a2 100644
--- a/clang/include/clang/AST/AttrIterator.h
+++ b/clang/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 <iterator>
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<Attr*, 2> AttrVec;
-typedef SmallVector<const Attr*, 2> ConstAttrVec;
+typedef llvm::TinyPtrVector<Attr*> AttrVec;
+typedef llvm::TinyPtrVector<const Attr*> ConstAttrVec;
/// specific_attr_iterator - Iterates over a subrange of an AttrVec, only
/// providing attributes that are of a specific type.
OpenPOWER on IntegriCloud