From 576495e67b3c7d3d2f98e7af312cb03e8f63f1cd Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Mon, 14 Jan 2019 22:41:21 +0000 Subject: [SymbolFile] Remove SymbolContext parameter from FindTypes. This parameter was only ever used with the Module set, and since a SymbolFile is tied to a module, the parameter turns out to be entirely unnecessary. Furthermore, it doesn't make a lot of sense to ask a caller to ask SymbolFile which is tied to Module X to find types for Module Y, but that possibility was open with the previous interface. By removing this parameter from the API, it makes it harder to use incorrectly as well as easier for an implementor to understand what it needs to do. llvm-svn: 351133 --- lldb/source/Commands/CommandObjectTarget.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'lldb/source/Commands/CommandObjectTarget.cpp') diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index 4a4d0d2d609..ee55b22c5ea 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -1672,12 +1672,11 @@ static size_t LookupTypeInModule(CommandInterpreter &interpreter, Stream &strm, const uint32_t max_num_matches = UINT32_MAX; size_t num_matches = 0; bool name_is_fully_qualified = false; - SymbolContext sc; ConstString name(name_cstr); llvm::DenseSet searched_symbol_files; num_matches = - module->FindTypes(sc, name, name_is_fully_qualified, max_num_matches, + module->FindTypes(name, name_is_fully_qualified, max_num_matches, searched_symbol_files, type_list); if (num_matches) { @@ -1715,11 +1714,8 @@ static size_t LookupTypeInModule(CommandInterpreter &interpreter, Stream &strm, } static size_t LookupTypeHere(CommandInterpreter &interpreter, Stream &strm, - const SymbolContext &sym_ctx, - const char *name_cstr, bool name_is_regex) { - if (!sym_ctx.module_sp) - return 0; - + Module &module, const char *name_cstr, + bool name_is_regex) { TypeList type_list; const uint32_t max_num_matches = UINT32_MAX; size_t num_matches = 1; @@ -1727,14 +1723,13 @@ static size_t LookupTypeHere(CommandInterpreter &interpreter, Stream &strm, ConstString name(name_cstr); llvm::DenseSet searched_symbol_files; - num_matches = sym_ctx.module_sp->FindTypes( - sym_ctx, name, name_is_fully_qualified, max_num_matches, - searched_symbol_files, type_list); + num_matches = module.FindTypes(name, name_is_fully_qualified, max_num_matches, + searched_symbol_files, type_list); if (num_matches) { strm.Indent(); strm.PutCString("Best match found in "); - DumpFullpath(strm, &sym_ctx.module_sp->GetFileSpec(), 0); + DumpFullpath(strm, &module.GetFileSpec(), 0); strm.PutCString(":\n"); TypeSP type_sp(type_list.GetTypeAtIndex(0)); @@ -3832,8 +3827,9 @@ public: return false; case eLookupTypeType: if (!m_options.m_str.empty()) { - if (LookupTypeHere(m_interpreter, result.GetOutputStream(), sym_ctx, - m_options.m_str.c_str(), m_options.m_use_regex)) { + if (LookupTypeHere(m_interpreter, result.GetOutputStream(), + *sym_ctx.module_sp, m_options.m_str.c_str(), + m_options.m_use_regex)) { result.SetStatus(eReturnStatusSuccessFinishResult); return true; } -- cgit v1.2.3