// BasicBlock pred_iterator definition
//===----------------------------------------------------------------------===//
-template <class Ptr, class USE_iterator> // Predecessor Iterator
+template <class Ptr, class USE_iterator> // Predecessor Iterator
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;
inline void advancePastNonTerminators() {
- // Loop to ignore non terminator uses (for example PHI nodes)...
+ // Loop to ignore non terminator uses (for example PHI nodes).
while (!It.atEnd() && !isa<TerminatorInst>(*It))
++It;
}
public:
typedef typename super::pointer pointer;
- inline PredIterator(Ptr *bb) : It(bb->use_begin()) {
+ explicit inline PredIterator(Ptr *bb) : It(bb->use_begin()) {
advancePastNonTerminators();
}
inline PredIterator(Ptr *bb, bool) : It(bb->use_end()) {}
assert(!It.atEnd() && "pred_iterator out of range!");
return cast<TerminatorInst>(*It)->getParent();
}
- inline pointer *operator->() const { return &(operator*()); }
+ inline pointer *operator->() const { return &operator*(); }
inline Self& operator++() { // Preincrement
assert(!It.atEnd() && "pred_iterator out of range!");
typedef typename super::pointer pointer;
// TODO: This can be random access iterator, only operator[] missing.
- inline SuccIterator(Term_ T) : Term(T), idx(0) { // begin iterator
+ explicit inline SuccIterator(Term_ T) : Term(T), idx(0) {// begin iterator
assert(T && "getTerminator returned null!");
}
inline SuccIterator(Term_ T, bool) // end iterator
/// Get the source BB of this iterator.
inline BB_ *getSource() {
- return Term->getParent();
+ return Term->getParent();
}
};