summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2011-11-11 17:39:52 +0000
committerSean Callanan <scallanan@apple.com>2011-11-11 17:39:52 +0000
commit45e1328f3f180ec0d066d65672961ac5887da8df (patch)
treeb6457962d8652d3ce26fc138284bdad5f4726aed /clang/lib
parentc391f7ff64e14b3241c4c09191ed7c579b8d192e (diff)
downloadbcm5719-llvm-45e1328f3f180ec0d066d65672961ac5887da8df.tar.gz
bcm5719-llvm-45e1328f3f180ec0d066d65672961ac5887da8df.zip
When importing an ObjCInterfaceDecl, ensure that
superclass information is imported before validating it. This fixes spurious "incompatible superclasses" errors in LLDB. llvm-svn: 144393
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/ASTImporter.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp
index e03b154e642..f7a55a1474f 100644
--- a/clang/lib/AST/ASTImporter.cpp
+++ b/clang/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())
OpenPOWER on IntegriCloud