summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/ModuleList.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/Core/ModuleList.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/Core/ModuleList.cpp')
-rw-r--r--lldb/source/Core/ModuleList.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp
index 38eb29aa0de..b8de86f4ead 100644
--- a/lldb/source/Core/ModuleList.cpp
+++ b/lldb/source/Core/ModuleList.cpp
@@ -542,7 +542,7 @@ ModuleSP ModuleList::FindModule(const UUID &uuid) const {
}
size_t
-ModuleList::FindTypes(const SymbolContext &sc, const ConstString &name,
+ModuleList::FindTypes(Module *search_first, const ConstString &name,
bool name_is_fully_qualified, size_t max_matches,
llvm::DenseSet<SymbolFile *> &searched_symbol_files,
TypeList &types) const {
@@ -550,14 +550,12 @@ ModuleList::FindTypes(const SymbolContext &sc, const ConstString &name,
size_t total_matches = 0;
collection::const_iterator pos, end = m_modules.end();
- if (sc.module_sp) {
- // The symbol context "sc" contains a module so we want to search that one
- // first if it is in our list...
+ if (search_first) {
for (pos = m_modules.begin(); pos != end; ++pos) {
- if (sc.module_sp.get() == (*pos).get()) {
+ if (search_first == pos->get()) {
total_matches +=
- (*pos)->FindTypes(sc, name, name_is_fully_qualified, max_matches,
- searched_symbol_files, types);
+ search_first->FindTypes(name, name_is_fully_qualified, max_matches,
+ searched_symbol_files, types);
if (total_matches >= max_matches)
break;
@@ -566,15 +564,14 @@ ModuleList::FindTypes(const SymbolContext &sc, const ConstString &name,
}
if (total_matches < max_matches) {
- SymbolContext world_sc;
for (pos = m_modules.begin(); pos != end; ++pos) {
// Search the module if the module is not equal to the one in the symbol
// context "sc". If "sc" contains a empty module shared pointer, then the
// comparison will always be true (valid_module_ptr != nullptr).
- if (sc.module_sp.get() != (*pos).get())
+ if (search_first != pos->get())
total_matches +=
- (*pos)->FindTypes(world_sc, name, name_is_fully_qualified,
- max_matches, searched_symbol_files, types);
+ (*pos)->FindTypes(name, name_is_fully_qualified, max_matches,
+ searched_symbol_files, types);
if (total_matches >= max_matches)
break;
OpenPOWER on IntegriCloud