File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -1409,16 +1409,18 @@ TypeSystemSwiftTypeRefForExpressions::TypeSystemSwiftTypeRefForExpressions(
1409
1409
}
1410
1410
}
1411
1411
1412
- void TypeSystemSwiftTypeRefForExpressions::PerformCompileUnitImports (
1412
+ Status TypeSystemSwiftTypeRefForExpressions::PerformCompileUnitImports (
1413
1413
SymbolContext &sc) {
1414
- Status error ;
1414
+ Status status ;
1415
1415
lldb::ProcessSP process_sp;
1416
1416
if (auto target_sp = sc.target_sp )
1417
1417
process_sp = target_sp->GetProcessSP ();
1418
1418
if (!m_swift_ast_context_initialized)
1419
+ // Stash sc, the import will happen lazily when SwiftASTContext is created.
1419
1420
m_initial_symbol_context = std::make_unique<SymbolContext>(sc);
1420
1421
else if (auto *swift_ast_ctx = GetSwiftASTContext ())
1421
- swift_ast_ctx->PerformCompileUnitImports (sc, process_sp, error);
1422
+ swift_ast_ctx->PerformCompileUnitImports (sc, process_sp, status);
1423
+ return status;
1422
1424
}
1423
1425
1424
1426
UserExpression *TypeSystemSwiftTypeRefForExpressions::GetUserExpression (
Original file line number Diff line number Diff line change @@ -481,7 +481,7 @@ class TypeSystemSwiftTypeRefForExpressions : public TypeSystemSwiftTypeRef {
481
481
482
482
// / Forwards to SwiftASTContext.
483
483
PersistentExpressionState *GetPersistentExpressionState () override ;
484
- void PerformCompileUnitImports (SymbolContext &sc);
484
+ Status PerformCompileUnitImports (SymbolContext &sc);
485
485
486
486
friend class SwiftASTContextForExpressions ;
487
487
protected:
Original file line number Diff line number Diff line change @@ -2798,7 +2798,9 @@ llvm::Optional<SwiftScratchContextReader> Target::GetSwiftScratchContext(
2798
2798
if (frame_sp && frame_sp.get () && swift_scratch_ctx) {
2799
2799
SymbolContext sc =
2800
2800
frame_sp->GetSymbolContext (lldb::eSymbolContextEverything);
2801
- swift_scratch_ctx->PerformCompileUnitImports (sc);
2801
+ Status status = swift_scratch_ctx->PerformCompileUnitImports (sc);
2802
+ if (status.Fail ())
2803
+ Debugger::ReportError (status.AsCString (), GetDebugger ().GetID ());
2802
2804
}
2803
2805
2804
2806
if (!swift_scratch_ctx)
You can’t perform that action at this time.
0 commit comments