<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jul 17, 2014 at 5:28 AM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div>On Wed, Jul 16, 2014 at 8:47 PM, Reid Kleckner <<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>> wrote:<br>



> Hi rsmith, majnemer,<br>
><br>
> This pragma is very rare.  We could *hypothetically* lower some uses of<br>
> it down to @llvm.global_ctors, but given that GlobalOpt isn't able to<br>
> optimize prioritized global ctors today, there's really no point.<br>
><br>
> If we wanted to do this in the future, I would check if the section used<br>
> in the pragma started with ".CRT$XC" and had up to two characters after<br>
> it.  Those two characters could form the 16-bit initialization priority<br>
> that we support in @llvm.global_ctors.  We would have to teach LLVM to<br>
> lower prioritized global ctors on COFF as well.<br>
><br>
> This should let us compile some silly uses of this pragma in WebKit /<br>
> Blink.<br>
><br>
<br>
</div>> +  assert(SegmentName->getCharByteWidth() == 1 &&<br>
> +         "only C strings are accepted here");<br>
<br>
Please do not assert here -- this should be an error instead.<br></blockquote><div><br></div><div>There was a missing case here for tokens other than identifiers or string literals, but the intention was that if a string starts with a string literal (not a wide string literal), then we know the whole string will be a C string, and I wanted to assert that we got one back.  This turned out to be wrong, given init_seg("a" L"b"), so I committed r213337 to fix the other pragma section handling code.</div>

<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
I'd like to see some parser test cases for the situation where<br>
something other than a string literal is given to the pragma. A test<br>
using a wide string literal would also be good.</blockquote><div><br></div><div>Sure.</div></div></div></div>