]> granicus.if.org Git - clang/commitdiff
The canonical decl for an ObjCImplDecl is it's interface class. Fixes rdar://8728637.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 15 Jul 2011 21:39:32 +0000 (21:39 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 15 Jul 2011 21:39:32 +0000 (21:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135304 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/DeclObjC.h

index d318fc27a8ba1b66ed017031dcbff6d48916baae..88877cfe0b5948c6b6a6313d2cd7c8f68699bf1a 100644 (file)
@@ -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);