[cfe-dev] CodeGen help for a new feature in ObjC

Remy Demarest remy.demarest at gmail.com
Wed Dec 21 02:23:33 PST 2011


I have one last detail to solve before I'm done with this feature.

The principle of this feature is that the storage in the block structure (be it on the stack or the heap) is __weak, but the local variables and the variables inside the block are not __weak, they would be strong usually.

My problem is that I can't figure out how to make weak setup to happen, I know I have to call EmitARCInitWeak() to initialize the capture field, but I don't know what parameters I have to pass at this point. The place where my code is supposed to be inserted uses a fake POD loading to put the expected value into the variable... Trying to reduce the code doesn't work very well sadly.

____________________________________
Remy "Psy" Demarest
remy.demarest at gmail.com
+1 (647) 862-1779

Le 20 déc. 2011 à 20:05, John McCall a écrit :

> On Dec 20, 2011, at 11:00 AM, Remy Demarest wrote:
>> I'll think I'll just KISS it and to the retain before the body emission and the do the release after the body implementation.
> 
> That seems workable.  However, you should push a cleanup to do the release instead of just manually calling it;  pushDestroy should do what you want.
> 
> John.





More information about the cfe-dev mailing list