This is an archive of the discontinued LLVM Phabricator instance.

[STLExtras] Add size() for ranges, and remove distance()
ClosedPublic

Authored by vsk on May 16 2018, 2:18 PM.

Details

Summary

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).

Diff Detail

Event Timeline

vsk created this revision.May 16 2018, 2:18 PM

I'm good with this (since I suggested it) if @craig.topper is.

craig.topper accepted this revision.May 16 2018, 4:06 PM

LGTM

lib/CodeGen/ImplicitNullChecks.cpp
600

Can you just change this to NumDefs == 1? The end for defs() is calculated with MI->getDesc().getNumDefs() which is what NumDefs is assigned to.

This revision is now accepted and ready to land.May 16 2018, 4:06 PM
This revision was automatically updated to reflect the committed changes.