This revision moves the various range utilities present in MLIR to LLVM to enable greater reuse. This revision moves the following utilities:
- indexed_accessor_*
This is set of utility iterator/range base classes that allow for building a range class where the iterators are represented by an object+index pair.
- make_second_range
Given a range of pairs, returns a range iterating over the second elements.
- has_single_element
Returns if the given range has 1 element. size() == 1 checks end up being very common, but size() is not always O(1) (e.g., ilist). This method provides O(1) checks for those cases.
Depends On D78059
STLExtras.h is hugely conflicted here, but I'd recommend naming this hasSingleElement.