[cfe-commits] r62030 - in /cfe/trunk/lib/CodeGen: CGObjC.cpp CGObjCGNU.cpp CGObjCMac.cpp CGObjCRuntime.h CodeGenFunction.h

Fariborz Jahanian fjahanian at apple.com
Sat Jan 10 13:53:09 PST 2009


On Jan 10, 2009, at 1:43 PM, steve naroff wrote:

> Hey Fariborz,
>
> Comment below...
>
> On Jan 10, 2009, at 4:06 PM, Fariborz Jahanian wrote:
>
>> Author: fjahanian
>> Date: Sat Jan 10 15:06:09 2009
>> New Revision: 62030
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=62030&view=rev
>> Log:
>> This patch fixes the code gen failures which was a fallout from
>> not merging protocol properties into the classes which
>> use those protocols. With this patch, all my exceutable
>> test pass again.
>>
>> Modified:
>>   cfe/trunk/lib/CodeGen/CGObjC.cpp
>>   cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
>>   cfe/trunk/lib/CodeGen/CGObjCMac.cpp
>>   cfe/trunk/lib/CodeGen/CGObjCRuntime.h
>>   cfe/trunk/lib/CodeGen/CodeGenFunction.h
>>
>> Modified: cfe/trunk/lib/CodeGen/CGObjC.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjC.cpp?rev=62030&r1=62029&r2=62030&view=diff
>>
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =====================================================================
>> --- cfe/trunk/lib/CodeGen/CGObjC.cpp (original)
>> +++ cfe/trunk/lib/CodeGen/CGObjC.cpp Sat Jan 10 15:06:09 2009
>> @@ -103,9 +103,10 @@
>> /// StartObjCMethod - Begin emission of an ObjCMethod. This generates
>> /// the LLVM function and sets the other context used by
>> /// CodeGenFunction.
>> -void CodeGenFunction::StartObjCMethod(const ObjCMethodDecl *OMD) {
>> +void CodeGenFunction::StartObjCMethod(const ObjCMethodDecl *OMD,
>> +                                      const ObjCContainerDecl *CD) {
>
> Why do you need to pass in the ObjCContainerDecl?
>
> Since ObjCMethodDecl's are now ScopedDecl's, why can't you use OMD- 
> >getDeclContext()?

This was the purpose of this patch. Method decl's ScopeDecl is not  
usable, as it my be a protocol
method. Code gen. need the implementation context. This used to work  
because we injected
method in the interface all the time (via protocol merging). Not any  
more. So, I need to pass down
method's implementation context down to where it is needed. This is  
really a better API
in any case, as context of the code gen is always @implementation.

- Fariborz

>



More information about the cfe-commits mailing list