From ab585ff20ecd9ca41baf283e713176f4acaf8137 Mon Sep 17 00:00:00 2001 From: Jim Grosbach Date: Fri, 4 Apr 2014 02:10:59 +0000 Subject: [PATCH] Add iterator_ranges for block pred/succ. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205603 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/MachineBasicBlock.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h index 5e86e756d5a..5a9e3ecba81 100644 --- a/include/llvm/CodeGen/MachineBasicBlock.h +++ b/include/llvm/CodeGen/MachineBasicBlock.h @@ -256,7 +256,6 @@ public: succ_reverse_iterator; typedef std::vector::const_reverse_iterator const_succ_reverse_iterator; - pred_iterator pred_begin() { return Predecessors.begin(); } const_pred_iterator pred_begin() const { return Predecessors.begin(); } pred_iterator pred_end() { return Predecessors.end(); } @@ -290,6 +289,19 @@ public: } bool succ_empty() const { return Successors.empty(); } + inline iterator_range predecessors() { + return iterator_range(pred_begin(), pred_end()); + } + inline iterator_range const_predecessors() const { + return iterator_range(pred_begin(), pred_end()); + } + inline iterator_range succecessors() { + return iterator_range(succ_begin(), succ_end()); + } + inline iterator_range const_succecessors() const { + return iterator_range(succ_begin(), succ_end()); + } + // LiveIn management methods. /// addLiveIn - Add the specified register as a live in. Note that it