[STLExtras] Add size() for ranges, and remove distance()
authorVedant Kumar <vsk@apple.com>
Wed, 16 May 2018 23:20:42 +0000 (23:20 +0000)
committerVedant Kumar <vsk@apple.com>
Wed, 16 May 2018 23:20:42 +0000 (23:20 +0000)
commit5a0872c2b751fd339e10c1b9d29ed4a9e62a323d
tree60578e1838b47b5da4279a36a8c17be782946192
parentae83159530f2657d35bc2543065e23256489d7ea
[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/include/llvm/ADT/STLExtras.h
llvm/lib/Analysis/LazyCallGraph.cpp
llvm/lib/CodeGen/ImplicitNullChecks.cpp
llvm/lib/IR/Value.cpp
llvm/lib/Transforms/Scalar/GVNHoist.cpp
llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp
llvm/unittests/ADT/IteratorTest.cpp
llvm/unittests/IR/BasicBlockTest.cpp