[cfe-commits] r163600 - /cfe/trunk/lib/AST/CXXInheritance.cpp

Douglas Gregor dgregor at apple.com
Tue Sep 11 00:19:42 PDT 2012


Author: dgregor
Date: Tue Sep 11 02:19:42 2012
New Revision: 163600

URL: http://llvm.org/viewvc/llvm-project?rev=163600&view=rev
Log:
Switch a SmallPtrSet/SmallVector pair over to SetVector.

Modified:
    cfe/trunk/lib/AST/CXXInheritance.cpp

Modified: cfe/trunk/lib/AST/CXXInheritance.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CXXInheritance.cpp?rev=163600&r1=163599&r2=163600&view=diff
==============================================================================
--- cfe/trunk/lib/AST/CXXInheritance.cpp (original)
+++ cfe/trunk/lib/AST/CXXInheritance.cpp Tue Sep 11 02:19:42 2012
@@ -14,6 +14,7 @@
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/RecordLayout.h"
 #include "clang/AST/DeclCXX.h"
+#include "llvm/ADT/SetVector.h"
 #include <algorithm>
 #include <set>
 
@@ -25,11 +26,9 @@
   assert(NumDeclsFound == 0 && !DeclsFound &&
          "Already computed the set of declarations");
 
-  llvm::SmallPtrSet<NamedDecl *, 8> KnownDecls;
-  SmallVector<NamedDecl *, 8> Decls;
+  llvm::SetVector<NamedDecl *, SmallVector<NamedDecl *, 8> > Decls;
   for (paths_iterator Path = begin(), PathEnd = end(); Path != PathEnd; ++Path)
-    if (KnownDecls.insert(*Path->Decls.first))
-      Decls.push_back(*Path->Decls.first);
+    Decls.insert(*Path->Decls.first);
 
   NumDeclsFound = Decls.size();
   DeclsFound = new NamedDecl * [NumDeclsFound];





More information about the cfe-commits mailing list