rsplit(char) already exists.  That said, another way to reuse code would be to have rsplit(char) call the StringRef version <br><div class="gmail_quote"><div dir="ltr">On Sun, Jun 3, 2018 at 5:28 PM Vedant Kumar via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">vsk requested changes to this revision.<br>
vsk added a comment.<br>
This revision now requires changes to proceed.<br>
<br>
Hi @MTC, thanks for the patch.<br>
<br>
With this patch, the logic for split would be duplicated 3 times now in StringRef.h. I think it'd be nice to reuse some code by moving the core logic into a private method of StringRef, say, `splitAtIndex(size_t)`. Then, each (r)split(char | StringRef) can use the common helper.<br>
<br>
Relatedly, an rsplit(char) overload seems to be missing here.<br>
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D47406" rel="noreferrer" target="_blank">https://reviews.llvm.org/D47406</a><br>
<br>
<br>
<br>
</blockquote></div>