<p dir="ltr">Matthew, </p>
<p dir="ltr">I don't think this functionality is intended to be stable or reparseable, but most certainly it's not a production tool. </p>
<p dir="ltr">Whatever is reported, will probably be treated as improvement, not a bug. You shouldn't be using this as a feature, that's all I'm saying. </p>
<p dir="ltr">Cheers, <br>
Renato </p>
<div class="gmail_quote">On 1 Oct 2014 02:08, "Matthew Fernandez" <<a href="mailto:matthew.fernandez@gmail.com">matthew.fernandez@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">OK, will do. While we're on the topic, Clang also seems to remove bracketing around parameters to inline asm:<br>
<br>
$ cat foo.c<br>
void foo() {<br>
int i = 0;<br>
asm ("mov %%eax, %%ebx"::"a"(i));<br>
}<br>
$ clang -c foo.c<br>
$ clang -cc1 -ast-print foo.c | tee bar.c<br>
void foo() {<br>
int i = 0;<br>
asm ("mov %%eax, %%ebx" : : "a" i);<br>
}<br>
$ clang -c bar.c<br>
bar.c:3:38: error: expected '(' after 'asm operand'<br>
asm ("mov %%eax, %%ebx" : : "a" i);<br>
^<br>
1 error generated.<br>
<br>
To me, this is indicative of a second bug. Should I file this one separately as well? My hesitancy is because I'm not sure how robust this functionality is intended to be. Should the output of -ast-print always be parseable as input to Clang? I would think yes.<br>
<br>
On 01/10/14 09:33, Renato Golin wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Possibly. Opening a bug is definitely worth, though, at least to investigate.<br>
<br>
Cheers,<br>
Renato<br>
<br>
On 30 Sep 2014 22:48, "Matthew Fernandez" <<a href="mailto:matthew.fernandez@gmail.com" target="_blank">matthew.fernandez@gmail.com</a><br>
<mailto:<a href="mailto:matthew.fernandez@gmail.com" target="_blank">matthew.fernandez@<u></u>gmail.com</a>>> wrote:<br>
<br>
Thanks, Renato. So this is definitely a bug? If so, I'll open a new one at<br>
<a href="http://llvm.org/bugs/" target="_blank">http://llvm.org/bugs/</a>. Just wanted to make sure it wasn't intended behaviour.<br>
<br>
On 01/10/14 06:51, Renato Golin wrote:<br>
<br>
On 30 September 2014 02:57, Matthew Fernandez<br>
<<a href="mailto:matthew.fernandez@gmail.com" target="_blank">matthew.fernandez@gmail.com</a> <mailto:<a href="mailto:matthew.fernandez@gmail.com" target="_blank">matthew.fernandez@<u></u>gmail.com</a>>> wrote:<br>
<br>
This seems to be independent of the target platform; at least I get similar<br>
results for ARM and x86. What is the intended behaviour here?<br>
<br>
<br>
Current tip does:<br>
<br>
void foo() {<br>
register int x asm("eax");<br>
}<br>
<br>
AND<br>
<br>
void foo() {<br>
register int x = 1 asm("eax");<br>
}<br>
<br>
The first looks correct, but the second looks weird. I don't know<br>
what's the expected behaviour, or if this output can be regarded as<br>
valid code (I'm guessing not), so in theory, it doesn't matter much.<br>
But it does seem an easy fix for this particular case, I think.<br>
<br>
cheers,<br>
--renato<br>
<br>
</blockquote>
</blockquote></div>