<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>I did the obvious thing to fix this in r125236.</div><br><div><div>On Feb 9, 2011, at 2:41 PM, Kevin Enderby wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Doug,<div><br></div><div>Looks like two of the returns with arguments are causing problems for the build bots:</div><div><br></div><div><span class="Apple-style-span" style="font-family: Times; "><pre><span class="stdout" style="font-family: 'Courier New', courier, monotype; ">/Users/buildslave/zorg/buildbot/smooshlab/slave/build.llvm-gcc-i386-darwin9/llvm.src/lib/Support/Unix/PathV2.inc: In function 'void llvm::sys::path::canonical(const char*, llvm::SmallVectorImpl<char>&)':
/Users/buildslave/zorg/buildbot/smooshlab/slave/build.llvm-gcc-i386-darwin9/llvm.src/lib/Support/Unix/PathV2.inc:525: error: return-statement with a value, in function returning 'void'
/Users/buildslave/zorg/buildbot/smooshlab/slave/build.llvm-gcc-i386-darwin9/llvm.src/lib/Support/Unix/PathV2.inc:531: error: return-statement with a value, in function returning 'void'
</span></pre></span><div><div>On Feb 9, 2011, at 2:11 PM, Douglas Gregor wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Author: dgregor<br>Date: Wed Feb  9 16:11:23 2011<br>New Revision: 125228<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=125228&view=rev">http://llvm.org/viewvc/llvm-project?rev=125228&view=rev</a><br>Log:<br>Add llvm::sys::path::canonical(), which provides the canonicalized<br>name of a path, after resolving symbolic links and eliminating excess<br>path elements such as "foo/../" and "./".<br><br>This routine still needs a Windows implementation, but I don't have a<br>Windows machine available. Help? Please?<br><br>Modified:<br>    llvm/trunk/include/llvm/Support/PathV2.h<br>    llvm/trunk/lib/Support/Unix/PathV2.inc<br><br>Modified: llvm/trunk/include/llvm/Support/PathV2.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/PathV2.h?rev=125228&r1=125227&r2=125228&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/PathV2.h?rev=125228&r1=125227&r2=125228&view=diff</a><br>==============================================================================<br>--- llvm/trunk/include/llvm/Support/PathV2.h (original)<br>+++ llvm/trunk/include/llvm/Support/PathV2.h Wed Feb  9 16:11:23 2011<br>@@ -244,6 +244,15 @@<br> /// @result The stem of \a path.<br> const StringRef stem(StringRef path);<br><br>+/// Convert path to a canonical form, resolving symbolic links and removing<br>+/// unnecessary path elements (e.g., "foo/../", "./"). <br>+///<br>+/// @param path A path that is going to be canonicalized by resolving symlinks<br>+/// and removing unnecessary path elements (e.g., "./").<br>+///<br>+/// @param buffer The resulting canonical path.<br>+void canonical(const char *path, SmallVectorImpl<char> &result);<br>+  <br> /// @brief Get extension.<br> ///<br> /// If filename contains a dot but not solely one or two dots, result is the<br><br>Modified: llvm/trunk/lib/Support/Unix/PathV2.inc<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/PathV2.inc?rev=125228&r1=125227&r2=125228&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/PathV2.inc?rev=125228&r1=125227&r2=125228&view=diff</a><br>==============================================================================<br>--- llvm/trunk/lib/Support/Unix/PathV2.inc (original)<br>+++ llvm/trunk/lib/Support/Unix/PathV2.inc Wed Feb  9 16:11:23 2011<br>@@ -503,5 +503,35 @@<br> }<br><br> } // end namespace fs<br>+<br>+namespace path {<br>+<br>+void canonical(const char *path, SmallVectorImpl<char> &buffer) {<br>+  buffer.resize(PATH_MAX);<br>+  char *result = realpath(path, buffer.data());<br>+  if (result) {<br>+    buffer.resize(strlen(result));<br>+    return;<br>+  }<br>+<br>+  // A common extension is to support memory allocation of the result when<br>+  // passing NULL as the second argument.<br>+  result = realpath(path, 0);<br>+  if (result) {<br>+    size_t length = strlen(result);<br>+    buffer.resize(length);<br>+    memcpy(buffer.data(), result, length);<br>+    free(result);<br>+    return buffer.data();<br>+  }<br>+<br>+  size_t length = strlen(path);<br>+  buffer.resize(length);<br>+  memcpy(buffer.data(), path, length);<br>+  return path;<br>+}<br>+<br>+} // end namespace path<br>+<br> } // end namespace sys<br> } // end namespace llvm<br><br><br>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br></div></blockquote></div><br></div></div>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits<br></blockquote></div><br></body></html>