From 24fdbb1695a83c52fa8364d73f8740d0aff3016c Mon Sep 17 00:00:00 2001 From: Rintaro Ishizaki Date: Thu, 20 Apr 2023 20:29:13 -0700 Subject: [PATCH] [lldb] Update for 'PluginLoader' ASTContext requires 'setPluginLoader()' for loading plugins. (cherry picked from commit 8699bdda4bcfb2ea4128e2c56c0a1dc0211bf10f) --- lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp b/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp index 3af5f6f08790f..b78ce45eac117 100644 --- a/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp +++ b/lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp @@ -15,6 +15,7 @@ #include "swift/AST/ASTContext.h" #include "swift/AST/ASTDemangler.h" #include "swift/AST/ASTMangler.h" +#include "swift/AST/ASTWalker.h" #include "swift/AST/DebuggerClient.h" #include "swift/AST/Decl.h" #include "swift/AST/DiagnosticEngine.h" @@ -27,11 +28,11 @@ #include "swift/AST/ModuleLoader.h" #include "swift/AST/NameLookup.h" #include "swift/AST/OperatorNameLookup.h" +#include "swift/AST/PluginLoader.h" #include "swift/AST/SearchPathOptions.h" #include "swift/AST/SubstitutionMap.h" #include "swift/AST/Type.h" #include "swift/AST/Types.h" -#include "swift/AST/ASTWalker.h" #include "swift/ASTSectionImporter/ASTSectionImporter.h" #include "swift/Basic/DiagnosticOptions.h" #include "swift/Basic/Dwarf.h" @@ -3084,6 +3085,10 @@ swift::ASTContext *SwiftASTContext::GetASTContext() { m_clangimporter->getClangASTContext()); } + // Set up the plugin loader. + m_ast_context_ap->setPluginLoader(std::make_unique( + *m_ast_context_ap, m_dependency_tracker.get())); + // Set up the required state for the evaluator in the TypeChecker. registerIDERequestFunctions(m_ast_context_ap->evaluator); registerParseRequestFunctions(m_ast_context_ap->evaluator);