[cfe-commits] r161703 - in /cfe/trunk: include/clang/AST/Stmt.h lib/AST/Stmt.cpp

Chad Rosier mcrosier at apple.com
Tue Aug 14 10:34:34 PDT 2012


On Aug 13, 2012, at 11:11 PM, Abramo Bagnara wrote:

> Il 13/08/2012 23:54, Eli Friedman ha scritto:
>> On Mon, Aug 13, 2012 at 2:01 PM, Richard Smith <richard at metafoo.co.uk> wrote:
>>> According to the documentation I can find[1], multiple __asm constructs are
>>> separate statements. In particular, the documentation suggests that here:
>>> 
>>> void f() {
>>>  if (false)
>>>    __asm mov eax, ebx
>>>  __asm mov ebx, eax
>>> }
>>> 
>>> the second __asm statement is not controlled by the 'if'. If the
>>> documentation is correct, we currently misparse this.
>>> 
>>> [1] http://msdn.microsoft.com/en-us/library/45yd4tzz(v=vs.110).aspx
>> 
>> I think clang's interpretation is actually right here, but someone
>> should actually try that on MSVC.
> 
> void f(int x) {
> 	if (x)
> 		__asm out dx, ax
> 	__asm out dx, ax
> 	if (x)
> 		__asm out dx, ax;
> 	__asm out dx, ax;
> 	if (x)
> 		__asm { out dx, ax };
>        __asm { out dx, ax };
> 	if (x)
> 		__asm { out dx, ax }
>        __asm { out dx, ax }
> }
> 
> 
> For all these case Microsoft Visual C++ 2010 Express has the very same
> interpretation that Richard describes and conformant to the documentation.

I too verified this.  Given Richard's conclusion is correct, Jordan's suggestion
about some sort of block containing a series of statements is starting to sound
more reasonable.  At the very least I'll fix the parser issue today.

 Chad

> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list