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 --- lldb/source/Commands/CommandObjectCommands.cpp | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'lldb/source/Commands/CommandObjectCommands.cpp') diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index 39c7207..97a8833 100644 --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -13,6 +13,7 @@ #include "lldb/Core/IOHandler.h" #include "lldb/Interpreter/CommandHistory.h" #include "lldb/Interpreter/CommandInterpreter.h" +#include "lldb/Interpreter/CommandOptionArgumentTable.h" #include "lldb/Interpreter/CommandReturnObject.h" #include "lldb/Interpreter/OptionArgParser.h" #include "lldb/Interpreter/OptionValueBoolean.h" @@ -1354,29 +1355,6 @@ protected: CommandOptions m_options; }; -// CommandObjectCommandsScriptAdd -static constexpr OptionEnumValueElement g_script_synchro_type[] = { - { - eScriptedCommandSynchronicitySynchronous, - "synchronous", - "Run synchronous", - }, - { - eScriptedCommandSynchronicityAsynchronous, - "asynchronous", - "Run asynchronous", - }, - { - eScriptedCommandSynchronicityCurrentValue, - "current", - "Do not alter current setting", - }, -}; - -static constexpr OptionEnumValues ScriptSynchroType() { - return OptionEnumValues(g_script_synchro_type); -} - #define LLDB_OPTIONS_script_add #include "CommandOptions.inc" -- cgit v1.1