Skip to content

Commit 6b2dab4

Browse files
authored
Merge pull request #1473 from hamishknight/a-series-of-tubes-rebranch
[master-rebranch] Update for swiftlang/swift#32914
2 parents 4f6547f + 1f24133 commit 6b2dab4

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lldb/source/Plugins/ExpressionParser/Swift/SwiftExpressionParser.cpp

+9-3
Original file line numberDiff line numberDiff line change
@@ -1662,12 +1662,18 @@ unsigned SwiftExpressionParser::Parse(DiagnosticManager &diagnostic_manager,
16621662
std::lock_guard<std::recursive_mutex> global_context_locker(
16631663
IRExecutionUnit::GetLLVMGlobalContextMutex());
16641664

1665+
const auto &IRGenOpts = swift_ast_ctx->GetIRGenOptions();
1666+
16651667
auto GenModule = swift::performIRGeneration(
1666-
&parsed_expr->module, swift_ast_ctx->GetIRGenOptions(),
1667-
swift_ast_ctx->GetTBDGenOptions(), std::move(sil_module), "lldb_module",
1668+
&parsed_expr->module, IRGenOpts, swift_ast_ctx->GetTBDGenOptions(),
1669+
std::move(sil_module), "lldb_module",
16681670
swift::PrimarySpecificPaths("", parsed_expr->main_filename),
16691671
llvm::ArrayRef<std::string>());
1670-
1672+
1673+
if (GenModule) {
1674+
swift::performLLVMOptimizations(IRGenOpts, GenModule.getModule(),
1675+
GenModule.getTargetMachine());
1676+
}
16711677
auto ContextAndModule = std::move(GenModule).release();
16721678
m_llvm_context.reset(ContextAndModule.first);
16731679
m_module.reset(ContextAndModule.second);

0 commit comments

Comments
 (0)