[PATCH] D75882: [VPlan] Define class successor and predecessor iterators.
Alina Sbirlea via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 9 16:12:39 PDT 2020
asbirlea created this revision.
Herald added subscribers: psnobl, rogfer01, rkruppe, tschuett, bollu, hiraditya.
Herald added a project: LLVM.
Define class-specific successor and predecessor iterators.
These match the existing interface in MachineBasicBlock and clang::CFGBlock.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D75882
Files:
llvm/lib/Transforms/Vectorize/VPlan.h
Index: llvm/lib/Transforms/Vectorize/VPlan.h
===================================================================
--- llvm/lib/Transforms/Vectorize/VPlan.h
+++ llvm/lib/Transforms/Vectorize/VPlan.h
@@ -410,6 +410,19 @@
virtual ~VPBlockBase() = default;
+ using pred_iterator = SmallVectorImpl<VPBlockBase *>::iterator;
+ using const_pred_iterator = SmallVectorImpl<VPBlockBase *>::const_iterator;
+ using succ_iterator = SmallVectorImpl<VPBlockBase *>::iterator;
+ using const_succ_iterator = SmallVectorImpl<VPBlockBase *>::const_iterator;
+ pred_iterator pred_begin() { return Predecessors.begin(); }
+ const_pred_iterator pred_begin() const { return Predecessors.begin(); }
+ pred_iterator pred_end() { return Predecessors.end(); }
+ const_pred_iterator pred_end() const { return Predecessors.end(); }
+ succ_iterator succ_begin() { return Successors.begin(); }
+ const_succ_iterator succ_begin() const { return Successors.begin(); }
+ succ_iterator succ_end() { return Successors.end(); }
+ const_succ_iterator succ_end() const { return Successors.end(); }
+
const std::string &getName() const { return Name; }
void setName(const Twine &newName) { Name = newName.str(); }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75882.249236.patch
Type: text/x-patch
Size: 1202 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200309/4a897cf7/attachment.bin>
More information about the llvm-commits
mailing list