From 7ced9fff95473c1794b51a3cfd099b4fea3d1a58 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Wed, 13 Jul 2022 20:11:37 -0700 Subject: [lldb] Refactor command option enum values (NFC) Refactor the command option enum values and the command argument table to connect the two. This has two benefits: - We guarantee that two options that use the same argument type have the same accepted values. - We can print the enum values and their description in the help output. (D129707) Differential revision: https://reviews.llvm.org/D129703 --- .../Commands/CommandObjectWatchpointCommand.cpp | 31 +--------------------- 1 file changed, 1 insertion(+), 30 deletions(-) (limited to 'lldb/source/Commands/CommandObjectWatchpointCommand.cpp') diff --git a/lldb/source/Commands/CommandObjectWatchpointCommand.cpp b/lldb/source/Commands/CommandObjectWatchpointCommand.cpp index 0cc8327..3264813 100644 --- a/lldb/source/Commands/CommandObjectWatchpointCommand.cpp +++ b/lldb/source/Commands/CommandObjectWatchpointCommand.cpp @@ -15,6 +15,7 @@ #include "lldb/Core/IOHandler.h" #include "lldb/Host/OptionParser.h" #include "lldb/Interpreter/CommandInterpreter.h" +#include "lldb/Interpreter/CommandOptionArgumentTable.h" #include "lldb/Interpreter/CommandReturnObject.h" #include "lldb/Interpreter/OptionArgParser.h" #include "lldb/Target/Target.h" @@ -22,36 +23,6 @@ using namespace lldb; using namespace lldb_private; -// FIXME: "script-type" needs to have its contents determined dynamically, so -// somebody can add a new scripting language to lldb and have it pickable here -// without having to change this enumeration by hand and rebuild lldb proper. -static constexpr OptionEnumValueElement g_script_option_enumeration[] = { - { - eScriptLanguageNone, - "command", - "Commands are in the lldb command interpreter language", - }, - { - eScriptLanguagePython, - "python", - "Commands are in the Python language.", - }, - { - eScriptLanguageLua, - "lua", - "Commands are in the Lua language.", - }, - { - eSortOrderByName, - "default-script", - "Commands are in the default scripting language.", - }, -}; - -static constexpr OptionEnumValues ScriptOptionEnum() { - return OptionEnumValues(g_script_option_enumeration); -} - #define LLDB_OPTIONS_watchpoint_command_add #include "CommandOptions.inc" -- cgit v1.1