@@ -1444,7 +1444,8 @@ SwiftLanguageRuntime::MetadataPromise::FulfillTypePromise(Status *error) {
14441444 if (m_compiler_type.hasValue ())
14451445 return m_compiler_type.getValue ();
14461446
1447- auto swift_ast_ctx = m_for_object_sp->GetScratchSwiftASTContext ();
1447+ TargetSP target_sp = m_for_object_sp->GetTargetSP ();
1448+ auto swift_ast_ctx = target_sp->GetScratchSwiftASTContext (*m_for_object_sp);
14481449 if (!swift_ast_ctx) {
14491450 error->SetErrorString (" couldn't get Swift scratch context" );
14501451 return CompilerType ();
@@ -1486,7 +1487,8 @@ SwiftLanguageRuntime::MetadataPromise::FulfillKindPromise(Status *error) {
14861487 if (m_metadata_kind.hasValue ())
14871488 return m_metadata_kind;
14881489
1489- auto swift_ast_ctx = m_for_object_sp->GetScratchSwiftASTContext ();
1490+ TargetSP target_sp = m_for_object_sp->GetTargetSP ();
1491+ auto swift_ast_ctx = target_sp->GetScratchSwiftASTContext (*m_for_object_sp);
14901492 if (!swift_ast_ctx) {
14911493 error->SetErrorString (" couldn't get Swift scratch context" );
14921494 return llvm::None;
@@ -1530,7 +1532,8 @@ bool SwiftLanguageRuntime::MetadataPromise::IsStaticallyDetermined() {
15301532SwiftLanguageRuntime::MetadataPromiseSP
15311533SwiftLanguageRuntime::GetMetadataPromise (lldb::addr_t addr,
15321534 ValueObject &for_object) {
1533- auto swift_ast_ctx = for_object.GetScratchSwiftASTContext ();
1535+ auto swift_ast_ctx =
1536+ m_process->GetTarget ().GetScratchSwiftASTContext (for_object);
15341537 if (!swift_ast_ctx || swift_ast_ctx->HasFatalErrors ())
15351538 return nullptr ;
15361539
@@ -1619,7 +1622,7 @@ SwiftLanguageRuntime::GetMemberVariableOffset(CompilerType instance_type,
16191622
16201623 llvm::Optional<SwiftASTContextReader> scratch_ctx;
16211624 if (instance) {
1622- scratch_ctx = instance-> GetScratchSwiftASTContext ();
1625+ scratch_ctx = m_process-> GetTarget (). GetScratchSwiftASTContext (*instance );
16231626 if (!scratch_ctx)
16241627 return llvm::None;
16251628 }
@@ -2350,7 +2353,8 @@ bool SwiftLanguageRuntime::GetDynamicTypeAndAddress(
23502353 // use the scratch context where such operations are legal and safe.
23512354 assert (IsScratchContextLocked (in_value.GetTargetSP ()) &&
23522355 " Swift scratch context not locked ahead of dynamic type resolution" );
2353- auto scratch_ctx = in_value.GetScratchSwiftASTContext ();
2356+ auto scratch_ctx =
2357+ m_process->GetTarget ().GetScratchSwiftASTContext (in_value);
23542358 if (!scratch_ctx)
23552359 return false ;
23562360
@@ -3748,7 +3752,8 @@ SwiftLanguageRuntime::GetBridgedSyntheticChildProvider(ValueObject &valobj) {
37483752 ProjectionSyntheticChildren::TypeProjectionUP type_projection (
37493753 new ProjectionSyntheticChildren::TypeProjectionUP::element_type ());
37503754
3751- if (auto swift_ast_ctx = valobj.GetScratchSwiftASTContext ()) {
3755+ if (auto swift_ast_ctx =
3756+ m_process->GetTarget ().GetScratchSwiftASTContext (valobj)) {
37523757 Status error;
37533758 CompilerType swift_type =
37543759 swift_ast_ctx->GetTypeFromMangledTypename (type_name, error);
0 commit comments