<div>Here's another go at it, adding stuff for PCH and the driver.  I put in a partial test of the driver change in test/Driver/clang_f_opts.c, which I hope is an appropriate place.</div>
<div><br>>There is some weird spacing in this patch... are you using tabs in your editor?<br></div>
<div>Sorry, I'm trying a new editor (Programmer's Notepad), and thought I had it set up correctly, but didn't.<br></div>
<div class="gmail_quote">On Tue, Nov 3, 2009 at 10:15 PM, Douglas Gregor <span dir="ltr"><<a href="mailto:dgregor@apple.com">dgregor@apple.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div class="im"><br>On Nov 2, 2009, at 7:01 PM, John Thompson wrote:<br><br></div>
<div class="im">
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Here's a stab at implementing -fshort-wchar.<br></blockquote><br></div>
<div class="im">Thanks! This looks good, except for two missing pieces:<br><br> - The PCH reader and writer need to load/save the ShortWChar bit.<br> - You'll need to update the clang driver to pass -fshort-wchar through to clang-cc<br>
<br>There is some weird spacing in this patch... are you using tabs in your editor?<br><br>+void TargetInfo::setForcedLangOptions(LangOptions &Opts) {<br>+       if (Opts.ShortWChar) {<br>+    WCharType = UnsignedShort;<br>
+    WCharWidth = WCharAlign = 16;<br>+       }<br>+}<br><br></div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote"><br>
<div class="im">The change to the wchar.c test allows it to pass on Windows (and still pass on Linux, which defaults to int for wchar_t).<br></div></blockquote><br>
<div>
<div></div>
<div class="h5">I'd like to retain the test that we use "int" for the other targets. Could you do something like<br><br> RUN: clang-cc %s -fsyntax-only -triple i686-pc-linux-gnu -verify -DWCHAR_T_TYPE="int" &&<br>
 RUN: clang-cc %s -fsyntax-only -fshort-wchar -verify -DWCHAR_T_TYPE="unsigned short"<br><br>then use WCHAR_T_TYPE as the element type of the t1 and t2 arrays?<br><br>       - Doug<br></div></div></blockquote></div>
<br><br clear="all"><br>-- <br>John Thompson<br><a href="mailto:John.Thompson.JTSoftware@gmail.com">John.Thompson.JTSoftware@gmail.com</a><br><br>