@@ -2162,9 +2162,7 @@ SwiftASTContext::CreateInstance(lldb::LanguageType language, Module &module,
2162
2162
auto on_exit = llvm::make_scope_exit ([&]() {
2163
2163
swift_ast_sp->m_ast_context_ap ->SetPreModuleImportCallback (
2164
2164
[](llvm::StringRef module_name,
2165
- swift::ASTContext::ModuleImportKind kind) {
2166
- Progress (" Importing Swift modules" );
2167
- });
2165
+ swift::ASTContext::ModuleImportKind kind) {});
2168
2166
});
2169
2167
2170
2168
swift::ModuleDecl *stdlib =
@@ -2718,9 +2716,7 @@ lldb::TypeSystemSP SwiftASTContext::CreateInstance(
2718
2716
auto on_exit = llvm::make_scope_exit ([&]() {
2719
2717
swift_ast_sp->m_ast_context_ap ->SetPreModuleImportCallback (
2720
2718
[](llvm::StringRef module_name,
2721
- swift::ASTContext::ModuleImportKind kind) {
2722
- Progress (" Importing Swift modules" );
2723
- });
2719
+ swift::ASTContext::ModuleImportKind kind) {});
2724
2720
});
2725
2721
2726
2722
swift::ModuleDecl *stdlib =
@@ -3850,20 +3846,22 @@ swift::ModuleDecl *SwiftASTContext::GetModule(const SourceModule &module,
3850
3846
3851
3847
// Report progress on module importing by using a callback function in
3852
3848
// swift::ASTContext.
3853
- Progress progress ( " Importing Swift modules " ) ;
3849
+ std::unique_ptr< Progress> progress;
3854
3850
ast->SetPreModuleImportCallback (
3855
3851
[&progress](llvm::StringRef module_name,
3856
3852
swift::ASTContext::ModuleImportKind kind) {
3853
+ if (!progress)
3854
+ progress = std::make_unique<Progress>(" Importing Swift modules" );
3857
3855
switch (kind) {
3858
3856
case swift::ASTContext::Module:
3859
- progress. Increment (1 , module_name.str ());
3857
+ progress-> Increment (1 , module_name.str ());
3860
3858
break ;
3861
3859
case swift::ASTContext::Overlay:
3862
- progress. Increment (1 , module_name.str () + " (overlay)" );
3860
+ progress-> Increment (1 , module_name.str () + " (overlay)" );
3863
3861
break ;
3864
3862
case swift::ASTContext::BridgingHeader:
3865
- progress. Increment (1 ,
3866
- " Compiling bridging header: " + module_name.str ());
3863
+ progress-> Increment (1 , " Compiling bridging header: " +
3864
+ module_name.str ());
3867
3865
break ;
3868
3866
}
3869
3867
});
@@ -3873,9 +3871,7 @@ swift::ModuleDecl *SwiftASTContext::GetModule(const SourceModule &module,
3873
3871
auto on_exit = llvm::make_scope_exit ([&]() {
3874
3872
ast->SetPreModuleImportCallback (
3875
3873
[](llvm::StringRef module_name,
3876
- swift::ASTContext::ModuleImportKind kind) {
3877
- Progress (" Importing Swift modules" );
3878
- });
3874
+ swift::ASTContext::ModuleImportKind kind) {});
3879
3875
});
3880
3876
3881
3877
// Perform the import.
0 commit comments