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
This commit is contained in:
Gabor Greif
2009-08-27 06:41:46 +00:00
parent 199ba42cbf
commit f0891be8bd
18 changed files with 35 additions and 44 deletions

View File

@ -34,7 +34,6 @@
#define LLVM_ADT_DEPTHFIRSTITERATOR_H #define LLVM_ADT_DEPTHFIRSTITERATOR_H
#include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/iterator.h"
#include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/PointerIntPair.h" #include "llvm/ADT/PointerIntPair.h"
#include <set> #include <set>
@ -63,9 +62,11 @@ public:
template<class GraphT, template<class GraphT,
class SetType = llvm::SmallPtrSet<typename GraphTraits<GraphT>::NodeType*, 8>, 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 std::iterator<std::forward_iterator_tag,
typename GT::NodeType, ptrdiff_t>,
public df_iterator_storage<SetType, ExtStorage> { 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::NodeType NodeType;
typedef typename GT::ChildIteratorType ChildItTy; typedef typename GT::ChildIteratorType ChildItTy;

View File

@ -15,7 +15,6 @@
#ifndef LLVM_ADT_EQUIVALENCECLASSES_H #ifndef LLVM_ADT_EQUIVALENCECLASSES_H
#define LLVM_ADT_EQUIVALENCECLASSES_H #define LLVM_ADT_EQUIVALENCECLASSES_H
#include "llvm/ADT/iterator.h"
#include "llvm/Support/DataTypes.h" #include "llvm/Support/DataTypes.h"
#include <set> #include <set>
@ -234,8 +233,8 @@ public:
return L1; return L1;
} }
class member_iterator : public forward_iterator<ElemTy, ptrdiff_t> { class member_iterator : public std::iterator<std::forward_iterator_tag, ElemTy, ptrdiff_t> {
typedef forward_iterator<const ElemTy, ptrdiff_t> super; typedef std::iterator<std::forward_iterator_tag, ElemTy, ptrdiff_t> super;
const ECValue *Node; const ECValue *Node;
friend class EquivalenceClasses; friend class EquivalenceClasses;
public: public:
@ -249,7 +248,7 @@ public:
reference operator*() const { reference operator*() const {
assert(Node != 0 && "Dereferencing end()!"); assert(Node != 0 && "Dereferencing end()!");
return Node->getData(); return const_cast<reference>(Node->getData()); // FIXME
} }
reference operator->() const { return operator*(); } reference operator->() const { return operator*(); }

View File

@ -17,7 +17,6 @@
#define LLVM_ADT_POSTORDERITERATOR_H #define LLVM_ADT_POSTORDERITERATOR_H
#include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/iterator.h"
#include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallPtrSet.h"
#include <set> #include <set>
#include <stack> #include <stack>
@ -43,9 +42,9 @@ template<class GraphT,
class SetType = llvm::SmallPtrSet<typename GraphTraits<GraphT>::NodeType*, 8>, class SetType = llvm::SmallPtrSet<typename GraphTraits<GraphT>::NodeType*, 8>,
bool ExtStorage = false, bool ExtStorage = false,
class GT = GraphTraits<GraphT> > 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> { 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::NodeType NodeType;
typedef typename GT::ChildIteratorType ChildItTy; typedef typename GT::ChildIteratorType ChildItTy;

View File

@ -22,7 +22,6 @@
#define LLVM_ADT_SCCITERATOR_H #define LLVM_ADT_SCCITERATOR_H
#include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/iterator.h"
#include <map> #include <map>
#include <vector> #include <vector>
@ -35,11 +34,11 @@ namespace llvm {
/// ///
template<class GraphT, class GT = GraphTraits<GraphT> > template<class GraphT, class GT = GraphTraits<GraphT> >
class scc_iterator 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::NodeType NodeType;
typedef typename GT::ChildIteratorType ChildItTy; typedef typename GT::ChildIteratorType ChildItTy;
typedef std::vector<NodeType*> SccTy; 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::reference reference;
typedef typename super::pointer pointer; typedef typename super::pointer pointer;

View File

@ -19,8 +19,8 @@
#include <cstddef> // for std::size_t #include <cstddef> // for std::size_t
#include <functional> #include <functional>
#include <iterator>
#include <utility> // for std::pair #include <utility> // for std::pair
#include "llvm/ADT/iterator.h"
namespace llvm { namespace llvm {

View File

@ -14,7 +14,6 @@
#ifndef LLVM_ADT_SMALLVECTOR_H #ifndef LLVM_ADT_SMALLVECTOR_H
#define LLVM_ADT_SMALLVECTOR_H #define LLVM_ADT_SMALLVECTOR_H
#include "llvm/ADT/iterator.h"
#include "llvm/Support/type_traits.h" #include "llvm/Support/type_traits.h"
#include <algorithm> #include <algorithm>
#include <cassert> #include <cassert>

View File

@ -38,8 +38,8 @@
#ifndef LLVM_ADT_ILIST_H #ifndef LLVM_ADT_ILIST_H
#define LLVM_ADT_ILIST_H #define LLVM_ADT_ILIST_H
#include "llvm/ADT/iterator.h"
#include <cassert> #include <cassert>
#include <iterator>
namespace llvm { namespace llvm {
@ -140,11 +140,11 @@ struct ilist_traits<const Ty> : public ilist_traits<Ty> {};
// //
template<typename NodeTy> template<typename NodeTy>
class ilist_iterator class ilist_iterator
: public bidirectional_iterator<NodeTy, ptrdiff_t> { : public std::iterator<std::bidirectional_iterator_tag, NodeTy, ptrdiff_t> {
public: public:
typedef ilist_traits<NodeTy> Traits; 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::value_type value_type;
typedef typename super::difference_type difference_type; typedef typename super::difference_type difference_type;

View File

@ -20,7 +20,6 @@
#include "llvm/Support/CallSite.h" #include "llvm/Support/CallSite.h"
#include "llvm/Support/ValueHandle.h" #include "llvm/Support/ValueHandle.h"
#include "llvm/ADT/DenseMap.h" #include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/iterator.h"
#include "llvm/ADT/ilist.h" #include "llvm/ADT/ilist.h"
#include "llvm/ADT/ilist_node.h" #include "llvm/ADT/ilist_node.h"
#include <vector> #include <vector>
@ -159,7 +158,7 @@ public:
void dump() const; void dump() const;
/// Define an iterator for alias sets... this is just a forward iterator. /// 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; PointerRec *CurNode;
public: public:
explicit iterator(PointerRec *CN = 0) : CurNode(CN) {} explicit iterator(PointerRec *CN = 0) : CurNode(CN) {}

View File

@ -17,7 +17,6 @@
#define LLVM_ANALYSIS_CONSTANTSSCANNER_H #define LLVM_ANALYSIS_CONSTANTSSCANNER_H
#include "llvm/Support/InstIterator.h" #include "llvm/Support/InstIterator.h"
#include "llvm/ADT/iterator.h"
namespace llvm { namespace llvm {

View File

@ -17,6 +17,7 @@
#include "llvm/Bitcode/BitCodes.h" #include "llvm/Bitcode/BitCodes.h"
#include <climits> #include <climits>
#include <string>
#include <vector> #include <vector>
namespace llvm { namespace llvm {

View File

@ -16,7 +16,6 @@
#include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/ADT/BitVector.h" #include "llvm/ADT/BitVector.h"
#include "llvm/ADT/iterator.h"
#include <vector> #include <vector>
namespace llvm { namespace llvm {
@ -256,7 +255,7 @@ public:
/// returns end(). /// returns end().
template<bool ReturnUses, bool ReturnDefs> template<bool ReturnUses, bool ReturnDefs>
class defusechain_iterator class defusechain_iterator
: public forward_iterator<MachineInstr, ptrdiff_t> { : public std::iterator<std::forward_iterator_tag, MachineInstr, ptrdiff_t> {
MachineOperand *Op; MachineOperand *Op;
explicit defusechain_iterator(MachineOperand *op) : Op(op) { explicit defusechain_iterator(MachineOperand *op) : Op(op) {
// If the first node isn't one we're interested in, advance to one that // If the first node isn't one we're interested in, advance to one that
@ -269,8 +268,8 @@ public:
} }
friend class MachineRegisterInfo; friend class MachineRegisterInfo;
public: public:
typedef forward_iterator<MachineInstr, ptrdiff_t>::reference reference; typedef std::iterator<std::forward_iterator_tag, MachineInstr, ptrdiff_t>::reference reference;
typedef forward_iterator<MachineInstr, ptrdiff_t>::pointer pointer; typedef std::iterator<std::forward_iterator_tag, MachineInstr, ptrdiff_t>::pointer pointer;
defusechain_iterator(const defusechain_iterator &I) : Op(I.Op) {} defusechain_iterator(const defusechain_iterator &I) : Op(I.Op) {}
defusechain_iterator() : Op(0) {} defusechain_iterator() : Op(0) {}

View File

@ -535,7 +535,7 @@ namespace llvm {
void EmitLiveInCopies(MachineBasicBlock *MBB); 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; SUnit *Node;
unsigned Operand; unsigned Operand;

View File

@ -22,7 +22,6 @@
#include "llvm/Constants.h" #include "llvm/Constants.h"
#include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/iterator.h"
#include "llvm/ADT/ilist_node.h" #include "llvm/ADT/ilist_node.h"
#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/STLExtras.h" #include "llvm/ADT/STLExtras.h"
@ -1129,14 +1128,14 @@ public:
/// use_iterator - This class provides iterator support for SDUse /// use_iterator - This class provides iterator support for SDUse
/// operands that use a specific SDNode. /// operands that use a specific SDNode.
class use_iterator class use_iterator
: public forward_iterator<SDUse, ptrdiff_t> { : public std::iterator<std::forward_iterator_tag, SDUse, ptrdiff_t> {
SDUse *Op; SDUse *Op;
explicit use_iterator(SDUse *op) : Op(op) { explicit use_iterator(SDUse *op) : Op(op) {
} }
friend class SDNode; friend class SDNode;
public: public:
typedef forward_iterator<SDUse, ptrdiff_t>::reference reference; typedef std::iterator<std::forward_iterator_tag, SDUse, ptrdiff_t>::reference reference;
typedef forward_iterator<SDUse, ptrdiff_t>::pointer pointer; typedef std::iterator<std::forward_iterator_tag, SDUse, ptrdiff_t>::pointer pointer;
use_iterator(const use_iterator &I) : Op(I.Op) {} use_iterator(const use_iterator &I) : Op(I.Op) {}
use_iterator() : Op(0) {} 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; SDNode *Node;
unsigned Operand; unsigned Operand;

View File

@ -18,7 +18,6 @@
#include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/ADT/iterator.h"
#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringSet.h" #include "llvm/ADT/StringSet.h"
@ -242,7 +241,7 @@ namespace llvmc {
/// NodeChildIterator - Another auxiliary class needed by GraphTraits. /// 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 NodeChildIterator ThisType;
typedef Node::container_type::iterator iterator; typedef Node::container_type::iterator iterator;

View File

@ -18,7 +18,6 @@
#include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/GraphTraits.h"
#include "llvm/Function.h" #include "llvm/Function.h"
#include "llvm/InstrTypes.h" #include "llvm/InstrTypes.h"
#include "llvm/ADT/iterator.h"
namespace llvm { namespace llvm {
@ -27,8 +26,8 @@ namespace llvm {
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
template <class _Ptr, class _USE_iterator> // Predecessor Iterator template <class _Ptr, class _USE_iterator> // Predecessor Iterator
class PredIterator : public forward_iterator<_Ptr, ptrdiff_t> { class PredIterator : public std::iterator<std::forward_iterator_tag, _Ptr, ptrdiff_t> {
typedef forward_iterator<_Ptr, ptrdiff_t> super; typedef std::iterator<std::forward_iterator_tag, _Ptr, ptrdiff_t> super;
_USE_iterator It; _USE_iterator It;
public: public:
typedef PredIterator<_Ptr,_USE_iterator> _Self; 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 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; const Term_ Term;
unsigned idx; unsigned idx;
typedef bidirectional_iterator<BB_, ptrdiff_t> super; typedef std::iterator<std::bidirectional_iterator_tag, BB_, ptrdiff_t> super;
public: public:
typedef SuccIterator<Term_, BB_> _Self; typedef SuccIterator<Term_, BB_> _Self;
typedef typename super::pointer pointer; typedef typename super::pointer pointer;

View File

@ -21,8 +21,8 @@
namespace llvm { namespace llvm {
template<typename ItTy = User::const_op_iterator> template<typename ItTy = User::const_op_iterator>
class generic_gep_type_iterator class generic_gep_type_iterator
: public forward_iterator<const Type *, ptrdiff_t> { : public std::iterator<std::forward_iterator_tag, const Type *, ptrdiff_t> {
typedef forward_iterator<const Type*, ptrdiff_t> super; typedef std::iterator<std::forward_iterator_tag, const Type *, ptrdiff_t> super;
ItTy OpIt; ItTy OpIt;
const Type *CurTy; const Type *CurTy;

View File

@ -17,7 +17,6 @@
#include "llvm/Support/DataTypes.h" #include "llvm/Support/DataTypes.h"
#include "llvm/System/Atomic.h" #include "llvm/System/Atomic.h"
#include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/iterator.h"
#include <string> #include <string>
#include <vector> #include <vector>

View File

@ -26,8 +26,8 @@
#define LLVM_USE_H #define LLVM_USE_H
#include "llvm/Support/Casting.h" #include "llvm/Support/Casting.h"
#include "llvm/ADT/iterator.h"
#include "llvm/ADT/PointerIntPair.h" #include "llvm/ADT/PointerIntPair.h"
#include <iterator>
namespace llvm { namespace llvm {
@ -158,8 +158,8 @@ template<> struct simplify_type<const Use> {
template<typename UserTy> // UserTy == 'User' or 'const User' template<typename UserTy> // UserTy == 'User' or 'const User'
class value_use_iterator : public forward_iterator<UserTy*, ptrdiff_t> { class value_use_iterator : public std::iterator<std::forward_iterator_tag, UserTy*, ptrdiff_t> {
typedef forward_iterator<UserTy*, ptrdiff_t> super; typedef std::iterator<std::forward_iterator_tag, UserTy*, ptrdiff_t> super;
typedef value_use_iterator<UserTy> _Self; typedef value_use_iterator<UserTy> _Self;
Use *U; Use *U;