From f1acd7829582fb9b6d59e4e6e06c0450a6e98e07 Mon Sep 17 00:00:00 2001 From: Xi Ge Date: Wed, 30 Sep 2020 10:37:24 -0700 Subject: [PATCH] Update lldb for ModuleInterfaceChecker --- .../Plugins/TypeSystem/Swift/SwiftASTContext.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp b/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp index b1b8eb31d4e22..f8e7ded814baa 100644 --- a/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp +++ b/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp @@ -3363,6 +3363,12 @@ swift::ASTContext *SwiftASTContext::GetASTContext() { m_ast_context_ap->addModuleLoader(std::move(memory_buffer_loader_ap)); } + // Add a module interface checker. + m_ast_context_ap->addModuleInterfaceChecker( + std::make_unique(*m_ast_context_ap, + moduleCachePath, prebuiltModuleCachePath, + swift::ModuleInterfaceLoaderOptions())); + // 2. Create and install the module interface loader. // // The ordering of 2-4 is the same as the Swift compiler's 1-3, @@ -3377,8 +3383,9 @@ swift::ASTContext *SwiftASTContext::GetASTContext() { if (loading_mode != swift::ModuleLoadingMode::OnlySerialized) { std::unique_ptr module_interface_loader_ap( swift::ModuleInterfaceLoader::create( - *m_ast_context_ap, moduleCachePath, prebuiltModuleCachePath, - m_dependency_tracker.get(), loading_mode)); + *m_ast_context_ap, *static_cast( + m_ast_context_ap->getModuleInterfaceChecker()), m_dependency_tracker.get(), + loading_mode)); if (module_interface_loader_ap) m_ast_context_ap->addModuleLoader(std::move(module_interface_loader_ap)); }