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
#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;

View File

@ -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*(); }

View File

@ -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;

View File

@ -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;

View File

@ -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 {

View File

@ -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>

View File

@ -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;

View File

@ -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) {}

View File

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

View File

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

View File

@ -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) {}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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>

View File

@ -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;