From b1ce730962fba225a7d59215e1a0ee71ce633b89 Mon Sep 17 00:00:00 2001 From: Sean Callanan Date: Fri, 11 Nov 2011 17:39:52 +0000 Subject: [PATCH] When importing an ObjCInterfaceDecl, ensure that superclass information is imported before validating it. This fixes spurious "incompatible superclasses" errors in LLDB. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144393 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/ASTImporter.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/AST/ASTImporter.cpp b/lib/AST/ASTImporter.cpp index e03b154e64..f7a55a1474 100644 --- a/lib/AST/ASTImporter.cpp +++ b/lib/AST/ASTImporter.cpp @@ -3220,6 +3220,17 @@ Decl *ASTNodeImporter::VisitObjCInterfaceDecl(ObjCInterfaceDecl *D) { // Check for consistency of superclasses. DeclarationName FromSuperName, ToSuperName; + + // If the superclass hasn't been imported yet, do so before checking. + ObjCInterfaceDecl *DSuperClass = D->getSuperClass(); + ObjCInterfaceDecl *ToIfaceSuperClass = ToIface->getSuperClass(); + + if (DSuperClass && !ToIfaceSuperClass) { + Decl *ImportedSuperClass = Importer.Import(DSuperClass); + ObjCInterfaceDecl *ImportedSuperIface = cast(ImportedSuperClass); + ToIface->setSuperClass(ImportedSuperIface); + } + if (D->getSuperClass()) FromSuperName = Importer.Import(D->getSuperClass()->getDeclName()); if (ToIface->getSuperClass()) -- 2.40.0