@@ -1444,7 +1444,8 @@ SwiftLanguageRuntime::MetadataPromise::FulfillTypePromise(Status *error) {
1444
1444
if (m_compiler_type.hasValue ())
1445
1445
return m_compiler_type.getValue ();
1446
1446
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);
1448
1449
if (!swift_ast_ctx) {
1449
1450
error->SetErrorString (" couldn't get Swift scratch context" );
1450
1451
return CompilerType ();
@@ -1486,7 +1487,8 @@ SwiftLanguageRuntime::MetadataPromise::FulfillKindPromise(Status *error) {
1486
1487
if (m_metadata_kind.hasValue ())
1487
1488
return m_metadata_kind;
1488
1489
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);
1490
1492
if (!swift_ast_ctx) {
1491
1493
error->SetErrorString (" couldn't get Swift scratch context" );
1492
1494
return llvm::None;
@@ -1530,7 +1532,8 @@ bool SwiftLanguageRuntime::MetadataPromise::IsStaticallyDetermined() {
1530
1532
SwiftLanguageRuntime::MetadataPromiseSP
1531
1533
SwiftLanguageRuntime::GetMetadataPromise (lldb::addr_t addr,
1532
1534
ValueObject &for_object) {
1533
- auto swift_ast_ctx = for_object.GetScratchSwiftASTContext ();
1535
+ auto swift_ast_ctx =
1536
+ m_process->GetTarget ().GetScratchSwiftASTContext (for_object);
1534
1537
if (!swift_ast_ctx || swift_ast_ctx->HasFatalErrors ())
1535
1538
return nullptr ;
1536
1539
@@ -1619,7 +1622,7 @@ SwiftLanguageRuntime::GetMemberVariableOffset(CompilerType instance_type,
1619
1622
1620
1623
llvm::Optional<SwiftASTContextReader> scratch_ctx;
1621
1624
if (instance) {
1622
- scratch_ctx = instance-> GetScratchSwiftASTContext ();
1625
+ scratch_ctx = m_process-> GetTarget (). GetScratchSwiftASTContext (*instance );
1623
1626
if (!scratch_ctx)
1624
1627
return llvm::None;
1625
1628
}
@@ -2350,7 +2353,8 @@ bool SwiftLanguageRuntime::GetDynamicTypeAndAddress(
2350
2353
// use the scratch context where such operations are legal and safe.
2351
2354
assert (IsScratchContextLocked (in_value.GetTargetSP ()) &&
2352
2355
" 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);
2354
2358
if (!scratch_ctx)
2355
2359
return false ;
2356
2360
@@ -3748,7 +3752,8 @@ SwiftLanguageRuntime::GetBridgedSyntheticChildProvider(ValueObject &valobj) {
3748
3752
ProjectionSyntheticChildren::TypeProjectionUP type_projection (
3749
3753
new ProjectionSyntheticChildren::TypeProjectionUP::element_type ());
3750
3754
3751
- if (auto swift_ast_ctx = valobj.GetScratchSwiftASTContext ()) {
3755
+ if (auto swift_ast_ctx =
3756
+ m_process->GetTarget ().GetScratchSwiftASTContext (valobj)) {
3752
3757
Status error;
3753
3758
CompilerType swift_type =
3754
3759
swift_ast_ctx->GetTypeFromMangledTypename (type_name, error);
0 commit comments