summaryrefslogtreecommitdiff
path: root/include/llvm/Support/CFG.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Support/CFG.h')
-rw-r--r--include/llvm/Support/CFG.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/llvm/Support/CFG.h b/include/llvm/Support/CFG.h
index 717802f6db..6e32c8a778 100644
--- a/include/llvm/Support/CFG.h
+++ b/include/llvm/Support/CFG.h
@@ -91,8 +91,13 @@ class SuccIterator : public std::iterator<std::bidirectional_iterator_tag,
const Term_ Term;
unsigned idx;
typedef std::iterator<std::bidirectional_iterator_tag, BB_, ptrdiff_t> super;
-public:
typedef SuccIterator<Term_, BB_> _Self;
+
+ inline bool index_is_valid(int idx) {
+ return idx >= 0 && (unsigned) idx < Term->getNumSuccessors();
+ }
+
+public:
typedef typename super::pointer pointer;
// TODO: This can be random access iterator, only operator[] missing.
@@ -110,10 +115,6 @@ public:
return *this;
}
- inline bool index_is_valid (int idx) {
- return idx >= 0 && (unsigned) idx < Term->getNumSuccessors();
- }
-
/// getSuccessorIndex - This is used to interface between code that wants to
/// operate on terminator instructions directly.
unsigned getSuccessorIndex() const { return idx; }