summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectTarget.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2019-01-14 22:41:21 +0000
committerZachary Turner <zturner@google.com>2019-01-14 22:41:21 +0000
commit576495e67b3c7d3d2f98e7af312cb03e8f63f1cd (patch)
treed460cc909087c236c8dd77857296b903580f8505 /lldb/source/Commands/CommandObjectTarget.cpp
parentc0a246afbe03b8f1d52e06267e9c2a5f2c4521ff (diff)
downloadbcm5719-llvm-576495e67b3c7d3d2f98e7af312cb03e8f63f1cd.tar.gz
bcm5719-llvm-576495e67b3c7d3d2f98e7af312cb03e8f63f1cd.zip
[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
Diffstat (limited to 'lldb/source/Commands/CommandObjectTarget.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectTarget.cpp22
1 files changed, 9 insertions, 13 deletions
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<lldb_private::SymbolFile *> 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<SymbolFile *> 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;
}
OpenPOWER on IntegriCloud