[PATCH] D104218: [ADT] Add StringRef consume_front_lower and consume_back_lower

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 23 10:14:59 PDT 2021


mstorsjo added a comment.

In D104218#2833781 <https://reviews.llvm.org/D104218#2833781>, @dexonsmith wrote:

> In D104218#2832463 <https://reviews.llvm.org/D104218#2832463>, @mstorsjo wrote:
>
>> In D104218#2832251 <https://reviews.llvm.org/D104218#2832251>, @lattner wrote:
>>
>>> That said, `xxx_lower()` is a really terrible name here for insensitive comparisons.  We have `StringRef::lower()` which returns a lower case string - it isn't insensitive.  It seems that the whole family needs a rename.  Could you take a crack at this as a follow-up?  It should be a mechanical change.
>>
>> Sure, I can give that a shot. Any suggestion on what the name pattern should be? `xxx_caseinsensitive()` is a bit of a mouthful, `xxx_i()` is terse but less understandable and discoverable.
>
> A few ideas to consider:
>
> - `X_casei()`
> - `X_nocase()`
> - `X_ignorecase()`
> - `X_foldcase()` (term from text search)

Thanks for the suggestions! What do you think of @lattner ‘s suggestion (X_insensitive)?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104218/new/

https://reviews.llvm.org/D104218



More information about the llvm-commits mailing list