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 {
201201
202202 bool GetSwiftUseTasksPlugin () const ;
203203
204+ bool GetSwiftCacheTaskPointerLocation () const ;
205+
204206 Args GetSwiftPluginServerForPath () const ;
205207
206208 bool GetSwiftAutoImportFrameworks () const ;
Original file line number Diff line number Diff line change @@ -3017,7 +3017,8 @@ TaskInspector::GetTaskAddrFromThreadLocalStorage(Thread &thread) {
30173017 // If the read from this TLS address is successful, cache the TLS address.
30183018 // Caching without a valid read is dangerous: earlier in the thread
30193019 // lifetime, the result of GetExtendedInfo can be invalid.
3020- if (task_addr)
3020+ if (task_addr &&
3021+ real_thread.GetProcess ()->GetTarget ().GetSwiftCacheTaskPointerLocation ())
30213022 m_tid_to_task_addr_location.try_emplace (real_thread.GetID (),
30223023 *task_addr_location);
30233024 return task_addr;
Original file line number Diff line number Diff line change @@ -4529,6 +4529,18 @@ bool TargetProperties::GetSwiftUseTasksPlugin() const {
45294529 return true ;
45304530}
45314531
4532+ bool TargetProperties::GetSwiftCacheTaskPointerLocation () 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 >(ePropertySwiftCacheTaskPointerLocation)
4540+ .value_or (true );
4541+ return true ;
4542+ }
4543+
45324544Args TargetProperties::GetSwiftPluginServerForPath () const {
45334545 const uint32_t idx = ePropertySwiftPluginServerForPath;
45344546
Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ let Definition = "target_experimental" in {
3434 def SwiftUseTasksPlugin: Property<"swift-tasks-plugin-enabled", "Boolean">,
3535 DefaultTrue,
3636 Desc<"Enables the swift plugin converting tasks into threads">;
37+ def SwiftCacheTaskPointerLocation: Property<"swift-cache-task-pointer-location", "Boolean">,
38+ DefaultTrue,
39+ Desc<"Enables caching of task pointers inside the swift tasks plugin">;
3740}
3841
3942let Definition = "target" in {
You can’t perform that action at this time.
0 commit comments