File tree Expand file tree Collapse file tree 4 files changed +19
-1
lines changed
Plugins/LanguageRuntime/Swift Expand file tree Collapse file tree 4 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -201,6 +201,8 @@ class TargetProperties : public Properties {
201
201
202
202
bool GetSwiftUseTasksPlugin () const ;
203
203
204
+ bool GetSwiftCacheTaskPtrLocation () const ;
205
+
204
206
Args GetSwiftPluginServerForPath () const ;
205
207
206
208
bool GetSwiftAutoImportFrameworks () const ;
Original file line number Diff line number Diff line change @@ -3006,7 +3006,8 @@ TaskInspector::GetTaskAddrFromThreadLocalStorage(Thread &thread) {
3006
3006
// If the read from this TLS address is successful, cache the TLS address.
3007
3007
// Caching without a valid read is dangerous: earlier in the thread
3008
3008
// lifetime, the result of GetExtendedInfo can be invalid.
3009
- if (task_addr)
3009
+ if (task_addr &&
3010
+ real_thread.GetProcess ()->GetTarget ().GetSwiftCacheTaskPtrLocation ())
3010
3011
m_tid_to_task_addr_location.try_emplace (real_thread.GetID (),
3011
3012
*task_addr_location);
3012
3013
return task_addr;
Original file line number Diff line number Diff line change @@ -4529,6 +4529,18 @@ bool TargetProperties::GetSwiftUseTasksPlugin() const {
4529
4529
return true ;
4530
4530
}
4531
4531
4532
+ bool TargetProperties::GetSwiftCacheTaskPtrLocation () const {
4533
+ const Property *exp_property =
4534
+ m_collection_sp->GetPropertyAtIndex (ePropertyExperimental);
4535
+ OptionValueProperties *exp_values =
4536
+ exp_property->GetValue ()->GetAsProperties ();
4537
+ if (exp_values)
4538
+ return exp_values
4539
+ ->GetPropertyAtIndexAs <bool >(ePropertySwiftCacheTaskPtrLocation)
4540
+ .value_or (true );
4541
+ return true ;
4542
+ }
4543
+
4532
4544
Args TargetProperties::GetSwiftPluginServerForPath () const {
4533
4545
const uint32_t idx = ePropertySwiftPluginServerForPath;
4534
4546
Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ let Definition = "target_experimental" in {
34
34
def SwiftUseTasksPlugin: Property<"swift-tasks-plugin-enabled", "Boolean">,
35
35
DefaultTrue,
36
36
Desc<"Enables the swift plugin converting tasks into threads">;
37
+ def SwiftCacheTaskPtrLocation: Property<"swift-cache-task-ptr-location", "Boolean">,
38
+ DefaultTrue,
39
+ Desc<"Enables caching of task pointers inside the swift tasks plugin">;
37
40
}
38
41
39
42
let Definition = "target" in {
You can’t perform that action at this time.
0 commit comments