summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
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/Analysis
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/Analysis')
-rw-r--r--llvm/lib/Analysis/LazyCallGraph.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/LazyCallGraph.cpp b/llvm/lib/Analysis/LazyCallGraph.cpp
index c001f55bb62..b1d585bfc68 100644
--- a/llvm/lib/Analysis/LazyCallGraph.cpp
+++ b/llvm/lib/Analysis/LazyCallGraph.cpp
@@ -1273,7 +1273,7 @@ LazyCallGraph::RefSCC::removeInternalRefEdge(Node &SourceN,
// the removal hasn't changed the structure at all. This is an important
// special case and we can directly exit the entire routine more
// efficiently as soon as we discover it.
- if (distance(RefSCCNodes) == NumRefSCCNodes) {
+ if (llvm::size(RefSCCNodes) == NumRefSCCNodes) {
// Clear out the low link field as we won't need it.
for (Node *N : RefSCCNodes)
N->LowLink = -1;
@@ -1739,7 +1739,7 @@ static void printNode(raw_ostream &OS, LazyCallGraph::Node &N) {
}
static void printSCC(raw_ostream &OS, LazyCallGraph::SCC &C) {
- ptrdiff_t Size = distance(C);
+ ptrdiff_t Size = size(C);
OS << " SCC with " << Size << " functions:\n";
for (LazyCallGraph::Node &N : C)
@@ -1747,7 +1747,7 @@ static void printSCC(raw_ostream &OS, LazyCallGraph::SCC &C) {
}
static void printRefSCC(raw_ostream &OS, LazyCallGraph::RefSCC &C) {
- ptrdiff_t Size = distance(C);
+ ptrdiff_t Size = size(C);
OS << " RefSCC with " << Size << " call SCCs:\n";
for (LazyCallGraph::SCC &InnerC : C)
OpenPOWER on IntegriCloud