]> granicus.if.org Git - clang/commitdiff
Switch users of SmallMap to use SmallDenseMap instead.
authorChandler Carruth <chandlerc@gmail.com>
Sun, 17 Jun 2012 11:47:03 +0000 (11:47 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sun, 17 Jun 2012 11:47:03 +0000 (11:47 +0000)
The most important change here is that the destructor and copy
constructor for StoredDeclsList will now reliably be run. Previously,
the destructors at least were missed in some cases. See the LLVM commits
discussions for why SmallMap is broken and going away.

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

include/clang/AST/CXXInheritance.h
include/clang/AST/DeclContextInternals.h

index 814e2761da12597056c593222ab3a0073c2252c1..ee6eba78e415804a115340774912bee0caaae35c 100644 (file)
@@ -19,7 +19,7 @@
 #include "clang/AST/DeclCXX.h"
 #include "clang/AST/Type.h"
 #include "clang/AST/TypeOrdering.h"
-#include "llvm/ADT/SmallMap.h"
+#include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallSet.h"
 #include "llvm/ADT/SmallVector.h"
 #include <list>
@@ -128,7 +128,7 @@ class CXXBasePaths {
   /// while the element contains the number of non-virtual base
   /// class subobjects for that class type. The key of the map is
   /// the cv-unqualified canonical type of the base class subobject.
-  llvm::SmallMap<QualType, std::pair<bool, unsigned>, 8> ClassSubobjects;
+  llvm::SmallDenseMap<QualType, std::pair<bool, unsigned>, 8> ClassSubobjects;
   
   /// FindAmbiguities - Whether Sema::IsDerivedFrom should try find
   /// ambiguous paths while it is looking for a path from a derived
index 9a70f9d4058486ba8593f6b3dadaaefb50224f84..39f04c68a3c71935892f20868ec3185fac368382 100644 (file)
@@ -18,7 +18,7 @@
 #include "clang/AST/DeclarationName.h"
 #include "clang/AST/DeclCXX.h"
 #include "llvm/ADT/PointerUnion.h"
-#include "llvm/ADT/SmallMap.h"
+#include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallVector.h"
 #include <algorithm>
 
@@ -196,7 +196,7 @@ public:
 };
 
 class StoredDeclsMap
-  : public llvm::SmallMap<DeclarationName, StoredDeclsList, 4> {
+  : public llvm::SmallDenseMap<DeclarationName, StoredDeclsList, 4> {
 
 public:
   static void DestroyAll(StoredDeclsMap *Map, bool Dependent);