From: Argyrios Kyrtzidis Date: Fri, 15 Jul 2011 21:39:32 +0000 (+0000) Subject: The canonical decl for an ObjCImplDecl is it's interface class. Fixes rdar://8728637. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cea2e3d7ea9cdc763f7a98937c09769cd4d1f582;p=clang The canonical decl for an ObjCImplDecl is it's interface class. Fixes rdar://8728637. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135304 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h index d318fc27a8..88877cfe0b 100644 --- a/include/clang/AST/DeclObjC.h +++ b/include/clang/AST/DeclObjC.h @@ -1122,6 +1122,12 @@ protected: 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);