From 5a0872c2b751fd339e10c1b9d29ed4a9e62a323d Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Wed, 16 May 2018 23:20:42 +0000 Subject: [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 --- llvm/lib/Analysis/LazyCallGraph.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Analysis') 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) -- cgit v1.2.3