@@ -8085,7 +8085,7 @@ static void GetNameFromModule(swift::ModuleDecl *module, std::string &result) {
8085
8085
8086
8086
static swift::ModuleDecl *LoadOneModule (const SourceModule &module ,
8087
8087
SwiftASTContext &swift_ast_context,
8088
- lldb::StackFrameWP &stack_frame_wp ,
8088
+ lldb::ProcessSP process_sp ,
8089
8089
Status &error) {
8090
8090
LLDB_SCOPED_TIMER ();
8091
8091
if (!module .path .size ())
@@ -8097,22 +8097,16 @@ static swift::ModuleDecl *LoadOneModule(const SourceModule &module,
8097
8097
LOG_PRINTF (GetLog (LLDBLog::Types | LLDBLog::Expressions),
8098
8098
" Importing module %s" , toplevel.AsCString ());
8099
8099
swift::ModuleDecl *swift_module = nullptr ;
8100
- lldb::StackFrameSP this_frame_sp (stack_frame_wp.lock ());
8101
-
8102
8100
auto *clangimporter = swift_ast_context.GetClangImporter ();
8103
8101
swift::ModuleDecl *imported_header_module =
8104
8102
clangimporter ? clangimporter->getImportedHeaderModule () : nullptr ;
8105
8103
if (imported_header_module &&
8106
8104
toplevel.GetStringRef () == imported_header_module->getName ().str ())
8107
8105
swift_module = imported_header_module;
8108
- else if (this_frame_sp) {
8109
- lldb::ProcessSP process_sp (this_frame_sp->CalculateProcess ());
8110
- if (process_sp)
8111
- swift_module =
8112
- swift_ast_context.FindAndLoadModule (module , *process_sp.get (), error);
8113
- else
8114
- swift_module = swift_ast_context.GetModule (module , error);
8115
- } else
8106
+ else if (process_sp)
8107
+ swift_module =
8108
+ swift_ast_context.FindAndLoadModule (module , *process_sp.get (), error);
8109
+ else
8116
8110
swift_module = swift_ast_context.GetModule (module , error);
8117
8111
8118
8112
if (swift_module && IsDWARFImported (*swift_module)) {
@@ -8157,12 +8151,12 @@ static swift::ModuleDecl *LoadOneModule(const SourceModule &module,
8157
8151
8158
8152
bool SwiftASTContext::GetImplicitImports (
8159
8153
SwiftASTContext &swift_ast_context, SymbolContext &sc,
8160
- ExecutionContextScope &exe_scope, lldb::StackFrameWP &stack_frame_wp ,
8154
+ ExecutionContextScope &exe_scope, lldb::ProcessSP process_sp ,
8161
8155
llvm::SmallVectorImpl<swift::AttributedImport<swift::ImportedModule>>
8162
8156
&modules,
8163
8157
Status &error) {
8164
8158
LLDB_SCOPED_TIMER ();
8165
- if (!swift_ast_context.GetCompileUnitImports (sc, stack_frame_wp , modules,
8159
+ if (!swift_ast_context.GetCompileUnitImports (sc, process_sp , modules,
8166
8160
error)) {
8167
8161
return false ;
8168
8162
}
@@ -8187,7 +8181,7 @@ bool SwiftASTContext::GetImplicitImports(
8187
8181
SourceModule module_info;
8188
8182
module_info.path .emplace_back (module_pair.first ());
8189
8183
auto *module =
8190
- LoadOneModule (module_info, swift_ast_context, stack_frame_wp , error);
8184
+ LoadOneModule (module_info, swift_ast_context, process_sp , error);
8191
8185
if (!module )
8192
8186
return false ;
8193
8187
@@ -8200,7 +8194,7 @@ bool SwiftASTContext::GetImplicitImports(
8200
8194
bool SwiftASTContext::CacheUserImports (SwiftASTContext &swift_ast_context,
8201
8195
SymbolContext &sc,
8202
8196
ExecutionContextScope &exe_scope,
8203
- lldb::StackFrameWP &stack_frame_wp ,
8197
+ lldb::ProcessSP process_sp ,
8204
8198
swift::SourceFile &source_file,
8205
8199
Status &error) {
8206
8200
llvm::SmallString<1 > m_description;
@@ -8221,8 +8215,7 @@ bool SwiftASTContext::CacheUserImports(SwiftASTContext &swift_ast_context,
8221
8215
LOG_PRINTF (GetLog (LLDBLog::Types | LLDBLog::Expressions),
8222
8216
" Performing auto import on found module: %s.\n " ,
8223
8217
module_name.c_str ());
8224
- if (!LoadOneModule (module_info, swift_ast_context, stack_frame_wp,
8225
- error))
8218
+ if (!LoadOneModule (module_info, swift_ast_context, process_sp, error))
8226
8219
return false ;
8227
8220
8228
8221
// How do we tell we are in REPL or playground mode?
@@ -8235,16 +8228,16 @@ bool SwiftASTContext::CacheUserImports(SwiftASTContext &swift_ast_context,
8235
8228
}
8236
8229
8237
8230
bool SwiftASTContext::GetCompileUnitImports (
8238
- SymbolContext &sc, lldb::StackFrameWP &stack_frame_wp ,
8231
+ SymbolContext &sc, ProcessSP process_sp ,
8239
8232
llvm::SmallVectorImpl<swift::AttributedImport<swift::ImportedModule>>
8240
8233
&modules,
8241
8234
Status &error) {
8242
- return GetCompileUnitImportsImpl (sc, stack_frame_wp , &modules, error);
8235
+ return GetCompileUnitImportsImpl (sc, process_sp , &modules, error);
8243
8236
}
8244
8237
8245
8238
void SwiftASTContext::PerformCompileUnitImports (
8246
- SymbolContext &sc, lldb::StackFrameWP &stack_frame_wp , Status &error) {
8247
- GetCompileUnitImportsImpl (sc, stack_frame_wp , nullptr , error);
8239
+ SymbolContext &sc, lldb::ProcessSP process_sp , Status &error) {
8240
+ GetCompileUnitImportsImpl (sc, process_sp , nullptr , error);
8248
8241
}
8249
8242
8250
8243
static std::pair<Module *, lldb::user_id_t >
@@ -8253,7 +8246,7 @@ GetCUSignature(CompileUnit &compile_unit) {
8253
8246
}
8254
8247
8255
8248
bool SwiftASTContext::GetCompileUnitImportsImpl (
8256
- SymbolContext &sc, lldb::StackFrameWP &stack_frame_wp ,
8249
+ SymbolContext &sc, lldb::ProcessSP process_sp ,
8257
8250
llvm::SmallVectorImpl<swift::AttributedImport<swift::ImportedModule>>
8258
8251
*modules,
8259
8252
Status &error) {
@@ -8277,7 +8270,7 @@ bool SwiftASTContext::GetCompileUnitImportsImpl(
8277
8270
SourceModule swift_module;
8278
8271
swift_module.path .emplace_back (" Swift" );
8279
8272
auto *stdlib =
8280
- LoadOneModule (swift_module, *this , stack_frame_wp , error);
8273
+ LoadOneModule (swift_module, *this , process_sp , error);
8281
8274
if (!stdlib)
8282
8275
return false ;
8283
8276
@@ -8298,7 +8291,7 @@ bool SwiftASTContext::GetCompileUnitImportsImpl(
8298
8291
continue ;
8299
8292
8300
8293
auto *loaded_module =
8301
- LoadOneModule (module , *this , stack_frame_wp , error);
8294
+ LoadOneModule (module , *this , process_sp , error);
8302
8295
if (!loaded_module)
8303
8296
return false ;
8304
8297
0 commit comments