Fixed a problem where the expression parser was
erroneously completing Objective-C classes sourced
from the Objective-C runtime without checking if
there was an authoritative version in the debug
information.
<rdar://problem/16065049>
llvm-svn: 203600
diff --git a/lldb/source/Expression/ClangASTSource.cpp b/lldb/source/Expression/ClangASTSource.cpp
index 853d102..4c25114 100644
--- a/lldb/source/Expression/ClangASTSource.cpp
+++ b/lldb/source/Expression/ClangASTSource.cpp
@@ -316,6 +316,22 @@
dumper.ToLog(log, " [COID] ");
}
+ Decl *original_decl = NULL;
+ ASTContext *original_ctx = NULL;
+
+ if (m_ast_importer->ResolveDeclOrigin(interface_decl, &original_decl, &original_ctx))
+ {
+ if (ObjCInterfaceDecl *original_iface_decl = dyn_cast<ObjCInterfaceDecl>(original_decl))
+ {
+ ObjCInterfaceDecl *complete_iface_decl = GetCompleteObjCInterface(original_iface_decl);
+
+ if (complete_iface_decl && (complete_iface_decl != original_iface_decl))
+ {
+ m_ast_importer->SetDeclOrigin(interface_decl, original_iface_decl);
+ }
+ }
+ }
+
m_ast_importer->CompleteObjCInterfaceDecl (interface_decl);
if (interface_decl->getSuperClass() &&