summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Value.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2018-05-16 23:20:42 +0000
committerVedant Kumar <vsk@apple.com>2018-05-16 23:20:42 +0000
commit5a0872c2b751fd339e10c1b9d29ed4a9e62a323d (patch)
tree60578e1838b47b5da4279a36a8c17be782946192 /llvm/lib/IR/Value.cpp
parentae83159530f2657d35bc2543065e23256489d7ea (diff)
downloadbcm5719-llvm-5a0872c2b751fd339e10c1b9d29ed4a9e62a323d.tar.gz
bcm5719-llvm-5a0872c2b751fd339e10c1b9d29ed4a9e62a323d.zip
[STLExtras] Add size() for ranges, and remove distance()
r332057 introduced distance() for ranges. Based on post-commit feedback, this renames distance() to size(). The new size() is also only enabled when the operation is O(1). Differential Revision: https://reviews.llvm.org/D46976 llvm-svn: 332551
Diffstat (limited to 'llvm/lib/IR/Value.cpp')
-rw-r--r--llvm/lib/IR/Value.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp
index bdcc657abe6..2f95e9348b4 100644
--- a/llvm/lib/IR/Value.cpp
+++ b/llvm/lib/IR/Value.cpp
@@ -167,7 +167,9 @@ bool Value::isUsedInBasicBlock(const BasicBlock *BB) const {
return false;
}
-unsigned Value::getNumUses() const { return (unsigned)distance(uses()); }
+unsigned Value::getNumUses() const {
+ return (unsigned)std::distance(use_begin(), use_end());
+}
static bool getSymTab(Value *V, ValueSymbolTable *&ST) {
ST = nullptr;
OpenPOWER on IntegriCloud