mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-20 11:23:29 +00:00
568a8f4a4d
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282346 91177308-0d34-0410-b5e6-96231b3b80d8