diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-02-23 16:06:01 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-02-23 16:06:01 +0000 |
commit | 3adbe1ca4368aacf9194ef456fcaa6b32bd2a28a (patch) | |
tree | d43764b499fb0770de6650cb0222e8e4e5dcd0eb /clang/lib/Sema/SemaLookup.cpp | |
parent | 49f28b5a472e6018a40725db9abac3803d9a5883 (diff) | |
download | bcm5719-llvm-3adbe1ca4368aacf9194ef456fcaa6b32bd2a28a.tar.gz bcm5719-llvm-3adbe1ca4368aacf9194ef456fcaa6b32bd2a28a.zip |
Replace some DenseSets with SmallPtrSets. Apart from the "small" optimization, the current implementation is also a denser.
llvm-svn: 151257
Diffstat (limited to 'clang/lib/Sema/SemaLookup.cpp')
-rw-r--r-- | clang/lib/Sema/SemaLookup.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp index d3a31ede670..5507c5770df 100644 --- a/clang/lib/Sema/SemaLookup.cpp +++ b/clang/lib/Sema/SemaLookup.cpp @@ -31,7 +31,6 @@ #include "clang/AST/ExprCXX.h" #include "clang/Basic/Builtins.h" #include "clang/Basic/LangOptions.h" -#include "llvm/ADT/DenseSet.h" #include "llvm/ADT/SetVector.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallPtrSet.h" @@ -1263,7 +1262,7 @@ static bool LookupQualifiedNameInUsingDirectives(Sema &S, LookupResult &R, if (I == E) return false; // We have at least added all these contexts to the queue. - llvm::DenseSet<DeclContext*> Visited; + llvm::SmallPtrSet<DeclContext*, 8> Visited; Visited.insert(StartDC); // We have not yet looked into these namespaces, much less added @@ -1274,7 +1273,7 @@ static bool LookupQualifiedNameInUsingDirectives(Sema &S, LookupResult &R, // with its using-children. for (; I != E; ++I) { NamespaceDecl *ND = (*I)->getNominatedNamespace()->getOriginalNamespace(); - if (Visited.insert(ND).second) + if (Visited.insert(ND)) Queue.push_back(ND); } @@ -1323,7 +1322,7 @@ static bool LookupQualifiedNameInUsingDirectives(Sema &S, LookupResult &R, for (llvm::tie(I,E) = ND->getUsingDirectives(); I != E; ++I) { NamespaceDecl *Nom = (*I)->getNominatedNamespace(); - if (Visited.insert(Nom).second) + if (Visited.insert(Nom)) Queue.push_back(Nom); } } |