diff options
author | Sean Callanan <scallanan@apple.com> | 2011-11-11 17:39:52 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2011-11-11 17:39:52 +0000 |
commit | b1ce730962fba225a7d59215e1a0ee71ce633b89 (patch) | |
tree | ef814014a631fe90b532fdf475d59f9332d5f930 | |
parent | e97ac9e684aecb5fc3fb9f86da09b8bb9dc31ff4 (diff) |
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
-rw-r--r-- | lib/AST/ASTImporter.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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<ObjCInterfaceDecl>(ImportedSuperClass); + ToIface->setSuperClass(ImportedSuperIface); + } + if (D->getSuperClass()) FromSuperName = Importer.Import(D->getSuperClass()->getDeclName()); if (ToIface->getSuperClass()) |