mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
Make pred_iterator DefaultConstructible, and add an accessor to
retrieve the underlying getOperandNo() value. llvm-svn: 126804
This commit is contained in:
parent
4d3c996555
commit
b62daa9ec3
@ -41,6 +41,7 @@ class PredIterator : public std::iterator<std::forward_iterator_tag,
|
|||||||
public:
|
public:
|
||||||
typedef typename super::pointer pointer;
|
typedef typename super::pointer pointer;
|
||||||
|
|
||||||
|
PredIterator() {}
|
||||||
explicit inline PredIterator(Ptr *bb) : It(bb->use_begin()) {
|
explicit inline PredIterator(Ptr *bb) : It(bb->use_begin()) {
|
||||||
advancePastNonTerminators();
|
advancePastNonTerminators();
|
||||||
}
|
}
|
||||||
@ -64,6 +65,12 @@ public:
|
|||||||
inline Self operator++(int) { // Postincrement
|
inline Self operator++(int) { // Postincrement
|
||||||
Self tmp = *this; ++*this; return tmp;
|
Self tmp = *this; ++*this; return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// getOperandNo - Return the operand number in the predecessor's
|
||||||
|
/// terminator of the successor.
|
||||||
|
unsigned getOperandNo() const {
|
||||||
|
return It.getOperandNo();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef PredIterator<BasicBlock, Value::use_iterator> pred_iterator;
|
typedef PredIterator<BasicBlock, Value::use_iterator> pred_iterator;
|
||||||
|
Loading…
Reference in New Issue
Block a user