<div dir="ltr">Hi Greg, are you referring to the manual line splitting vs. using StringRef::split()? This is how it's documented:<div><br></div><div><div style="color:rgb(0,0,0);font-size:13px;line-height:18px;white-space:pre"><div style="font-family:"Droid Sans Mono","Courier New",monospace,"Droid Sans Fallback"">    <span style="color:rgb(0,128,0)">/// Split into two substrings around the first occurrence of a separator</span></div><div style="font-family:"Droid Sans Mono","Courier New",monospace,"Droid Sans Fallback"">    <span style="color:rgb(0,128,0)">/// character.</span></div><div style="font-family:"Droid Sans Mono","Courier New",monospace,"Droid Sans Fallback"">    <span style="color:rgb(0,128,0)">///</span></div><div style="font-family:"Droid Sans Mono","Courier New",monospace,"Droid Sans Fallback"">    <span style="color:rgb(0,128,0)">/// If \p Separator is in the string, then the result is a pair (LHS, RHS)</span></div><div style="font-family:"Droid Sans Mono","Courier New",monospace,"Droid Sans Fallback"">    <span style="color:rgb(0,128,0)">/// such that (*this == LHS + Separator + RHS) is true and RHS is</span></div><div style="font-family:"Droid Sans Mono","Courier New",monospace,"Droid Sans Fallback"">    <span style="color:rgb(0,128,0)">/// maximal. If \p Separator is not in the string, then the result is a</span></div><div style="font-family:"Droid Sans Mono","Courier New",monospace,"Droid Sans Fallback"">    <span style="color:rgb(0,128,0)">/// pair (LHS, RHS) where (*this == LHS) and (RHS == "").</span></div><div style="font-family:"Droid Sans Mono","Courier New",monospace,"Droid Sans Fallback""><br></div><div style=""><font face="arial, helvetica, sans-serif">Yes, RHS == "" happens to be be implemented as a StringRef with nullptr data, but this seems to make the implementation even more depended on the subtle details. My point was that second == "" in two cases: separator is not in the string AND separator is _last_ character in the string.</font></div><div style=""><font face="arial, helvetica, sans-serif"><br></font></div><div style=""><font face="arial, helvetica, sans-serif">Did I get the question right?</font></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 18, 2017 at 3:51 PM, Greg Clayton via Phabricator <span dir="ltr"><<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">clayborg added a comment.<br>
<br>
ok. Then back to the "can we use StringRef"? We might be able to check if the second.data() is NULL? It might be NULL if the string doesn't end with a newline. It it does, it might be empty but contain a pointer to the '\0' byte?<br>
<br>
<br>
<a href="https://reviews.llvm.org/D37923" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D37923</a><br>
<br>
<br>
<br>
</blockquote></div><br></div>