summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2011-03-02 00:11:28 +0000
committerDan Gohman <gohman@apple.com>2011-03-02 00:11:28 +0000
commit0b77e0f07da7817c2b31aa010ee2b3e035f200ca (patch)
tree68535fa1dff5e8846ea974fa6c3ac527a2b1ad47 /include
parent9763e2bf39b84f18bd464b0cda61fe1cd98dcaae (diff)
downloadllvm-0b77e0f07da7817c2b31aa010ee2b3e035f200ca.tar.gz
llvm-0b77e0f07da7817c2b31aa010ee2b3e035f200ca.tar.bz2
llvm-0b77e0f07da7817c2b31aa010ee2b3e035f200ca.tar.xz
Make pred_iterator DefaultConstructible, and add an accessor to
retrieve the underlying getOperandNo() value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126804 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Support/CFG.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/Support/CFG.h b/include/llvm/Support/CFG.h
index 9ba71fcca8..d2ea12364e 100644
--- a/include/llvm/Support/CFG.h
+++ b/include/llvm/Support/CFG.h
@@ -41,6 +41,7 @@ class PredIterator : public std::iterator<std::forward_iterator_tag,
public:
typedef typename super::pointer pointer;
+ PredIterator() {}
explicit inline PredIterator(Ptr *bb) : It(bb->use_begin()) {
advancePastNonTerminators();
}
@@ -64,6 +65,12 @@ public:
inline Self operator++(int) { // Postincrement
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;