Have internal df_iterator's use SmallPtrSet instead of std::set. This provides compile time speedups to any pass using df_iterator.

llvm-svn: 37694
This commit is contained in:
Owen Anderson 2007-06-21 21:25:36 +00:00
parent e15ea75168
commit 7c3a5513f7
1 changed files with 5 additions and 3 deletions

View File

@ -35,6 +35,7 @@
#include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/iterator" #include "llvm/ADT/iterator"
#include "llvm/ADT/SmallPtrSet.h"
#include <vector> #include <vector>
#include <set> #include <set>
@ -58,8 +59,8 @@ public:
// Generic Depth First Iterator // Generic Depth First Iterator
template<class GraphT, class SetType = template<class GraphT,
std::set<typename GraphTraits<GraphT>::NodeType*>, class SetType = llvm::SmallPtrSet<typename GraphTraits<GraphT>::NodeType*, 8>,
bool ExtStorage = false, class GT = GraphTraits<GraphT> > bool ExtStorage = false, class GT = GraphTraits<GraphT> >
class df_iterator : public forward_iterator<typename GT::NodeType, ptrdiff_t>, class df_iterator : public forward_iterator<typename GT::NodeType, ptrdiff_t>,
public df_iterator_storage<SetType, ExtStorage> { public df_iterator_storage<SetType, ExtStorage> {
@ -189,7 +190,8 @@ df_ext_iterator<T, SetTy> df_ext_end(T G, SetTy &S) {
// Provide global definitions of inverse depth first iterators... // Provide global definitions of inverse depth first iterators...
template <class T, class SetTy = std::set<typename GraphTraits<T>::NodeType*>, template <class T,
class SetTy = llvm::SmallPtrSet<typename GraphTraits<T>::NodeType*, 8>,
bool External = false> bool External = false>
struct idf_iterator : public df_iterator<Inverse<T>, SetTy, External> { struct idf_iterator : public df_iterator<Inverse<T>, SetTy, External> {
idf_iterator(const df_iterator<Inverse<T>, SetTy, External> &V) idf_iterator(const df_iterator<Inverse<T>, SetTy, External> &V)