On Nov 1, 2010, at 2:57 PM, Douglas Gregor wrote:

> 
> On Nov 1, 2010, at 2:51 PM, Argyrios Kyrtzidis wrote:
> 
>> Author: akirtzidis
>> Date: Mon Nov  1 16:51:42 2010
>> New Revision: 117961
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=117961&view=rev
>> Log:
>> Clean up temporaries created by an asm statement. Fixes rdar://8540491
> 
> Should this have a codegen test verifying that the temporary object is 
> destroyed?

Hmm, it is destroyed but I see the destruction emitted before the asm in IR 
which doesn't seem right; I'll take a look, thanks!

-Argiris

> 
>       - Doug
> 
>> Added:
>>   cfe/trunk/test/SemaCXX/asm.cpp
>> Modified:
>>   cfe/trunk/lib/Parse/ParseStmt.cpp
>> 
>> Modified: cfe/trunk/lib/Parse/ParseStmt.cpp
>> URL: 
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmt.cpp?rev=117961&r1=117960&r2=117961&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/Parse/ParseStmt.cpp (original)
>> +++ cfe/trunk/lib/Parse/ParseStmt.cpp Mon Nov  1 16:51:42 2010
>> @@ -1458,6 +1458,7 @@
>>      SkipUntil(tok::r_paren);
>>      return true;
>>    }
>> +    Res = Actions.MakeFullExpr(Res.get()).release();
>>    Exprs.push_back(Res.release());
>>    // Eat the comma and continue parsing if it exists.
>>    if (Tok.isNot(tok::comma)) return false;
>> 
>> Added: cfe/trunk/test/SemaCXX/asm.cpp
>> URL: 
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/asm.cpp?rev=117961&view=auto
>> ==============================================================================
>> --- cfe/trunk/test/SemaCXX/asm.cpp (added)
>> +++ cfe/trunk/test/SemaCXX/asm.cpp Mon Nov  1 16:51:42 2010
>> @@ -0,0 +1,13 @@
>> +// RUN: %clang_cc1 -fsyntax-only -verify %s
>> +
>> +struct A
>> +{
>> +    ~A();
>> +};
>> +int foo(A);
>> +
>> +void bar()
>> +{
>> +    A a;
>> +    asm("" : : "r"(foo(a)) ); // rdar://8540491
>> +}
>> 
>> 
>> _______________________________________________
>> cfe-commits mailing list
>> [email protected]
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> 


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to