summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2018-05-10 23:01:54 +0000
committerVedant Kumar <vsk@apple.com>2018-05-10 23:01:54 +0000
commite0b5f86b3083747beaf5d7639333af0109c9e6ef (patch)
treef76486dec408880ad53ce624064ccb10f2b9faea /llvm/lib/Bitcode/Writer
parent4855c5f717fde5207033e97989b20b273298a57b (diff)
downloadbcm5719-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/Bitcode/Writer')
-rw-r--r--llvm/lib/Bitcode/Writer/ValueEnumerator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
index c5c336c7a4e..d473741e8ce 100644
--- a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
+++ b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
@@ -489,7 +489,7 @@ void ValueEnumerator::print(raw_ostream &OS, const ValueMapType &Map,
V->print(errs());
errs() << '\n';
- OS << " Uses(" << std::distance(V->use_begin(),V->use_end()) << "):";
+ OS << " Uses(" << V->getNumUses() << "):";
for (const Use &U : V->uses()) {
if (&U != &*V->use_begin())
OS << ",";
OpenPOWER on IntegriCloud