diff options
| author | Vedant Kumar <vsk@apple.com> | 2018-05-10 23:01:54 +0000 |
|---|---|---|
| committer | Vedant Kumar <vsk@apple.com> | 2018-05-10 23:01:54 +0000 |
| commit | e0b5f86b3083747beaf5d7639333af0109c9e6ef (patch) | |
| tree | f76486dec408880ad53ce624064ccb10f2b9faea /llvm/lib/Transforms/Vectorize | |
| parent | 4855c5f717fde5207033e97989b20b273298a57b (diff) | |
| download | bcm5719-llvm-e0b5f86b3083747beaf5d7639333af0109c9e6ef.tar.gz bcm5719-llvm-e0b5f86b3083747beaf5d7639333af0109c9e6ef.zip | |
[STLExtras] Add distance() for ranges, pred_size(), and succ_size()
This commit adds a wrapper for std::distance() which works with ranges.
As it would be a common case to write `distance(predecessors(BB))`, this
also introduces `pred_size()` and `succ_size()` helpers to make that
easier to write.
Differential Revision: https://reviews.llvm.org/D46668
llvm-svn: 332057
Diffstat (limited to 'llvm/lib/Transforms/Vectorize')
| -rw-r--r-- | llvm/lib/Transforms/Vectorize/VPlan.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp b/llvm/lib/Transforms/Vectorize/VPlan.cpp index 4e54fc6db2a..7146fcc098b 100644 --- a/llvm/lib/Transforms/Vectorize/VPlan.cpp +++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp @@ -356,7 +356,7 @@ void VPlan::updateDominatorTree(DominatorTree *DT, BasicBlock *LoopPreHeaderBB, "One successor of a basic block does not lead to the other."); assert(InterimSucc->getSinglePredecessor() && "Interim successor has more than one predecessor."); - assert(std::distance(pred_begin(PostDomSucc), pred_end(PostDomSucc)) == 2 && + assert(pred_size(PostDomSucc) == 2 && "PostDom successor has more than two predecessors."); DT->addNewBlock(InterimSucc, BB); DT->addNewBlock(PostDomSucc, BB); |

