From d65525d589959f29ec2575a3222fe79d91336bce Mon Sep 17 00:00:00 2001 From: Marc Rasi Date: Wed, 23 Oct 2019 13:16:08 -0700 Subject: [PATCH] move registrations out of SwiftREPL::CompleteCode --- lldb/source/Plugins/ExpressionParser/Swift/SwiftREPL.cpp | 4 ---- lldb/source/Symbol/SwiftASTContext.cpp | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/lldb/source/Plugins/ExpressionParser/Swift/SwiftREPL.cpp b/lldb/source/Plugins/ExpressionParser/Swift/SwiftREPL.cpp index f6634f2baebd225..ae2db25cfc6b7cc 100644 --- a/lldb/source/Plugins/ExpressionParser/Swift/SwiftREPL.cpp +++ b/lldb/source/Plugins/ExpressionParser/Swift/SwiftREPL.cpp @@ -553,10 +553,6 @@ int SwiftREPL::CompleteCode(const std::string ¤t_code, llvm::dyn_cast_or_null(&*type_system_or_err); if (target_swift_ast) m_swift_ast_sp.reset(new SwiftASTContext(*target_swift_ast)); - auto &ctx = *m_swift_ast_sp.get()->GetASTContext(); - swift::registerIDERequestFunctions(ctx.evaluator); - swift::registerTypeCheckerRequestFunctions(ctx.evaluator); - swift::createTypeChecker(ctx); } SwiftASTContext *swift_ast = m_swift_ast_sp.get(); diff --git a/lldb/source/Symbol/SwiftASTContext.cpp b/lldb/source/Symbol/SwiftASTContext.cpp index f4ceb3a3193c70a..b5b611a44f0cd4a 100644 --- a/lldb/source/Symbol/SwiftASTContext.cpp +++ b/lldb/source/Symbol/SwiftASTContext.cpp @@ -3467,6 +3467,7 @@ swift::ASTContext *SwiftASTContext::GetASTContext() { // Set up the required state for the evaluator in the TypeChecker. (void)swift::createTypeChecker(*m_ast_context_ap); + registerIDERequestFunctions(m_ast_context_ap->evaluator); registerParseRequestFunctions(m_ast_context_ap->evaluator); registerTypeCheckerRequestFunctions(m_ast_context_ap->evaluator);