<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 6, 2015 at 7:04 AM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.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"><span class="">On 6 January 2015 at 00:25, David Majnemer <<a href="mailto:david.majnemer@gmail.com">david.majnemer@gmail.com</a>> wrote:<br>
> It seems wrong to make it 'comdat $foo global i32 42' instead of 'global i32<br>
> 42, comdat $foo'.  We seem to usually follow the convention that we comma<br>
> delimitate optional things like alignment. More importantly, I'd like comdat<br>
> and section to be near each other because they are very related.<br>
<br>
</span>Any ideas on how to avoid the ambiguity in<br>
<br>
----------------------------------------<br>
@g = global i32 0, comdat $foo<br>
----------------------------------------<br>
<br>
versus<br>
<br>
---------------------------------------------<br>
@g = global i32 0, comdat<br>
$foo = comdat any<br>
-----------------------------------------<br>
<br>
Having to check if the $foo is followed by a = is quite ugly IMHO.<br>
<br>
I guess one option is to change the syntax to<br>
<br>
@g1 = global i32 0, comdat($c1)<br>
@g2 = global i32 0, comdat(); same as comdat($g2)<br>
<br>
or<br>
<br>
@g1 = global i32 0, comdat $c1<br>
@g2 = global i32, comdat $ ; same as "comdat $g2"<br></blockquote><div><br></div><div>How about:</div><div>@g1 = global i32 0, comdat($c1)</div><div>@g2 = global i32 0, comdat</div><div> </div><div>It keeps it nice and terse when possible and we only need to check if the next token after comdat is '(' to see if it is in an explicit comdat group.</div><div><br></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">
<span class=""><br>
> To be honest, I don't really like the idea of providing two ways to do it<br>
> but if we must can we at least support 'comdat $foo', 'comdat(any)',<br>
> 'comdat(largest)' etc? Special casing 'comdat any' seems wrong.<br>
<br>
</span>Note that the patch does *not* specialize 'comdat any'. I only noted<br>
the possibility.<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote></div><br></div></div>