ClassInterface(classInterface) {}
public:
- virtual Decl *getCanonicalDecl() {
- if (Decl *interface = getClassInterface())
- return interface;
- return this;
- }
-
const ObjCInterfaceDecl *getClassInterface() const { return ClassInterface; }
ObjCInterfaceDecl *getClassInterface() { return ClassInterface; }
void setClassInterface(ObjCInterfaceDecl *IFace);
if (!clang_isDeclaration(C.kind))
return C;
- if (Decl *D = getCursorDecl(C))
+ if (Decl *D = getCursorDecl(C)) {
+ if (ObjCImplDecl *ImplD = dyn_cast<ObjCImplDecl>(D))
+ if (ObjCInterfaceDecl *IFD = ImplD->getClassInterface())
+ return MakeCXCursor(IFD, getCursorTU(C));
+
return MakeCXCursor(D->getCanonicalDecl(), getCursorTU(C));
+ }
return C;
}