Add some predicated searching functions to StringRef.

Description

Add some predicated searching functions to StringRef.

This adds 4 new functions to StringRef, which can be used to
take or drop characters while a certain condition is met, or
until a certain condition is met. They are:

take_while - Return characters until a condition is not met.
take_until - Return characters until a condition is met.
drop_while - Remove characters until a condition is not met.
drop_until - Remove characters until a condition is met.

Internally, all of these functions delegate to two additional
helper functions which can be used to search for the position
of a character meeting or not meeting a condition, which are:

find_if - Find the first character matching a predicate.
find_if_not - Find the first character not matching a predicate.

Differential Revision: https://reviews.llvm.org/D24842

Details

Committed
zturnerSep 24 2016, 8:27 PM
Differential Revision
D24842: Add StringRef {take, drop} x {_while, _until}
Parents
rL282345: Use __attribute__((internal_linkage)) when available.
Branches
Unknown
Tags
Unknown