[cfe-commits] r104312 - in /cfe/trunk: lib/CodeGen/CGBlocks.cpp lib/CodeGen/CGBlocks.h lib/CodeGen/CGObjC.cpp lib/CodeGen/CodeGenFunction.h test/CodeGenObjC/blocks.m

Fariborz Jahanian fjahanian at apple.com
Fri May 21 10:26:58 PDT 2010


On May 21, 2010, at 10:04 AM, John McCall wrote:

>
> On May 21, 2010, at 8:12 AM, Fariborz Jahanian wrote:
>
>>
>> On May 20, 2010, at 9:11 PM, John McCall wrote:
>>
>>> Author: rjmccall
>>> Date: Thu May 20 23:11:14 2010
>>> New Revision: 104312
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=104312&view=rev
>>> Log:
>>> Allocate space in a block record for implicit references to the  
>>> Objective C
>>> 'self' variable arising from uses of the 'super' keyword.  Also  
>>> reorganize
>>> some code so that BlockInfo (now CGBlockInfo) can be opaque  
>>> outside of
>>> CGBlocks.cpp.
>>
>> Is this a regression or we were not handling 'super' in blocks  
>> before; and exposed by recent
>> changes. If the latter, then I am wondering how the project ever  
>> worked  before.
>
> Blocks IR gen makes two passes over the block.  The first pass  
> (CollectBlockDeclRefInfo)
> tries to collect all the block variables and build the block  
> layout;  the second pass generates
> IR for the block.  It turns out that very little relies on the first  
> pass having found all the
> variables:  there was an effort to make a global-block optimization  
> based on it, but it's
> commented out in the source.  But I decided that was a useful goal —  
> eventually I think
> we'll want/need this set to be calculated by Sema — and so I added  
> the assertion.

Thanks, this put me at ease. I was concerned that 'super' never worked  
all along and we thought
that it did.

- Fariborz

>
>
> John.





More information about the cfe-commits mailing list