]> granicus.if.org Git - clang/commitdiff
Use TinyPtrVector instead of UsuallyTinyPtrVector.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 6 Mar 2012 03:00:11 +0000 (03:00 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 6 Mar 2012 03:00:11 +0000 (03:00 +0000)
The latter is just a worse version of the former.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152096 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/ASTContext.h
include/clang/AST/DeclCXX.h
lib/AST/ASTContext.cpp

index 209ab1034f366cb21a5e3253a1a8d77ef4206692..62143e0199c573559404bc988518e35cf8f5e311 100644 (file)
@@ -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 <vector>
 
@@ -322,7 +322,7 @@ class ASTContext : public RefCountedBase<ASTContext> {
   /// 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<const CXXMethodDecl> CXXMethodVector;
+  typedef llvm::TinyPtrVector<const CXXMethodDecl*> CXXMethodVector;
   llvm::DenseMap<const CXXMethodDecl *, CXXMethodVector> OverriddenMethods;
 
   /// \brief Mapping from each declaration context to its corresponding lambda 
index 2314548942220692a2a5798cc11fd4b7383a73ce..edecc779a38f33870ad2682397c516eda48bbd8b 100644 (file)
@@ -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;
index 5122c21c9adedbfd42877ca498967ab863dac746..40d43cd0b7b4cbd5a6aa18eea8259d856d3e21a6 100644 (file)
@@ -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<const CXXMethodDecl *, CXXMethodVector>::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<const ObjCContainerDecl*,