From: Sean Callanan Date: Wed, 28 Nov 2012 03:23:20 +0000 (+0000) Subject: If Clang is looking for an Objective-C method on X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c83e3410752adb01ec6672f819d4cd0c2e30d8cc;p=platform%2Fupstream%2Fllvm.git If Clang is looking for an Objective-C method on a type, and we find it in the origin for that type, don't look anywhere else; just report it. llvm-svn: 168766 --- diff --git a/lldb/source/Expression/ClangASTSource.cpp b/lldb/source/Expression/ClangASTSource.cpp index 67fdace8..81400ff 100644 --- a/lldb/source/Expression/ClangASTSource.cpp +++ b/lldb/source/Expression/ClangASTSource.cpp @@ -750,7 +750,7 @@ DeclFromUser::Import(ClangASTImporter *importer, ASTContext &dest_ctx) return DeclFromParser(dyn_cast(parser_generic_decl.decl)); } -static void +static bool FindObjCMethodDeclsWithOrigin (unsigned int current_id, NameSearchContext &context, ObjCInterfaceDecl *original_interface_decl, @@ -798,25 +798,25 @@ FindObjCMethodDeclsWithOrigin (unsigned int current_id, ObjCInterfaceDecl::lookup_result result = original_interface_decl->lookup(original_decl_name); if (result.first == result.second) - return; + return false; if (!*result.first) - return; + return false; ObjCMethodDecl *result_method = dyn_cast(*result.first); if (!result_method) - return; + return false; Decl *copied_decl = ast_importer->CopyDecl(ast_context, &result_method->getASTContext(), result_method); if (!copied_decl) - return; + return false; ObjCMethodDecl *copied_method_decl = dyn_cast(copied_decl); if (!copied_method_decl) - return; + return false; lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS)); @@ -828,7 +828,7 @@ FindObjCMethodDeclsWithOrigin (unsigned int current_id, context.AddNamedDecl(copied_method_decl); - return; + return true; } void @@ -859,12 +859,13 @@ ClangASTSource::FindObjCMethodDecls (NameSearchContext &context) ObjCInterfaceDecl *original_interface_decl = dyn_cast(original_decl); - FindObjCMethodDeclsWithOrigin(current_id, - context, - original_interface_decl, - m_ast_context, - m_ast_importer, - "at origin"); + if (FindObjCMethodDeclsWithOrigin(current_id, + context, + original_interface_decl, + m_ast_context, + m_ast_importer, + "at origin")) + return; // found it, no need to look any further } while (0); StreamString ss;