@@ -2060,16 +2060,19 @@ SwiftASTContext::CreateInstance(lldb::LanguageType language, Module &module,
2060
2060
// swift::ASTContext
2061
2061
Progress progress (" Importing Swift standard library" );
2062
2062
swift_ast_sp->m_ast_context_ap ->SetPreModuleImportCallback (
2063
- [&progress](llvm::StringRef module_name, bool is_overlay) {
2064
- progress.Increment (1 , (is_overlay ? module_name.str () + " (overlay)"
2065
- : module_name.str ()));
2063
+ [&progress](llvm::StringRef module_name,
2064
+ swift::ASTContext::ModuleImportKind kind) {
2065
+ progress.Increment (1 , (kind == swift::ASTContext::Overlay
2066
+ ? module_name.str () + " (overlay)"
2067
+ : module_name.str ()));
2066
2068
});
2067
2069
2068
2070
// Clear the callback function on scope exit to prevent an out-of-scope
2069
2071
// access of the progress local variable
2070
2072
auto on_exit = llvm::make_scope_exit ([&]() {
2071
2073
swift_ast_sp->m_ast_context_ap ->SetPreModuleImportCallback (
2072
- [](llvm::StringRef module_name, bool is_overlay) {
2074
+ [](llvm::StringRef module_name,
2075
+ swift::ASTContext::ModuleImportKind kind) {
2073
2076
Progress (" Importing Swift modules" );
2074
2077
});
2075
2078
});
@@ -2569,19 +2572,22 @@ lldb::TypeSystemSP SwiftASTContext::CreateInstance(
2569
2572
const bool can_create = true ;
2570
2573
2571
2574
// Report progress on module importing by using a callback function in
2572
- // swift::ASTContext
2575
+ // swift::ASTContext.
2573
2576
Progress progress (" Importing Swift standard library" );
2574
2577
swift_ast_sp->m_ast_context_ap ->SetPreModuleImportCallback (
2575
- [&progress](llvm::StringRef module_name, bool is_overlay) {
2576
- progress.Increment (1 , (is_overlay ? module_name.str () + " (overlay)"
2577
- : module_name.str ()));
2578
+ [&progress](llvm::StringRef module_name,
2579
+ swift::ASTContext::ModuleImportKind kind) {
2580
+ progress.Increment (1 , (kind == swift::ASTContext::Overlay
2581
+ ? module_name.str () + " (overlay)"
2582
+ : module_name.str ()));
2578
2583
});
2579
2584
2580
2585
// Clear the callback function on scope exit to prevent an out-of-scope
2581
- // access of the progress local variable
2586
+ // access of the progress local variable.
2582
2587
auto on_exit = llvm::make_scope_exit ([&]() {
2583
2588
swift_ast_sp->m_ast_context_ap ->SetPreModuleImportCallback (
2584
- [](llvm::StringRef module_name, bool is_overlay) {
2589
+ [](llvm::StringRef module_name,
2590
+ swift::ASTContext::ModuleImportKind kind) {
2585
2591
Progress (" Importing Swift modules" );
2586
2592
});
2587
2593
});
@@ -3627,19 +3633,31 @@ swift::ModuleDecl *SwiftASTContext::GetModule(const SourceModule &module,
3627
3633
auto import_diags = getScopedDiagnosticConsumer ();
3628
3634
3629
3635
// Report progress on module importing by using a callback function in
3630
- // swift::ASTContext
3636
+ // swift::ASTContext.
3631
3637
Progress progress (" Importing Swift modules" );
3632
- ast->SetPreModuleImportCallback ([&progress](llvm::StringRef module_name,
3633
- bool is_overlay) {
3634
- progress.Increment (
3635
- 1 , (is_overlay ? module_name.str () + " (overlay)" : module_name.str ()));
3636
- });
3638
+ ast->SetPreModuleImportCallback (
3639
+ [&progress](llvm::StringRef module_name,
3640
+ swift::ASTContext::ModuleImportKind kind) {
3641
+ switch (kind) {
3642
+ case swift::ASTContext::Module:
3643
+ progress.Increment (1 , module_name.str ());
3644
+ break ;
3645
+ case swift::ASTContext::Overlay:
3646
+ progress.Increment (1 , module_name.str () + " (overlay)" );
3647
+ break ;
3648
+ case swift::ASTContext::BridgingHeader:
3649
+ progress.Increment (1 ,
3650
+ " Compiling bridging header: " + module_name.str ());
3651
+ break ;
3652
+ }
3653
+ });
3637
3654
3638
3655
// Clear the callback function on scope exit to prevent an out-of-scope access
3639
3656
// of the progress local variable
3640
3657
auto on_exit = llvm::make_scope_exit ([&]() {
3641
3658
ast->SetPreModuleImportCallback (
3642
- [](llvm::StringRef module_name, bool is_overlay) {
3659
+ [](llvm::StringRef module_name,
3660
+ swift::ASTContext::ModuleImportKind kind) {
3643
3661
Progress (" Importing Swift modules" );
3644
3662
});
3645
3663
});
0 commit comments