Skip to content

Commit 62b2f52

Browse files
[lldb] Add experimental target option controlling swift OS plugin
This is here mostly out of an abundance of caution, the default is to use the plugins.
1 parent 766ba98 commit 62b2f52

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

lldb/include/lldb/Target/Target.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ class TargetProperties : public Properties {
199199

200200
AutoBool GetSwiftPCMValidation() const;
201201

202+
bool GetSwiftUseTasksPlugin() const;
203+
202204
Args GetSwiftPluginServerForPath() const;
203205

204206
bool GetSwiftAutoImportFrameworks() const;

lldb/source/Target/Target.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4496,6 +4496,17 @@ AutoBool TargetProperties::GetSwiftPCMValidation() const {
44964496
return AutoBool::Auto;
44974497
}
44984498

4499+
bool TargetProperties::GetSwiftUseTasksPlugin() const {
4500+
const Property *exp_property =
4501+
m_collection_sp->GetPropertyAtIndex(ePropertyExperimental);
4502+
OptionValueProperties *exp_values =
4503+
exp_property->GetValue()->GetAsProperties();
4504+
if (exp_values)
4505+
return exp_values->GetPropertyAtIndexAs<bool>(ePropertySwiftUseTasksPlugin)
4506+
.value_or(true);
4507+
return true;
4508+
}
4509+
44994510
Args TargetProperties::GetSwiftPluginServerForPath() const {
45004511
const uint32_t idx = ePropertySwiftPluginServerForPath;
45014512

lldb/source/Target/TargetProperties.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ let Definition = "target_experimental" in {
3131
DefaultEnumValue<"llvm::to_underlying(AutoBool::Auto)">,
3232
EnumValues<"OptionEnumValues(g_swift_pcm_validation_values)">,
3333
Desc<"Enable validation when loading Clang PCM files (-fvalidate-pch, -fmodules-check-relocated).">;
34+
def SwiftUseTasksPlugin: Property<"swift-tasks-plugin-enabled", "Boolean">,
35+
DefaultTrue,
36+
Desc<"Enables the swift plugin converting tasks into threads">;
3437
}
3538

3639
let Definition = "target" in {

0 commit comments

Comments
 (0)