[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332551 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Vedant Kumar
2018-05-16 23:20:42 +00:00
parent 309c9c43a7
commit ca6a4d968e
8 changed files with 23 additions and 14 deletions
+1 -1
View File
@@ -597,7 +597,7 @@ MachineInstr *ImplicitNullChecks::insertFaultingInstr(
unsigned DefReg = NoRegister;
if (NumDefs != 0) {
DefReg = MI->defs().begin()->getReg();
assert(distance(MI->defs()) == 1 && "expected exactly one def!");
assert(NumDefs == 1 && "expected exactly one def!");
}
FaultMaps::FaultKind FK;