Skip to content

Commit 6993be3

Browse files
committed
[lldb] Adapt --bind-generic-types to upstream changes
1 parent aec6289 commit 6993be3

File tree

4 files changed

+26
-19
lines changed

4 files changed

+26
-19
lines changed

lldb/include/lldb/Interpreter/CommandOptionArgumentTable.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,25 @@ static constexpr OptionEnumValueElement g_running_mode[] = {
149149
"Run only this thread while stepping"},
150150
};
151151

152+
153+
// BEGIN SWIFT
154+
static constexpr OptionEnumValueElement g_bind_gen_type_params[] = {
155+
{
156+
lldb::eBindAuto,
157+
"auto",
158+
"Attempt to run the expression with bound generic parameters first, "
159+
"fallback to unbound generic parameters if binding the type parameters "
160+
"fails",
161+
},
162+
{lldb::eBind, "true", "Bind generic type parameters."},
163+
{lldb::eDontBind, "false", "Don't bind generic type parameters."},
164+
};
165+
166+
static constexpr OptionEnumValues BindGenTypeParamValue() {
167+
return OptionEnumValues(g_bind_gen_type_params);
168+
}
169+
// END SWIFT
170+
152171
llvm::StringRef RegisterNameHelpTextCallback();
153172
llvm::StringRef BreakpointIDHelpTextCallback();
154173
llvm::StringRef BreakpointIDRangeHelpTextCallback();
@@ -257,6 +276,9 @@ static constexpr CommandObject::ArgumentTableEntry g_argument_table[] = {
257276
{ lldb::eArgTypeConnectURL, "process-connect-url", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "A URL-style specification for a remote connection." },
258277
{ lldb::eArgTypeTargetID, "target-id", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "The index ID for an lldb Target." },
259278
{ lldb::eArgTypeStopHookID, "stop-hook-id", CommandCompletions::eNoCompletion, {}, { nullptr, false }, "The ID you receive when you create a stop-hook." },
279+
// BEGIN SWIFT
280+
{ lldb::eArgTypeBindGenTypeParamValue, "bind-generic-types", CommandCompletions::eNoCompletion, g_bind_gen_type_params, { nullptr, false }, "Controls whether any generic types in the current context should be bound to their dynamic type before evaluating. Defaults to auto." },
281+
// END SWIFT
260282
// clang-format on
261283
};
262284

lldb/include/lldb/lldb-enumerations.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,9 @@ enum CommandArgumentType {
622622
eArgTypeConnectURL,
623623
eArgTypeTargetID,
624624
eArgTypeStopHookID,
625+
// BEGIN SWIFT
626+
eArgTypeBindGenTypeParamValue,
627+
// END SWIFT
625628
eArgTypeLastArg // Always keep this entry as the last entry in this
626629
// enumeration!!
627630
};

lldb/source/Commands/CommandObjectExpression.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,6 @@
1919

2020
namespace lldb_private {
2121

22-
// BEGIN SWIFT
23-
static constexpr OptionEnumValueElement g_bind_gen_type_params[] = {
24-
{
25-
lldb::eBindAuto,
26-
"auto",
27-
"Attempt to run the expression with bound generic parameters first, "
28-
"fallback to unbound generic parameters if binding the type parameters "
29-
"fails",
30-
},
31-
{lldb::eBind, "true", "Bind generic type parameters."},
32-
{lldb::eDontBind, "false", "Don't bind generic type parameters."},
33-
};
34-
35-
static constexpr OptionEnumValues BindGenTypeParamValue() {
36-
return OptionEnumValues(g_bind_gen_type_params);
37-
}
38-
// END SWIFT
39-
4022
class CommandObjectExpression : public CommandObjectRaw,
4123
public IOHandlerDelegate {
4224
public:

lldb/source/Commands/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ let Command = "expression" in {
389389
"not supported by the interpreter (defaults to true).">;
390390
// BEGIN SWIFT
391391
def bind_generic_types : Option<"bind-generic-types", "\\x01">,
392-
EnumArg<"Value", "BindGenTypeParamValue()">, Desc<"Controls whether any "
392+
EnumArg<"BindGenTypeParamValue">, Desc<"Controls whether any "
393393
"generic types in the current context should be bound to their dynamic "
394394
"type before evaluating. Defaults to auto.">;
395395
// END SWIFT

0 commit comments

Comments
 (0)