<div dir="ltr">Hey Davide,<br><br><span style="font-size:12.8px">I don't think I need the explicit Twine.<br></span>I will do some testing and update with a patch that removes that for both this and the other patch.<br>From my observation the only condition is that I return a StringRef that is constructed with a std::string so I don't hit the assertion.<br><br>Thanks again.<br>Martell</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 22, 2017 at 7:44 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Do you need the explicit "StringRef()" around the Twine expression here?<br><br>(do you need the explicit "Twine()" here either? Or would:<br>make_error<StringError>((S + ...).str(),<br>suffice?)</div><div class="HOEnZb"><div class="h5"><br><div class="gmail_quote"><div dir="ltr">On Sat, May 20, 2017 at 2:00 PM Martell Malone via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: martell<br>
Date: Sat May 20 16:00:36 2017<br>
New Revision: 303493<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=303493&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=303493&view=rev</a><br>
Log:<br>
COFF: Fix single StringRef return error<br>
<br>
This should appease the lld build bot regression<br>
Intrroduced by rL303490<br>
<br>
Modified:<br>
    llvm/trunk/lib/Object/<wbr>COFFImportFile.cpp<br>
<br>
Modified: llvm/trunk/lib/Object/<wbr>COFFImportFile.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/COFFImportFile.cpp?rev=303493&r1=303492&r2=303493&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/llvm/trunk/lib/Object/<wbr>COFFImportFile.cpp?rev=303493&<wbr>r1=303492&r2=303493&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/lib/Object/<wbr>COFFImportFile.cpp (original)<br>
+++ llvm/trunk/lib/Object/<wbr>COFFImportFile.cpp Sat May 20 16:00:36 2017<br>
@@ -111,8 +111,8 @@ static Expected<std::string> replace(Str<br>
<br>
   if (Pos == StringRef::npos) {<br>
     return make_error<StringError>(<br>
-      Twine(S + ": replacing '" + From + "' with '" + To + "' failed")<br>
-      .getSingleStringRef(), object_error::parse_failed);<br>
+      StringRef(Twine(S + ": replacing '" + From +<br>
+        "' with '" + To + "' failed").str()), object_error::parse_failed);<br>
   }<br>
<br>
   return (Twine(S.substr(0, Pos)) + To + S.substr(Pos + From.size())).str();<br>
<br>
<br>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</blockquote></div>
</div></div></blockquote></div><br></div>