From 735f9d480569681d022d80301b05902c238a56f0 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Tue, 6 Mar 2012 03:00:11 +0000 Subject: [PATCH] Use TinyPtrVector instead of UsuallyTinyPtrVector. The latter is just a worse version of the former. llvm-svn: 152096 --- clang/include/clang/AST/ASTContext.h | 4 ++-- clang/include/clang/AST/DeclCXX.h | 2 +- clang/lib/AST/ASTContext.cpp | 6 ------ 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index 209ab1034f36..62143e0199c5 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -32,7 +32,7 @@ #include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/SmallPtrSet.h" -#include "llvm/ADT/UsuallyTinyPtrVector.h" +#include "llvm/ADT/TinyPtrVector.h" #include "llvm/Support/Allocator.h" #include @@ -322,7 +322,7 @@ class ASTContext : public RefCountedBase { /// Since most C++ member functions aren't virtual and therefore /// don't override anything, we store the overridden functions in /// this map on the side rather than within the CXXMethodDecl structure. - typedef llvm::UsuallyTinyPtrVector CXXMethodVector; + typedef llvm::TinyPtrVector CXXMethodVector; llvm::DenseMap OverriddenMethods; /// \brief Mapping from each declaration context to its corresponding lambda diff --git a/clang/include/clang/AST/DeclCXX.h b/clang/include/clang/AST/DeclCXX.h index 231454894222..edecc779a38f 100644 --- a/clang/include/clang/AST/DeclCXX.h +++ b/clang/include/clang/AST/DeclCXX.h @@ -1601,7 +1601,7 @@ public: /// void addOverriddenMethod(const CXXMethodDecl *MD); - typedef const CXXMethodDecl ** method_iterator; + typedef const CXXMethodDecl *const* method_iterator; method_iterator begin_overridden_methods() const; method_iterator end_overridden_methods() const; diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 5122c21c9ade..40d43cd0b7b4 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -259,12 +259,6 @@ ASTContext::~ASTContext() { for (unsigned I = 0, N = Deallocations.size(); I != N; ++I) Deallocations[I].first(Deallocations[I].second); - // Release all of the memory associated with overridden C++ methods. - for (llvm::DenseMap::iterator - OM = OverriddenMethods.begin(), OMEnd = OverriddenMethods.end(); - OM != OMEnd; ++OM) - OM->second.Destroy(); - // ASTRecordLayout objects in ASTRecordLayouts must always be destroyed // because they can contain DenseMaps. for (llvm::DenseMap