[cfe-commits] r144393 - /cfe/trunk/lib/AST/ASTImporter.cpp

Sean Callanan scallanan at apple.com
Fri Nov 11 09:39:53 PST 2011


Author: spyffe
Date: Fri Nov 11 11:39:52 2011
New Revision: 144393

URL: http://llvm.org/viewvc/llvm-project?rev=144393&view=rev
Log:
When importing an ObjCInterfaceDecl, ensure that
superclass information is imported before validating
it.  This fixes spurious "incompatible superclasses"
errors in LLDB.

Modified:
    cfe/trunk/lib/AST/ASTImporter.cpp

Modified: cfe/trunk/lib/AST/ASTImporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTImporter.cpp?rev=144393&r1=144392&r2=144393&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTImporter.cpp (original)
+++ cfe/trunk/lib/AST/ASTImporter.cpp Fri Nov 11 11:39:52 2011
@@ -3220,6 +3220,17 @@
 
     // 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())





More information about the cfe-commits mailing list