<div dir="ltr">It seems wrong to make it 'comdat $foo global i32 42' instead of 'global i32 42, comdat $foo'.  We seem to usually follow the convention that we comma delimitate optional things like alignment. More importantly, I'd like comdat and section to be near each other because they are very related.<div><br></div><div>To be honest, I don't really like the idea of providing two ways to do it but if we must can we at least support 'comdat $foo', 'comdat(any)', 'comdat(largest)' etc? Special casing 'comdat any' seems wrong.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 5, 2015 at 7:51 PM, Duncan P. N. Exon Smith <span dir="ltr"><<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">> On 2015 Jan 5, at 11:34, Rafael Espíndola <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>> wrote:<br>
><br>
> In order to make comdats always explicit in the IR, we decided to make<br>
> the syntax a bit more compact for the case o a GlobalObject in a<br>
> comdat with the same name.<br>
><br>
> Just dropping the $name causes problems for<br>
><br>
> @foo = globabl i32 0, comdat<br>
> $bar = comdat ...<br>
><br>
> and<br>
><br>
> declare void @foo() comdat<br>
> $bar = comdat ...<br>
><br>
> so the attached patch changes the syntax to<br>
><br>
> @foo = comdat $foo global i32 0<br>
><br>
> and<br>
><br>
> declare comdat $foo void @foo<br>
><br>
> and as a syntactic sugar<br>
><br>
> $foo = comdat ...<br>
> @foo = comdat global ...<br>
><br>
> is now equivalent to<br>
><br>
> $foo = comdat ...<br>
> @foo = comdat $foo global ...<br>
><br>
> and<br>
><br>
> $foo = comdat ...<br>
> declare comdat void @foo(...<br>
><br>
> is now equivalent to<br>
><br>
> $foo = comdat ...<br>
> declare comdat $foo void @foo(...<br>
<br>
</div></div>This SGTM.<br>
<span class=""><br>
> It would be possible to take this one step further and make<br>
><br>
> @foo = comdat global ...<br>
><br>
> equivalent to<br>
><br>
> $foo = comdat any<br>
> @foo = comdat $foo global ...<br>
><br>
> but it is not clear if that is worth it. It would require rejecting things like<br>
><br>
> $foo = comdat largest<br>
> @foo = comdat global...<br>
<br>
</span>I think this behaviour would be confusing.<br>
<span class=""><br>
> Maybe as an independent patch we could make all<br>
><br>
> $foo = comdat any<br>
><br>
> optional instead?<br>
<br>
</span>Sounds reasonable to me...<br>
<br>
><br>
> Cheers,<br>
> Rafael<br>
> <llvm.patch><clang.patch><br>
<br>
(Haven't had a chance to look at the patches, will do tomorrow if no one<br>
beats me to it.)<br>
<div class="HOEnZb"><div class="h5"><br>
<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" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div>