diff options
author | Sean Callanan <scallanan@apple.com> | 2012-01-19 18:23:06 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2012-01-19 18:23:06 +0000 |
commit | 2e93a2ad2148d19337bf5f9885e46e3c00e8ab82 (patch) | |
tree | a48a11e0dac5f1744a06186e79989152607cf62f /lldb/source | |
parent | 219e6bcb719e512662d4953747687f41d4875827 (diff) | |
download | bcm5719-llvm-2e93a2ad2148d19337bf5f9885e46e3c00e8ab82.tar.gz bcm5719-llvm-2e93a2ad2148d19337bf5f9885e46e3c00e8ab82.zip |
Fixed a problem where Objective-C classes that were
originally imported from symbols for the expression
parser didn't get their superclasses set properly.
llvm-svn: 148488
Diffstat (limited to 'lldb/source')
-rw-r--r-- | lldb/source/Symbol/ClangASTImporter.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/lldb/source/Symbol/ClangASTImporter.cpp b/lldb/source/Symbol/ClangASTImporter.cpp index 917827006b9..dc7f5688f5c 100644 --- a/lldb/source/Symbol/ClangASTImporter.cpp +++ b/lldb/source/Symbol/ClangASTImporter.cpp @@ -312,6 +312,44 @@ ClangASTImporter::Minion::ImportDefinitionTo (clang::Decl *to, clang::Decl *from ASTImporter::Imported(from, to); ImportDefinition(from); + + // If we're dealing with an Objective-C class, ensure that the inheritance has + // been set up correctly. The ASTImporter may not do this correctly if the + // class was originally sourced from symbols. + + if (ObjCInterfaceDecl *to_objc_interface = dyn_cast<ObjCInterfaceDecl>(to)) + { + do + { + ObjCInterfaceDecl *to_superclass = to_objc_interface->getSuperClass(); + + if (to_superclass) + break; // we're not going to override it if it's set + + ObjCInterfaceDecl *from_objc_interface = dyn_cast<ObjCInterfaceDecl>(from); + + if (!from_objc_interface) + break; + + ObjCInterfaceDecl *from_superclass = from_objc_interface->getSuperClass(); + + if (!from_superclass) + break; + + Decl *imported_from_superclass_decl = Import(from_superclass); + + if (!imported_from_superclass_decl) + break; + + ObjCInterfaceDecl *imported_from_superclass = dyn_cast<ObjCInterfaceDecl>(imported_from_superclass_decl); + + if (!imported_from_superclass) + break; + + to_objc_interface->setSuperClass(imported_from_superclass); + } + while (0); + } } clang::Decl |