Skip to content

Split DWARFImporterDelegate into two parts. NFC #7722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lldb/source/Plugins/TypeSystem/Swift/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
add_lldb_library(lldbPluginTypeSystemSwift PLUGIN
DWARFImporterDelegate.cpp
SwiftDWARFImporterForClangTypes.cpp
TypeSystemSwift.cpp
TypeSystemSwiftTypeRef.cpp
SwiftASTContext.cpp
Expand Down
287 changes: 0 additions & 287 deletions lldb/source/Plugins/TypeSystem/Swift/DWARFImporterDelegate.cpp

This file was deleted.

8 changes: 5 additions & 3 deletions lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//===----------------------------------------------------------------------===//

#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
#include "Plugins/TypeSystem/Swift/SwiftDWARFImporterForClangTypes.h"
#include "Plugins/TypeSystem/Swift/StoringDiagnosticConsumer.h"
#include "Plugins/ExpressionParser/Swift/SwiftPersistentExpressionState.h"

Expand Down Expand Up @@ -2939,12 +2940,13 @@ swift::ASTContext *SwiftASTContext::GetASTContext() {
if (!clang_importer_options.OverrideResourceDir.empty()) {
// Create the DWARFImporterDelegate.
const auto &props = ModuleList::GetGlobalModuleListProperties();
swift::DWARFImporterDelegate *delegate = nullptr;
if (props.GetUseSwiftDWARFImporter())
delegate = &m_typeref_typesystem->GetDWARFImporterDelegate();
m_dwarfimporter_delegate_up =
std::make_unique<SwiftDWARFImporterDelegate>(*this);
auto importer_diags = getScopedDiagnosticConsumer();
clang_importer_ap = swift::ClangImporter::create(
*m_ast_context_ap, "", m_dependency_tracker.get(), delegate);
*m_ast_context_ap, "", m_dependency_tracker.get(),
m_dwarfimporter_delegate_up.get());

// Handle any errors.
if (!clang_importer_ap || importer_diags->HasErrors()) {
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ namespace lldb_private {
struct SourceModule;
class SwiftASTContext;
class ClangExternalASTSourceCallbacks;

CompilerType ToCompilerType(swift::Type qual_type);

namespace detail {
Expand Down Expand Up @@ -904,6 +903,7 @@ class SwiftASTContext : public TypeSystemSwift {
swift::ClangImporter *m_clangimporter = nullptr;
/// Wraps the clang::ASTContext owned by ClangImporter.
std::shared_ptr<TypeSystemClang> m_clangimporter_typesystem;
std::unique_ptr<swift::DWARFImporterDelegate> m_dwarfimporter_delegate_up;
SwiftModuleMap m_swift_module_cache;
SwiftTypeFromMangledNameMap m_mangled_name_to_type_map;
SwiftMangledNameFromTypeMap m_type_to_mangled_name_map;
Expand Down
Loading