[cfe-dev] libclang: get objective-c interface cursor from implementation cursor

ejvaughan ejvaughan at gmail.com
Fri May 2 14:42:18 PDT 2014


Hello, world!

I am trying to use libclang to determine the superclass that an Objective-C
method belongs to. I have a cursor representing an instance method
(CXCursor_ObjCInstanceMethodDecl). When I get the cursor's parent, I get a
cursor of kind CXCursor_ObjCImplementationDecl. I need to be able to get the
interface cursor from this last cursor in order to determine the method's
superclass. Is there a way to do this?  Sorry if this is a dumb question. 
If I print the AST using -ast-dump, I see that the ObjCImplementationDecl
cursor has a child cursor that references the interface declaration, but I
don't see this reflected when I use the libclang API.  Any help would be
greatly appreciated.  Thanks!



--
View this message in context: http://clang-developers.42468.n3.nabble.com/libclang-get-objective-c-interface-cursor-from-implementation-cursor-tp4039263.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list