From: Richard Smith Date: Tue, 17 May 2016 21:48:41 +0000 (+0000) Subject: Revert r269717. That change alone did not provide the intended benefit (which X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e3f873e601698ef347b0412fcda15935275fca4e;p=clang Revert r269717. That change alone did not provide the intended benefit (which would come from changing the type of ASTContext::DeclAttrs from DenseMap to DenseMap), and it turns out to be impractical to avoid the allocation there, because we expose the address of the attribute vector in ways that are hard to fix. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269849 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/AttrIterator.h b/include/clang/AST/AttrIterator.h index 1176688fe0..a0c803096a 100644 --- a/include/clang/AST/AttrIterator.h +++ b/include/clang/AST/AttrIterator.h @@ -15,7 +15,6 @@ #define LLVM_CLANG_AST_ATTRITERATOR_H #include "clang/Basic/LLVM.h" -#include "llvm/ADT/TinyPtrVector.h" #include namespace clang { @@ -23,19 +22,6 @@ namespace clang { class Attr; } -namespace llvm { - // Explicitly opt into 4 byte alignment for Attr*, to avoid the need to - // include the heavyweight Attr.h to use a TinyPtrVector. - template <> - struct PointerLikeTypeTraits { - static void *getAsVoidPointer(clang::Attr *P) { return P; } - static clang::Attr *getFromVoidPointer(void *P) { - return static_cast(P); - } - enum { NumLowBitsAvailable = 2 }; - }; -} - // Defined in ASTContext.h void *operator new(size_t Bytes, const clang::ASTContext &C, size_t Alignment = 8); @@ -53,8 +39,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 llvm::TinyPtrVector AttrVec; -typedef llvm::TinyPtrVector ConstAttrVec; +typedef SmallVector AttrVec; +typedef SmallVector ConstAttrVec; /// specific_attr_iterator - Iterates over a subrange of an AttrVec, only /// providing attributes that are of a specific type.