[cfe-dev] ObjCClassDecl from ObjCIvarDecl?

Steve Naroff snaroff at apple.com
Thu Apr 17 11:16:56 PDT 2008


On Apr 17, 2008, at 11:10 AM, Fariborz Jahanian wrote:

>
> On Apr 17, 2008, at 11:01 AM, Emerson Murphy-Hill wrote:
>
>> Howdy!
>>
>> I have an ObjCIvarDecl and need its containing interface, an
>> ObjCClassDecl.  Any easy way to do this?  (Of course, I've already
>
> You mean ObjCInterfaceDecl
>>
>> gotten the ivar from the interface, but I prefer not to carry around
>> the interface if I don't have to).
>>
>
> This info. is not currently available. We can add it to ObjCIvarDecl
> but this adds to the size and we would like to avoid it if info. can
> be obtained some other way.
> This info is always available as an 'ivar' is always accessed within
> the context of its interface decl.
>

fyi...I will be looking into how ObjC AST's should play with the new  
DeclContext. At the moment, I don't believe FieldDecls have a  
DeclContext (since they aren't ScopedDecl's). If we change this, and  
have field decls point to their parent, we should likely do the same  
for ivars.

snaroff

> - fariborz
>
>> Thanks,
>>
>> Emerson
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list