From f0891be8bdbeeadb39da5575273b6645755fa383 Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Thu, 27 Aug 2009 06:41:46 +0000 Subject: [PATCH] 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 --- include/llvm/ADT/DepthFirstIterator.h | 7 ++++--- include/llvm/ADT/EquivalenceClasses.h | 7 +++---- include/llvm/ADT/PostOrderIterator.h | 5 ++--- include/llvm/ADT/SCCIterator.h | 5 ++--- include/llvm/ADT/STLExtras.h | 2 +- include/llvm/ADT/SmallVector.h | 1 - include/llvm/ADT/ilist.h | 6 +++--- include/llvm/Analysis/AliasSetTracker.h | 3 +-- include/llvm/Analysis/ConstantsScanner.h | 1 - include/llvm/Bitcode/BitstreamReader.h | 1 + include/llvm/CodeGen/MachineRegisterInfo.h | 7 +++---- include/llvm/CodeGen/ScheduleDAG.h | 2 +- include/llvm/CodeGen/SelectionDAGNodes.h | 9 ++++----- include/llvm/CompilerDriver/CompilationGraph.h | 3 +-- include/llvm/Support/CFG.h | 9 ++++----- include/llvm/Support/GetElementPtrTypeIterator.h | 4 ++-- include/llvm/Type.h | 1 - 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 c5f246c33e9..5f2df2a17e4 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 @@ -63,9 +62,11 @@ public: template::NodeType*, 8>, bool ExtStorage = false, class GT = GraphTraits > -class df_iterator : public forward_iterator, +class df_iterator : public std::iterator, public df_iterator_storage { - typedef forward_iterator super; + typedef std::iterator 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 6e00a217beb..766d0c8a781 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 @@ -234,8 +233,8 @@ public: return L1; } - class member_iterator : public forward_iterator { - typedef forward_iterator super; + class member_iterator : public std::iterator { + typedef std::iterator 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(Node->getData()); // FIXME } reference operator->() const { return operator*(); } diff --git a/include/llvm/ADT/PostOrderIterator.h b/include/llvm/ADT/PostOrderIterator.h index 227472b2dd7..5760b2b552c 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 #include @@ -43,9 +42,9 @@ template::NodeType*, 8>, bool ExtStorage = false, class GT = GraphTraits > -class po_iterator : public forward_iterator, +class po_iterator : public std::iterator, public po_iterator_storage { - typedef forward_iterator super; + typedef std::iterator 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 fde735d1015..9ca0f1c00e7 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 #include @@ -35,11 +34,11 @@ namespace llvm { /// template > class scc_iterator - : public forward_iterator, ptrdiff_t> { + : public std::iterator, ptrdiff_t> { typedef typename GT::NodeType NodeType; typedef typename GT::ChildIteratorType ChildItTy; typedef std::vector SccTy; - typedef forward_iterator super; + typedef std::iterator, 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 9ac73c0c96c..6f4769260aa 100644 --- a/include/llvm/ADT/STLExtras.h +++ b/include/llvm/ADT/STLExtras.h @@ -19,8 +19,8 @@ #include // for std::size_t #include +#include #include // 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 dd3a6d00603..f3b4533b942 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 #include diff --git a/include/llvm/ADT/ilist.h b/include/llvm/ADT/ilist.h index 2f35a7ad25c..4560f55e52f 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 +#include namespace llvm { @@ -140,11 +140,11 @@ struct ilist_traits : public ilist_traits {}; // template class ilist_iterator - : public bidirectional_iterator { + : public std::iterator { public: typedef ilist_traits Traits; - typedef bidirectional_iterator super; + typedef std::iterator 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 82c6f392d05..793da6f6bca 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 @@ -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 { + class iterator : public std::iterator { 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 bac551f0492..796a942ccca 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 83d2350fe84..779ef5fa2d8 100644 --- a/include/llvm/Bitcode/BitstreamReader.h +++ b/include/llvm/Bitcode/BitstreamReader.h @@ -17,6 +17,7 @@ #include "llvm/Bitcode/BitCodes.h" #include +#include #include namespace llvm { diff --git a/include/llvm/CodeGen/MachineRegisterInfo.h b/include/llvm/CodeGen/MachineRegisterInfo.h index 80c37b39ca0..0d82f4ece7c 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 namespace llvm { @@ -256,7 +255,7 @@ public: /// returns end(). template class defusechain_iterator - : public forward_iterator { + : public std::iterator { 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::reference reference; - typedef forward_iterator::pointer pointer; + typedef std::iterator::reference reference; + typedef std::iterator::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 f820200f99b..797c9bce95b 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 { + class SUnitIterator : public std::iterator { SUnit *Node; unsigned Operand; diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index a5fb08f32a7..af8c833ac11 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 { + : public std::iterator { SDUse *Op; explicit use_iterator(SDUse *op) : Op(op) { } friend class SDNode; public: - typedef forward_iterator::reference reference; - typedef forward_iterator::pointer pointer; + typedef std::iterator::reference reference; + typedef std::iterator::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 { +class SDNodeIterator : public std::iterator { SDNode *Node; unsigned Operand; diff --git a/include/llvm/CompilerDriver/CompilationGraph.h b/include/llvm/CompilerDriver/CompilationGraph.h index 825d4c40f8a..2579b2630b0 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 { + class NodeChildIterator : public std::iterator { typedef NodeChildIterator ThisType; typedef Node::container_type::iterator iterator; diff --git a/include/llvm/Support/CFG.h b/include/llvm/Support/CFG.h index b0b857bf028..ca181c519cf 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 // Predecessor Iterator -class PredIterator : public forward_iterator<_Ptr, ptrdiff_t> { - typedef forward_iterator<_Ptr, ptrdiff_t> super; +class PredIterator : public std::iterator { + typedef std::iterator 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 // Successor Iterator -class SuccIterator : public bidirectional_iterator { +class SuccIterator : public std::iterator { const Term_ Term; unsigned idx; - typedef bidirectional_iterator super; + typedef std::iterator super; public: typedef SuccIterator _Self; typedef typename super::pointer pointer; diff --git a/include/llvm/Support/GetElementPtrTypeIterator.h b/include/llvm/Support/GetElementPtrTypeIterator.h index e1cda75c5f6..9430477f075 100644 --- a/include/llvm/Support/GetElementPtrTypeIterator.h +++ b/include/llvm/Support/GetElementPtrTypeIterator.h @@ -21,8 +21,8 @@ namespace llvm { template class generic_gep_type_iterator - : public forward_iterator { - typedef forward_iterator super; + : public std::iterator { + typedef std::iterator super; ItTy OpIt; const Type *CurTy; diff --git a/include/llvm/Type.h b/include/llvm/Type.h index 94ebf1e521b..9c2fae0dfb5 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 #include diff --git a/include/llvm/Use.h b/include/llvm/Use.h index 489dbc50a04..00b9c437fbb 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 namespace llvm { @@ -158,8 +158,8 @@ template<> struct simplify_type { template // UserTy == 'User' or 'const User' -class value_use_iterator : public forward_iterator { - typedef forward_iterator super; +class value_use_iterator : public std::iterator { + typedef std::iterator super; typedef value_use_iterator _Self; Use *U; -- 2.34.1