<div class="gmail_quote">On Fri, Mar 2, 2012 at 2:49 AM, David Chisnall <span dir="ltr"><<a href="mailto:csdavec@swan.ac.uk">csdavec@swan.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: theraven<br>
Date: Fri Mar  2 04:49:52 2012<br>
New Revision: 151889<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=151889&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=151889&view=rev</a><br>
Log:<br>
Add the Solaris support directory to the header search when using libc++.<br></blockquote><div><br></div><div>If you're going to be touching Solaris header search logic, please factor it into the driver like the Linux header search logic. That requires a separate Solaris toolchain (if there isn't one already) and overriding some methods, but it should be straight forward. Both win32 and Linux are already factored so you can look at those as an example.</div>
<div><br></div><div>I'd rather not see any further growth of InitHeaderSearch, and notably, there are no tests with this commit meaning it will break without warning or an easy way to catch it in the future.</div><div>
 </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Unconditionally define __C99FEATURES__ when using C++ on Solaris.  This is a<br>
(hopefully temporary) work around for libc++ exposing C99-but-not-C++98<br>
features in C++98 mode.<br></blockquote><div><br></div><div>Test case? Please don't commit without test cases.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
<br>
Modified:<br>
    cfe/trunk/lib/Basic/Targets.cpp<br>
    cfe/trunk/lib/Frontend/InitHeaderSearch.cpp<br>
<br>
Modified: cfe/trunk/lib/Basic/Targets.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=151889&r1=151888&r2=151889&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=151889&r1=151888&r2=151889&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/Basic/Targets.cpp (original)<br>
+++ cfe/trunk/lib/Basic/Targets.cpp Fri Mar  2 04:49:52 2012<br>
@@ -498,7 +498,7 @@<br>
       Builder.defineMacro("_XOPEN_SOURCE", "600");<br>
     else<br>
       Builder.defineMacro("_XOPEN_SOURCE", "500");<br>
-    if (Opts.CPlusPlus0x)<br>
+    if (Opts.CPlusPlus)<br>
       Builder.defineMacro("__C99FEATURES__");<br>
     Builder.defineMacro("_LARGEFILE_SOURCE");<br>
     Builder.defineMacro("_LARGEFILE64_SOURCE");<br>
<br>
Modified: cfe/trunk/lib/Frontend/InitHeaderSearch.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitHeaderSearch.cpp?rev=151889&r1=151888&r2=151889&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitHeaderSearch.cpp?rev=151889&r1=151888&r2=151889&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/Frontend/InitHeaderSearch.cpp (original)<br>
+++ cfe/trunk/lib/Frontend/InitHeaderSearch.cpp Fri Mar  2 04:49:52 2012<br>
@@ -461,6 +461,11 @@<br>
           AddPath(P.str(), CXXSystem, true, false, false, true);<br>
         }<br>
       }<br>
+      // On Solaris, include the support directory for things like xlocale and<br>
+      // fudged system headers.<br>
+      if (triple.getOS() == llvm::Triple::Solaris)<br>
+        AddPath("/usr/include/c++/v1/support/solaris", CXXSystem, true, false,<br>
+            false);<br></blockquote><div><br></div><div>Please follow the prevailing style of LLVM and Clang, and line up arguments after the open parenthesis.</div></div>