[llvm-commits] CVS: llvm/include/llvm/ADT/DepthFirstIterator.h
Chris Lattner
clattner at apple.com
Thu Jun 21 14:38:19 PDT 2007
> Have internal df_iterator's use SmallPtrSet instead of std::set.
> This provides compile time speedups to any pass using df_iterator.
Can you remove the #include of <set> now?
-Chris
>
>
> ---
> Diffs of the changes: (+5 -3)
>
> DepthFirstIterator.h | 8 +++++---
> 1 files changed, 5 insertions(+), 3 deletions(-)
>
>
> Index: llvm/include/llvm/ADT/DepthFirstIterator.h
> diff -u llvm/include/llvm/ADT/DepthFirstIterator.h:1.14 llvm/
> include/llvm/ADT/DepthFirstIterator.h:1.15
> --- llvm/include/llvm/ADT/DepthFirstIterator.h:1.14 Thu Apr 21
> 15:13:50 2005
> +++ llvm/include/llvm/ADT/DepthFirstIterator.h Thu Jun 21 16:25:36
> 2007
> @@ -35,6 +35,7 @@
>
> #include "llvm/ADT/GraphTraits.h"
> #include "llvm/ADT/iterator"
> +#include "llvm/ADT/SmallPtrSet.h"
> #include <vector>
> #include <set>
>
> @@ -58,8 +59,8 @@
>
>
> // Generic Depth First Iterator
> -template<class GraphT, class SetType =
> - std::set<typename
> GraphTraits<GraphT>::NodeType*>,
> +template<class GraphT,
> +class SetType = llvm::SmallPtrSet<typename
> GraphTraits<GraphT>::NodeType*, 8>,
> bool ExtStorage = false, class GT = GraphTraits<GraphT> >
> class df_iterator : public forward_iterator<typename GT::NodeType,
> ptrdiff_t>,
> public df_iterator_storage<SetType, ExtStorage> {
> @@ -189,7 +190,8 @@
>
>
> // 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>
> struct idf_iterator : public df_iterator<Inverse<T>, SetTy,
> External> {
> idf_iterator(const df_iterator<Inverse<T>, SetTy, External> &V)
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list