diff options
author | Gabor Greif <ggreif@gmail.com> | 2009-08-27 06:41:46 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2009-08-27 06:41:46 +0000 |
commit | f0891be8bdbeeadb39da5575273b6645755fa383 (patch) | |
tree | 344541d698e7fdc4ee3f8a118d3590da66510e6d | |
parent | 199ba42cbf56b2fc9c708edb4f08f97dd99ddd49 (diff) |
Clean up the minor mess I caused with removing iterator.h. I shall take care of 80-col violations and the FIXME later. (Thanks goodness that I live in another continent, so the monkeypox did not strike me :-)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80224 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/ADT/DepthFirstIterator.h | 7 | ||||
-rw-r--r-- | include/llvm/ADT/EquivalenceClasses.h | 7 | ||||
-rw-r--r-- | include/llvm/ADT/PostOrderIterator.h | 5 | ||||
-rw-r--r-- | include/llvm/ADT/SCCIterator.h | 5 | ||||
-rw-r--r-- | include/llvm/ADT/STLExtras.h | 2 | ||||
-rw-r--r-- | include/llvm/ADT/SmallVector.h | 1 | ||||
-rw-r--r-- | include/llvm/ADT/ilist.h | 6 | ||||
-rw-r--r-- | include/llvm/Analysis/AliasSetTracker.h | 3 | ||||
-rw-r--r-- | include/llvm/Analysis/ConstantsScanner.h | 1 | ||||
-rw-r--r-- | include/llvm/Bitcode/BitstreamReader.h | 1 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineRegisterInfo.h | 7 | ||||
-rw-r--r-- | include/llvm/CodeGen/ScheduleDAG.h | 2 | ||||
-rw-r--r-- | include/llvm/CodeGen/SelectionDAGNodes.h | 9 | ||||
-rw-r--r-- | include/llvm/CompilerDriver/CompilationGraph.h | 3 | ||||
-rw-r--r-- | include/llvm/Support/CFG.h | 9 | ||||
-rw-r--r-- | include/llvm/Support/GetElementPtrTypeIterator.h | 4 | ||||
-rw-r--r-- | include/llvm/Type.h | 1 | ||||
-rw-r--r-- | include/llvm/Use.h | 6 |
18 files changed, 35 insertions, 44 deletions
diff --git a/include/llvm/ADT/DepthFirstIterator.h b/include/llvm/ADT/DepthFirstIterator.h index c5f246c33e..5f2df2a17e 100644 --- a/include/llvm/ADT/DepthFirstIterator.h +++ b/include/llvm/ADT/DepthFirstIterator.h @@ -34,7 +34,6 @@ #define LLVM_ADT_DEPTHFIRSTITERATOR_H #include "llvm/ADT/GraphTraits.h" -#include "llvm/ADT/iterator.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/PointerIntPair.h" #include <set> @@ -63,9 +62,11 @@ public: 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>, +class df_iterator : public std::iterator<std::forward_iterator_tag, + typename GT::NodeType, ptrdiff_t>, public df_iterator_storage<SetType, ExtStorage> { - typedef forward_iterator<typename GT::NodeType, ptrdiff_t> super; + typedef std::iterator<std::forward_iterator_tag, + typename GT::NodeType, ptrdiff_t> super; typedef typename GT::NodeType NodeType; typedef typename GT::ChildIteratorType ChildItTy; diff --git a/include/llvm/ADT/EquivalenceClasses.h b/include/llvm/ADT/EquivalenceClasses.h index 6e00a217be..766d0c8a78 100644 --- a/include/llvm/ADT/EquivalenceClasses.h +++ b/include/llvm/ADT/EquivalenceClasses.h @@ -15,7 +15,6 @@ #ifndef LLVM_ADT_EQUIVALENCECLASSES_H #define LLVM_ADT_EQUIVALENCECLASSES_H -#include "llvm/ADT/iterator.h" #include "llvm/Support/DataTypes.h" #include <set> @@ -234,8 +233,8 @@ public: return L1; } - class member_iterator : public forward_iterator<ElemTy, ptrdiff_t> { - typedef forward_iterator<const ElemTy, ptrdiff_t> super; + class member_iterator : public std::iterator<std::forward_iterator_tag, ElemTy, ptrdiff_t> { + typedef std::iterator<std::forward_iterator_tag, ElemTy, ptrdiff_t> super; const ECValue *Node; friend class EquivalenceClasses; public: @@ -249,7 +248,7 @@ public: reference operator*() const { assert(Node != 0 && "Dereferencing end()!"); - return Node->getData(); + return const_cast<reference>(Node->getData()); // FIXME } reference operator->() const { return operator*(); } diff --git a/include/llvm/ADT/PostOrderIterator.h b/include/llvm/ADT/PostOrderIterator.h index 227472b2dd..5760b2b552 100644 --- a/include/llvm/ADT/PostOrderIterator.h +++ b/include/llvm/ADT/PostOrderIterator.h @@ -17,7 +17,6 @@ #define LLVM_ADT_POSTORDERITERATOR_H #include "llvm/ADT/GraphTraits.h" -#include "llvm/ADT/iterator.h" #include "llvm/ADT/SmallPtrSet.h" #include <set> #include <stack> @@ -43,9 +42,9 @@ template<class GraphT, class SetType = llvm::SmallPtrSet<typename GraphTraits<GraphT>::NodeType*, 8>, bool ExtStorage = false, class GT = GraphTraits<GraphT> > -class po_iterator : public forward_iterator<typename GT::NodeType, ptrdiff_t>, +class po_iterator : public std::iterator<std::forward_iterator_tag, typename GT::NodeType, ptrdiff_t>, public po_iterator_storage<SetType, ExtStorage> { - typedef forward_iterator<typename GT::NodeType, ptrdiff_t> super; + typedef std::iterator<std::forward_iterator_tag, typename GT::NodeType, ptrdiff_t> super; typedef typename GT::NodeType NodeType; typedef typename GT::ChildIteratorType ChildItTy; diff --git a/include/llvm/ADT/SCCIterator.h b/include/llvm/ADT/SCCIterator.h index fde735d101..9ca0f1c00e 100644 --- a/include/llvm/ADT/SCCIterator.h +++ b/include/llvm/ADT/SCCIterator.h @@ -22,7 +22,6 @@ #define LLVM_ADT_SCCITERATOR_H #include "llvm/ADT/GraphTraits.h" -#include "llvm/ADT/iterator.h" #include <map> #include <vector> @@ -35,11 +34,11 @@ namespace llvm { /// template<class GraphT, class GT = GraphTraits<GraphT> > class scc_iterator - : public forward_iterator<std::vector<typename GT::NodeType>, ptrdiff_t> { + : public std::iterator<std::forward_iterator_tag, std::vector<typename GT::NodeType>, ptrdiff_t> { typedef typename GT::NodeType NodeType; typedef typename GT::ChildIteratorType ChildItTy; typedef std::vector<NodeType*> SccTy; - typedef forward_iterator<SccTy, ptrdiff_t> super; + typedef std::iterator<std::forward_iterator_tag, std::vector<typename GT::NodeType>, ptrdiff_t> super; typedef typename super::reference reference; typedef typename super::pointer pointer; diff --git a/include/llvm/ADT/STLExtras.h b/include/llvm/ADT/STLExtras.h index 9ac73c0c96..6f4769260a 100644 --- a/include/llvm/ADT/STLExtras.h +++ b/include/llvm/ADT/STLExtras.h @@ -19,8 +19,8 @@ #include <cstddef> // for std::size_t #include <functional> +#include <iterator> #include <utility> // for std::pair -#include "llvm/ADT/iterator.h" namespace llvm { diff --git a/include/llvm/ADT/SmallVector.h b/include/llvm/ADT/SmallVector.h index dd3a6d0060..f3b4533b94 100644 --- a/include/llvm/ADT/SmallVector.h +++ b/include/llvm/ADT/SmallVector.h @@ -14,7 +14,6 @@ #ifndef LLVM_ADT_SMALLVECTOR_H #define LLVM_ADT_SMALLVECTOR_H -#include "llvm/ADT/iterator.h" #include "llvm/Support/type_traits.h" #include <algorithm> #include <cassert> diff --git a/include/llvm/ADT/ilist.h b/include/llvm/ADT/ilist.h index 2f35a7ad25..4560f55e52 100644 --- a/include/llvm/ADT/ilist.h +++ b/include/llvm/ADT/ilist.h @@ -38,8 +38,8 @@ #ifndef LLVM_ADT_ILIST_H #define LLVM_ADT_ILIST_H -#include "llvm/ADT/iterator.h" #include <cassert> +#include <iterator> namespace llvm { @@ -140,11 +140,11 @@ struct ilist_traits<const Ty> : public ilist_traits<Ty> {}; // template<typename NodeTy> class ilist_iterator - : public bidirectional_iterator<NodeTy, ptrdiff_t> { + : public std::iterator<std::bidirectional_iterator_tag, NodeTy, ptrdiff_t> { public: typedef ilist_traits<NodeTy> Traits; - typedef bidirectional_iterator<NodeTy, ptrdiff_t> super; + typedef std::iterator<std::bidirectional_iterator_tag, NodeTy, ptrdiff_t> super; typedef typename super::value_type value_type; typedef typename super::difference_type difference_type; diff --git a/include/llvm/Analysis/AliasSetTracker.h b/include/llvm/Analysis/AliasSetTracker.h index 82c6f392d0..793da6f6bc 100644 --- a/include/llvm/Analysis/AliasSetTracker.h +++ b/include/llvm/Analysis/AliasSetTracker.h @@ -20,7 +20,6 @@ #include "llvm/Support/CallSite.h" #include "llvm/Support/ValueHandle.h" #include "llvm/ADT/DenseMap.h" -#include "llvm/ADT/iterator.h" #include "llvm/ADT/ilist.h" #include "llvm/ADT/ilist_node.h" #include <vector> @@ -159,7 +158,7 @@ public: void dump() const; /// Define an iterator for alias sets... this is just a forward iterator. - class iterator : public forward_iterator<PointerRec, ptrdiff_t> { + class iterator : public std::iterator<std::forward_iterator_tag, PointerRec, ptrdiff_t> { PointerRec *CurNode; public: explicit iterator(PointerRec *CN = 0) : CurNode(CN) {} diff --git a/include/llvm/Analysis/ConstantsScanner.h b/include/llvm/Analysis/ConstantsScanner.h index bac551f049..796a942ccc 100644 --- a/include/llvm/Analysis/ConstantsScanner.h +++ b/include/llvm/Analysis/ConstantsScanner.h @@ -17,7 +17,6 @@ #define LLVM_ANALYSIS_CONSTANTSSCANNER_H #include "llvm/Support/InstIterator.h" -#include "llvm/ADT/iterator.h" namespace llvm { diff --git a/include/llvm/Bitcode/BitstreamReader.h b/include/llvm/Bitcode/BitstreamReader.h index 83d2350fe8..779ef5fa2d 100644 --- a/include/llvm/Bitcode/BitstreamReader.h +++ b/include/llvm/Bitcode/BitstreamReader.h @@ -17,6 +17,7 @@ #include "llvm/Bitcode/BitCodes.h" #include <climits> +#include <string> #include <vector> namespace llvm { diff --git a/include/llvm/CodeGen/MachineRegisterInfo.h b/include/llvm/CodeGen/MachineRegisterInfo.h index 80c37b39ca..0d82f4ece7 100644 --- a/include/llvm/CodeGen/MachineRegisterInfo.h +++ b/include/llvm/CodeGen/MachineRegisterInfo.h @@ -16,7 +16,6 @@ #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/ADT/BitVector.h" -#include "llvm/ADT/iterator.h" #include <vector> namespace llvm { @@ -256,7 +255,7 @@ public: /// returns end(). template<bool ReturnUses, bool ReturnDefs> class defusechain_iterator - : public forward_iterator<MachineInstr, ptrdiff_t> { + : public std::iterator<std::forward_iterator_tag, MachineInstr, ptrdiff_t> { MachineOperand *Op; explicit defusechain_iterator(MachineOperand *op) : Op(op) { // If the first node isn't one we're interested in, advance to one that @@ -269,8 +268,8 @@ public: } friend class MachineRegisterInfo; public: - typedef forward_iterator<MachineInstr, ptrdiff_t>::reference reference; - typedef forward_iterator<MachineInstr, ptrdiff_t>::pointer pointer; + typedef std::iterator<std::forward_iterator_tag, MachineInstr, ptrdiff_t>::reference reference; + typedef std::iterator<std::forward_iterator_tag, MachineInstr, ptrdiff_t>::pointer pointer; defusechain_iterator(const defusechain_iterator &I) : Op(I.Op) {} defusechain_iterator() : Op(0) {} diff --git a/include/llvm/CodeGen/ScheduleDAG.h b/include/llvm/CodeGen/ScheduleDAG.h index f820200f99..797c9bce95 100644 --- a/include/llvm/CodeGen/ScheduleDAG.h +++ b/include/llvm/CodeGen/ScheduleDAG.h @@ -535,7 +535,7 @@ namespace llvm { void EmitLiveInCopies(MachineBasicBlock *MBB); }; - class SUnitIterator : public forward_iterator<SUnit, ptrdiff_t> { + class SUnitIterator : public std::iterator<std::forward_iterator_tag, SUnit, ptrdiff_t> { SUnit *Node; unsigned Operand; diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index a5fb08f32a..af8c833ac1 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -22,7 +22,6 @@ #include "llvm/Constants.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/GraphTraits.h" -#include "llvm/ADT/iterator.h" #include "llvm/ADT/ilist_node.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/STLExtras.h" @@ -1129,14 +1128,14 @@ public: /// use_iterator - This class provides iterator support for SDUse /// operands that use a specific SDNode. class use_iterator - : public forward_iterator<SDUse, ptrdiff_t> { + : public std::iterator<std::forward_iterator_tag, SDUse, ptrdiff_t> { SDUse *Op; explicit use_iterator(SDUse *op) : Op(op) { } friend class SDNode; public: - typedef forward_iterator<SDUse, ptrdiff_t>::reference reference; - typedef forward_iterator<SDUse, ptrdiff_t>::pointer pointer; + typedef std::iterator<std::forward_iterator_tag, SDUse, ptrdiff_t>::reference reference; + typedef std::iterator<std::forward_iterator_tag, SDUse, ptrdiff_t>::pointer pointer; use_iterator(const use_iterator &I) : Op(I.Op) {} use_iterator() : Op(0) {} @@ -2354,7 +2353,7 @@ public: }; -class SDNodeIterator : public forward_iterator<SDNode, ptrdiff_t> { +class SDNodeIterator : public std::iterator<std::forward_iterator_tag, SDNode, ptrdiff_t> { SDNode *Node; unsigned Operand; diff --git a/include/llvm/CompilerDriver/CompilationGraph.h b/include/llvm/CompilerDriver/CompilationGraph.h index 825d4c40f8..2579b2630b 100644 --- a/include/llvm/CompilerDriver/CompilationGraph.h +++ b/include/llvm/CompilerDriver/CompilationGraph.h @@ -18,7 +18,6 @@ #include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" -#include "llvm/ADT/iterator.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringSet.h" @@ -242,7 +241,7 @@ namespace llvmc { /// NodeChildIterator - Another auxiliary class needed by GraphTraits. - class NodeChildIterator : public bidirectional_iterator<Node, ptrdiff_t> { + class NodeChildIterator : public std::iterator<std::bidirectional_iterator_tag, Node, ptrdiff_t> { typedef NodeChildIterator ThisType; typedef Node::container_type::iterator iterator; diff --git a/include/llvm/Support/CFG.h b/include/llvm/Support/CFG.h index b0b857bf02..ca181c519c 100644 --- a/include/llvm/Support/CFG.h +++ b/include/llvm/Support/CFG.h @@ -18,7 +18,6 @@ #include "llvm/ADT/GraphTraits.h" #include "llvm/Function.h" #include "llvm/InstrTypes.h" -#include "llvm/ADT/iterator.h" namespace llvm { @@ -27,8 +26,8 @@ namespace llvm { //===--------------------------------------------------------------------===// template <class _Ptr, class _USE_iterator> // Predecessor Iterator -class PredIterator : public forward_iterator<_Ptr, ptrdiff_t> { - typedef forward_iterator<_Ptr, ptrdiff_t> super; +class PredIterator : public std::iterator<std::forward_iterator_tag, _Ptr, ptrdiff_t> { + typedef std::iterator<std::forward_iterator_tag, _Ptr, ptrdiff_t> super; _USE_iterator It; public: typedef PredIterator<_Ptr,_USE_iterator> _Self; @@ -85,10 +84,10 @@ inline pred_const_iterator pred_end(const BasicBlock *BB) { //===--------------------------------------------------------------------===// template <class Term_, class BB_> // Successor Iterator -class SuccIterator : public bidirectional_iterator<BB_, ptrdiff_t> { +class SuccIterator : public std::iterator<std::bidirectional_iterator_tag, BB_, ptrdiff_t> { const Term_ Term; unsigned idx; - typedef bidirectional_iterator<BB_, ptrdiff_t> super; + typedef std::iterator<std::bidirectional_iterator_tag, BB_, ptrdiff_t> super; public: typedef SuccIterator<Term_, BB_> _Self; typedef typename super::pointer pointer; diff --git a/include/llvm/Support/GetElementPtrTypeIterator.h b/include/llvm/Support/GetElementPtrTypeIterator.h index e1cda75c5f..9430477f07 100644 --- a/include/llvm/Support/GetElementPtrTypeIterator.h +++ b/include/llvm/Support/GetElementPtrTypeIterator.h @@ -21,8 +21,8 @@ namespace llvm { template<typename ItTy = User::const_op_iterator> class generic_gep_type_iterator - : public forward_iterator<const Type *, ptrdiff_t> { - typedef forward_iterator<const Type*, ptrdiff_t> super; + : public std::iterator<std::forward_iterator_tag, const Type *, ptrdiff_t> { + typedef std::iterator<std::forward_iterator_tag, const Type *, ptrdiff_t> super; ItTy OpIt; const Type *CurTy; diff --git a/include/llvm/Type.h b/include/llvm/Type.h index 94ebf1e521..9c2fae0dfb 100644 --- a/include/llvm/Type.h +++ b/include/llvm/Type.h @@ -17,7 +17,6 @@ #include "llvm/Support/DataTypes.h" #include "llvm/System/Atomic.h" #include "llvm/ADT/GraphTraits.h" -#include "llvm/ADT/iterator.h" #include <string> #include <vector> diff --git a/include/llvm/Use.h b/include/llvm/Use.h index 489dbc50a0..00b9c437fb 100644 --- a/include/llvm/Use.h +++ b/include/llvm/Use.h @@ -26,8 +26,8 @@ #define LLVM_USE_H #include "llvm/Support/Casting.h" -#include "llvm/ADT/iterator.h" #include "llvm/ADT/PointerIntPair.h" +#include <iterator> namespace llvm { @@ -158,8 +158,8 @@ template<> struct simplify_type<const Use> { template<typename UserTy> // UserTy == 'User' or 'const User' -class value_use_iterator : public forward_iterator<UserTy*, ptrdiff_t> { - typedef forward_iterator<UserTy*, ptrdiff_t> super; +class value_use_iterator : public std::iterator<std::forward_iterator_tag, UserTy*, ptrdiff_t> { + typedef std::iterator<std::forward_iterator_tag, UserTy*, ptrdiff_t> super; typedef value_use_iterator<UserTy> _Self; Use *U; |