ObjCClassDecl from ObjCIvarDecl?

Howdy!

I have an ObjCIvarDecl and need its containing interface, an ObjCClassDecl. Any easy way to do this? (Of course, I've already gotten the ivar from the interface, but I prefer not to carry around the interface if I don't have to).

Thanks,

Emerson

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.

- fariborz

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