Skip to content
This repository was archived by the owner on Apr 2, 2020. It is now read-only.

Commit

Permalink
Fix compile errors caused by merging stable into upstream-with-swift.
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-prantl committed Aug 22, 2019
1 parent 38cebbf commit 09da188
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
3 changes: 3 additions & 0 deletions include/lldb/Core/Module.h
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,9 @@ class Module : public std::enable_shared_from_this<Module>,
llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
TypeList &types);

size_t FindTypes(llvm::ArrayRef<CompilerContext> pattern, bool append,
TypeMap &types);

lldb::TypeSP FindFirstType(const SymbolContext &sc,
ConstString type_name, bool exact_match);

Expand Down
10 changes: 10 additions & 0 deletions source/Core/Module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,16 @@ size_t Module::FindTypes(
return num_matches;
}

size_t Module::FindTypes(llvm::ArrayRef<CompilerContext> pattern, bool append,
TypeMap &types) {
static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
if (SymbolFile *symbols = GetSymbolFile())
return symbols->FindTypes(pattern, append, types);
return 0;

}

SymbolFile *Module::GetSymbolFile(bool can_create, Stream *feedback_strm) {
if (!m_did_load_symfile.load()) {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
Expand Down
7 changes: 2 additions & 5 deletions source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2542,11 +2542,8 @@ size_t SymbolFileDWARF::FindTypes(llvm::ArrayRef<CompilerContext> pattern,
UpdateExternalModuleListIfNeeded();

for (const auto &pair : m_external_type_modules)
if (ModuleSP external_module_sp = pair.second) {
SymbolVendor *sym_vendor = external_module_sp->GetSymbolVendor();
if (sym_vendor)
num_matches += sym_vendor->FindTypes(pattern, true, types);
}
if (ModuleSP external_module_sp = pair.second)
num_matches += external_module_sp->FindTypes(pattern, true, types);
return num_matches;
}

Expand Down
5 changes: 3 additions & 2 deletions source/Symbol/SwiftASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/SourceModule.h"
#include "lldb/Symbol/SymbolFile.h"
#include "lldb/Symbol/TypeMap.h"
#include "lldb/Symbol/VariableList.h"
#include "lldb/Target/Platform.h"
#include "lldb/Target/Process.h"
Expand Down Expand Up @@ -3250,7 +3251,7 @@ class SwiftDWARFImporterDelegate : public swift::DWARFImporterDelegate {
// Swift doesn't keep track of submodules.
decl_context.push_back({CompilerContextKind::AnyModule, ConstString()});
decl_context.push_back({GetCompilerContextKind(kind), ConstString(name)});
module->GetSymbolVendor()->FindTypes(decl_context, true, clang_types);
module->FindTypes(decl_context, true, clang_types);

clang::FileSystemOptions file_system_options;
clang::FileManager file_manager(file_system_options);
Expand Down Expand Up @@ -3282,7 +3283,7 @@ class SwiftDWARFImporterDelegate : public swift::DWARFImporterDelegate {
importer.Import(ClangUtil::GetQualType(compiler_type)));
if (!clang_type) {
llvm::consumeError(clang_type.takeError());
continue;
return true;
}

// Retrieve the imported type's Decl.
Expand Down

0 comments on commit 09da188

Please sign in to comment.