return DeclFromParser<D>(dyn_cast<D>(parser_generic_decl.decl));
}
-static void
+static bool
FindObjCMethodDeclsWithOrigin (unsigned int current_id,
NameSearchContext &context,
ObjCInterfaceDecl *original_interface_decl,
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<ObjCMethodDecl>(*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<ObjCMethodDecl>(copied_decl);
if (!copied_method_decl)
- return;
+ return false;
lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
context.AddNamedDecl(copied_method_decl);
- return;
+ return true;
}
void
ObjCInterfaceDecl *original_interface_decl = dyn_cast<ObjCInterfaceDecl>(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;