<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 29, 2014 at 12:59 PM, Alexey Samsonov <span dir="ltr"><<a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@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 id=":3k6" class="a3s" style="overflow:hidden">Author: samsonov<br>
Date: Mon Dec 29 14:59:02 2014<br>
New Revision: 224953<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=224953&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=224953&view=rev</a><br>
Log:<br>
Remove unnecessary StringRef->std::string conversion.<br>
<br>
Modified:<br>
    llvm/trunk/lib/Support/Unix/Path.inc<br>
<br>
Modified: llvm/trunk/lib/Support/Unix/Path.inc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Path.inc?rev=224953&r1=224952&r2=224953&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Path.inc?rev=224953&r1=224952&r2=224953&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Support/Unix/Path.inc (original)<br>
+++ llvm/trunk/lib/Support/Unix/Path.inc Mon Dec 29 14:59:02 2014<br>
@@ -150,7 +150,7 @@ std::string getMainExecutable(const char<br>
       // /proc is not always mounted under Linux (chroot for example).<br>
       ssize_t len = readlink(aPath.str().c_str(), exe_path, sizeof(exe_path));<br>
       if (len >= 0)<br>
-          return StringRef(exe_path, len);<br>
+          return std::string(exe_path, len);</div></blockquote></div><br>Are you sure RVO can fire here? If not, this adds a std::string copy....</div></div>