Index: lldb/source/Commands/CommandObjectBreakpoint.cpp =================================================================== --- lldb/source/Commands/CommandObjectBreakpoint.cpp +++ lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -44,10 +44,9 @@ // Modifiable Breakpoint Options #pragma mark Modify::CommandOptions -static constexpr OptionDefinition g_breakpoint_modify_options[] = { #define LLDB_OPTIONS_breakpoint_modify #include "CommandOptions.inc" -}; + class lldb_private::BreakpointOptionGroup : public OptionGroup { public: @@ -181,10 +180,9 @@ BreakpointOptions m_bp_opts; }; -static constexpr OptionDefinition g_breakpoint_dummy_options[] = { + #define LLDB_OPTIONS_breakpoint_dummy #include "CommandOptions.inc" -}; class BreakpointDummyOptionGroup : public OptionGroup { @@ -224,10 +222,8 @@ }; -static constexpr OptionDefinition g_breakpoint_set_options[] = { #define LLDB_OPTIONS_breakpoint_set #include "CommandOptions.inc" -}; // CommandObjectBreakpointSet @@ -1154,10 +1150,8 @@ // CommandObjectBreakpointList #pragma mark List::CommandOptions -static constexpr OptionDefinition g_breakpoint_list_options[] = { #define LLDB_OPTIONS_breakpoint_list #include "CommandOptions.inc" -}; #pragma mark List @@ -1311,10 +1305,8 @@ // CommandObjectBreakpointClear #pragma mark Clear::CommandOptions -static constexpr OptionDefinition g_breakpoint_clear_options[] = { #define LLDB_OPTIONS_breakpoint_clear #include "CommandOptions.inc" -}; #pragma mark Clear @@ -1462,10 +1454,8 @@ }; // CommandObjectBreakpointDelete -static constexpr OptionDefinition g_breakpoint_delete_options[] = { #define LLDB_OPTIONS_breakpoint_delete #include "CommandOptions.inc" -}; #pragma mark Delete @@ -1614,11 +1604,9 @@ }; // CommandObjectBreakpointName - -static constexpr OptionDefinition g_breakpoint_name_options[] = { #define LLDB_OPTIONS_breakpoint_name #include "CommandOptions.inc" -}; + class BreakpointNameOptionGroup : public OptionGroup { public: BreakpointNameOptionGroup() @@ -1680,10 +1668,8 @@ OptionValueString m_help_string; }; -static constexpr OptionDefinition g_breakpoint_access_options[] = { #define LLDB_OPTIONS_breakpoint_access #include "CommandOptions.inc" -}; class BreakpointAccessOptionGroup : public OptionGroup { public: @@ -2142,10 +2128,8 @@ // CommandObjectBreakpointRead #pragma mark Read::CommandOptions -static constexpr OptionDefinition g_breakpoint_read_options[] = { #define LLDB_OPTIONS_breakpoint_read #include "CommandOptions.inc" -}; #pragma mark Read @@ -2269,10 +2253,8 @@ // CommandObjectBreakpointWrite #pragma mark Write::CommandOptions -static constexpr OptionDefinition g_breakpoint_write_options[] = { #define LLDB_OPTIONS_breakpoint_write #include "CommandOptions.inc" -}; #pragma mark Write class CommandObjectBreakpointWrite : public CommandObjectParsed { Index: lldb/source/Commands/CommandObjectBreakpointCommand.cpp =================================================================== --- lldb/source/Commands/CommandObjectBreakpointCommand.cpp +++ lldb/source/Commands/CommandObjectBreakpointCommand.cpp @@ -44,10 +44,8 @@ return OptionEnumValues(g_script_option_enumeration); } -static constexpr OptionDefinition g_breakpoint_add_options[] = { #define LLDB_OPTIONS_breakpoint_command_add #include "CommandOptions.inc" -}; class CommandObjectBreakpointCommandAdd : public CommandObjectParsed, public IOHandlerDelegateMultiline { @@ -286,7 +284,8 @@ case 's': m_script_language = (lldb::ScriptLanguage)OptionArgParser::ToOptionEnum( - option_arg, g_breakpoint_add_options[option_idx].enum_values, + option_arg, + g_breakpoint_command_add_options[option_idx].enum_values, eScriptLanguageNone, error); if (m_script_language == eScriptLanguagePython || @@ -336,7 +335,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_breakpoint_add_options); + return llvm::makeArrayRef(g_breakpoint_command_add_options); } // Instance variables to hold the values for command options. @@ -464,10 +463,8 @@ // CommandObjectBreakpointCommandDelete -static constexpr OptionDefinition g_breakpoint_delete_options[] = { #define LLDB_OPTIONS_breakpoint_command_delete #include "CommandOptions.inc" -}; class CommandObjectBreakpointCommandDelete : public CommandObjectParsed { public: @@ -525,7 +522,7 @@ } llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_breakpoint_delete_options); + return llvm::makeArrayRef(g_breakpoint_command_delete_options); } // Instance variables to hold the values for command options. Index: lldb/source/Commands/CommandObjectCommands.cpp =================================================================== --- lldb/source/Commands/CommandObjectCommands.cpp +++ lldb/source/Commands/CommandObjectCommands.cpp @@ -31,10 +31,8 @@ // CommandObjectCommandsSource -static constexpr OptionDefinition g_history_options[] = { #define LLDB_OPTIONS_history #include "CommandOptions.inc" -}; class CommandObjectCommandsHistory : public CommandObjectParsed { public: @@ -184,10 +182,8 @@ // CommandObjectCommandsSource -static constexpr OptionDefinition g_source_options[] = { #define LLDB_OPTIONS_source #include "CommandOptions.inc" -}; class CommandObjectCommandsSource : public CommandObjectParsed { public: @@ -336,10 +332,8 @@ #pragma mark CommandObjectCommandsAlias // CommandObjectCommandsAlias -static constexpr OptionDefinition g_alias_options[] = { #define LLDB_OPTIONS_alias #include "CommandOptions.inc" -}; static const char *g_python_command_instructions = "Enter your Python command(s). Type 'DONE' to end.\n" @@ -902,10 +896,8 @@ // CommandObjectCommandsAddRegex -static constexpr OptionDefinition g_regex_options[] = { #define LLDB_OPTIONS_regex #include "CommandOptions.inc" -}; #pragma mark CommandObjectCommandsAddRegex @@ -1374,11 +1366,8 @@ }; // CommandObjectCommandsScriptImport - -static constexpr OptionDefinition g_script_import_options[] = { #define LLDB_OPTIONS_script_import #include "CommandOptions.inc" -}; class CommandObjectCommandsScriptImport : public CommandObjectParsed { public: @@ -1508,10 +1497,8 @@ return OptionEnumValues(g_script_synchro_type); } -static constexpr OptionDefinition g_script_add_options[] = { #define LLDB_OPTIONS_script_add #include "CommandOptions.inc" -}; class CommandObjectCommandsScriptAdd : public CommandObjectParsed, public IOHandlerDelegateMultiline { Index: lldb/source/Commands/CommandObjectDisassemble.cpp =================================================================== --- lldb/source/Commands/CommandObjectDisassemble.cpp +++ lldb/source/Commands/CommandObjectDisassemble.cpp @@ -30,10 +30,8 @@ using namespace lldb; using namespace lldb_private; -static constexpr OptionDefinition g_disassemble_options[] = { #define LLDB_OPTIONS_disassemble #include "CommandOptions.inc" -}; CommandObjectDisassemble::CommandOptions::CommandOptions() : Options(), num_lines_context(0), num_instructions(0), func_name(), Index: lldb/source/Commands/CommandObjectExpression.cpp =================================================================== --- lldb/source/Commands/CommandObjectExpression.cpp +++ lldb/source/Commands/CommandObjectExpression.cpp @@ -47,10 +47,8 @@ return OptionEnumValues(g_description_verbosity_type); } -static constexpr OptionDefinition g_expression_options[] = { #define LLDB_OPTIONS_expression #include "CommandOptions.inc" -}; Status CommandObjectExpression::CommandOptions::SetOptionValue( uint32_t option_idx, llvm::StringRef option_arg, Index: lldb/source/Commands/CommandObjectFrame.cpp =================================================================== --- lldb/source/Commands/CommandObjectFrame.cpp +++ lldb/source/Commands/CommandObjectFrame.cpp @@ -53,10 +53,8 @@ // CommandObjectFrameDiagnose -static constexpr OptionDefinition g_frame_diag_options[] = { #define LLDB_OPTIONS_frame_diag #include "CommandOptions.inc" -}; class CommandObjectFrameDiagnose : public CommandObjectParsed { public: @@ -234,10 +232,8 @@ // CommandObjectFrameSelect -static OptionDefinition g_frame_select_options[] = { #define LLDB_OPTIONS_frame_select #include "CommandOptions.inc" -}; class CommandObjectFrameSelect : public CommandObjectParsed { public: @@ -739,10 +735,8 @@ #pragma mark CommandObjectFrameRecognizer -static OptionDefinition g_frame_recognizer_add_options[] = { #define LLDB_OPTIONS_frame_recognizer_add #include "CommandOptions.inc" -}; class CommandObjectFrameRecognizerAdd : public CommandObjectParsed { private: Index: lldb/source/Commands/CommandObjectHelp.cpp =================================================================== --- lldb/source/Commands/CommandObjectHelp.cpp +++ lldb/source/Commands/CommandObjectHelp.cpp @@ -65,10 +65,8 @@ CommandObjectHelp::~CommandObjectHelp() = default; -static constexpr OptionDefinition g_help_options[] = { #define LLDB_OPTIONS_help #include "CommandOptions.inc" -}; llvm::ArrayRef CommandObjectHelp::CommandOptions::GetDefinitions() { Index: lldb/source/Commands/CommandObjectLog.cpp =================================================================== --- lldb/source/Commands/CommandObjectLog.cpp +++ lldb/source/Commands/CommandObjectLog.cpp @@ -31,10 +31,8 @@ using namespace lldb; using namespace lldb_private; -static constexpr OptionDefinition g_log_options[] = { #define LLDB_OPTIONS_log #include "CommandOptions.inc" -}; class CommandObjectLogEnable : public CommandObjectParsed { public: Index: lldb/source/Commands/CommandObjectMemory.cpp =================================================================== --- lldb/source/Commands/CommandObjectMemory.cpp +++ lldb/source/Commands/CommandObjectMemory.cpp @@ -46,10 +46,8 @@ using namespace lldb; using namespace lldb_private; -static constexpr OptionDefinition g_read_memory_options[] = { #define LLDB_OPTIONS_memory_read #include "CommandOptions.inc" -}; class OptionGroupReadMemory : public OptionGroup { public: @@ -60,13 +58,13 @@ ~OptionGroupReadMemory() override = default; llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_read_memory_options); + return llvm::makeArrayRef(g_memory_read_options); } Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override { Status error; - const int short_option = g_read_memory_options[option_idx].short_option; + const int short_option = g_memory_read_options[option_idx].short_option; switch (short_option) { case 'l': @@ -896,10 +894,8 @@ CompilerType m_prev_compiler_type; }; -static constexpr OptionDefinition g_memory_find_option_table[] = { #define LLDB_OPTIONS_memory_find #include "CommandOptions.inc" -}; // Find the specified data in memory class CommandObjectMemoryFind : public CommandObjectParsed { @@ -911,14 +907,13 @@ ~OptionGroupFindMemory() override = default; llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_memory_find_option_table); + return llvm::makeArrayRef(g_memory_find_options); } Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override { Status error; - const int short_option = - g_memory_find_option_table[option_idx].short_option; + const int short_option = g_memory_find_options[option_idx].short_option; switch (short_option) { case 'e': @@ -1189,10 +1184,8 @@ OptionGroupFindMemory m_memory_options; }; -static constexpr OptionDefinition g_memory_write_option_table[] = { #define LLDB_OPTIONS_memory_write #include "CommandOptions.inc" -}; // Write memory to the inferior process class CommandObjectMemoryWrite : public CommandObjectParsed { @@ -1204,14 +1197,13 @@ ~OptionGroupWriteMemory() override = default; llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_memory_write_option_table); + return llvm::makeArrayRef(g_memory_write_options); } Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override { Status error; - const int short_option = - g_memory_write_option_table[option_idx].short_option; + const int short_option = g_memory_write_options[option_idx].short_option; switch (short_option) { case 'i': Index: lldb/source/Commands/CommandObjectPlatform.cpp =================================================================== --- lldb/source/Commands/CommandObjectPlatform.cpp +++ lldb/source/Commands/CommandObjectPlatform.cpp @@ -58,10 +58,8 @@ return user | group | world; } -static constexpr OptionDefinition g_permissions_options[] = { #define LLDB_OPTIONS_permissions #include "CommandOptions.inc" -}; class OptionPermissions : public OptionGroup { public: @@ -574,10 +572,8 @@ // "platform fread" -static constexpr OptionDefinition g_platform_fread_options[] = { #define LLDB_OPTIONS_platform_fread #include "CommandOptions.inc" -}; class CommandObjectPlatformFRead : public CommandObjectParsed { public: @@ -665,10 +661,8 @@ // "platform fwrite" -static constexpr OptionDefinition g_platform_fwrite_options[] = { #define LLDB_OPTIONS_platform_fwrite #include "CommandOptions.inc" -}; class CommandObjectPlatformFWrite : public CommandObjectParsed { public: @@ -1042,10 +1036,8 @@ // "platform process list" static PosixPlatformCommandOptionValidator posix_validator; -static constexpr OptionDefinition g_platform_process_list_options[] = { #define LLDB_OPTIONS_platform_process_list #include "CommandOptions.inc" -}; class CommandObjectPlatformProcessList : public CommandObjectParsed { public: @@ -1391,10 +1383,8 @@ } }; -static constexpr OptionDefinition g_platform_process_attach_options[] = { #define LLDB_OPTIONS_platform_process_attach #include "CommandOptions.inc" -}; class CommandObjectPlatformProcessAttach : public CommandObjectParsed { public: @@ -1566,10 +1556,8 @@ }; // "platform shell" -static constexpr OptionDefinition g_platform_shell_options[] = { #define LLDB_OPTIONS_platform_shell #include "CommandOptions.inc" -}; class CommandObjectPlatformShell : public CommandObjectRaw { public: Index: lldb/source/Commands/CommandObjectProcess.cpp =================================================================== --- lldb/source/Commands/CommandObjectProcess.cpp +++ lldb/source/Commands/CommandObjectProcess.cpp @@ -255,10 +255,8 @@ ProcessLaunchCommandOptions m_options; }; -static constexpr OptionDefinition g_process_attach_options[] = { #define LLDB_OPTIONS_process_attach #include "CommandOptions.inc" -}; #pragma mark CommandObjectProcessAttach class CommandObjectProcessAttach : public CommandObjectProcessLaunchOrAttach { @@ -499,10 +497,8 @@ // CommandObjectProcessContinue -static constexpr OptionDefinition g_process_continue_options[] = { #define LLDB_OPTIONS_process_continue #include "CommandOptions.inc" -}; #pragma mark CommandObjectProcessContinue @@ -659,10 +655,8 @@ }; // CommandObjectProcessDetach -static constexpr OptionDefinition g_process_detach_options[] = { #define LLDB_OPTIONS_process_detach #include "CommandOptions.inc" -}; #pragma mark CommandObjectProcessDetach @@ -754,11 +748,8 @@ }; // CommandObjectProcessConnect - -static constexpr OptionDefinition g_process_connect_options[] = { #define LLDB_OPTIONS_process_connect #include "CommandOptions.inc" -}; #pragma mark CommandObjectProcessConnect @@ -878,11 +869,8 @@ }; // CommandObjectProcessLoad - -static constexpr OptionDefinition g_process_load_options[] = { #define LLDB_OPTIONS_process_load #include "CommandOptions.inc" -}; #pragma mark CommandObjectProcessLoad @@ -1261,11 +1249,8 @@ }; // CommandObjectProcessHandle - -static constexpr OptionDefinition g_process_handle_options[] = { #define LLDB_OPTIONS_process_handle #include "CommandOptions.inc" -}; #pragma mark CommandObjectProcessHandle Index: lldb/source/Commands/CommandObjectRegister.cpp =================================================================== --- lldb/source/Commands/CommandObjectRegister.cpp +++ lldb/source/Commands/CommandObjectRegister.cpp @@ -32,11 +32,8 @@ using namespace lldb_private; // "register read" - -static constexpr OptionDefinition g_register_read_options[] = { #define LLDB_OPTIONS_register_read #include "CommandOptions.inc" -}; class CommandObjectRegisterRead : public CommandObjectParsed { public: Index: lldb/source/Commands/CommandObjectSettings.cpp =================================================================== --- lldb/source/Commands/CommandObjectSettings.cpp +++ lldb/source/Commands/CommandObjectSettings.cpp @@ -20,11 +20,8 @@ using namespace lldb_private; // CommandObjectSettingsSet - -static constexpr OptionDefinition g_settings_set_options[] = { #define LLDB_OPTIONS_settings_set #include "CommandOptions.inc" -}; class CommandObjectSettingsSet : public CommandObjectRaw { public: @@ -309,11 +306,8 @@ }; // CommandObjectSettingsWrite -- Write settings to file - -static constexpr OptionDefinition g_settings_write_options[] = { #define LLDB_OPTIONS_settings_write #include "CommandOptions.inc" -}; class CommandObjectSettingsWrite : public CommandObjectParsed { public: @@ -432,11 +426,8 @@ }; // CommandObjectSettingsRead -- Read settings from file - -static constexpr OptionDefinition g_settings_read_options[] = { #define LLDB_OPTIONS_settings_read #include "CommandOptions.inc" -}; class CommandObjectSettingsRead : public CommandObjectParsed { public: Index: lldb/source/Commands/CommandObjectSource.cpp =================================================================== --- lldb/source/Commands/CommandObjectSource.cpp +++ lldb/source/Commands/CommandObjectSource.cpp @@ -33,11 +33,8 @@ #pragma mark CommandObjectSourceInfo // CommandObjectSourceInfo - debug line entries dumping command - -static constexpr OptionDefinition g_source_info_options[] = { #define LLDB_OPTIONS_source_info #include "CommandOptions.inc" -}; class CommandObjectSourceInfo : public CommandObjectParsed { class CommandOptions : public Options { @@ -636,11 +633,8 @@ #pragma mark CommandObjectSourceList // CommandObjectSourceList - -static constexpr OptionDefinition g_source_list_options[] = { #define LLDB_OPTIONS_source_list #include "CommandOptions.inc" -}; class CommandObjectSourceList : public CommandObjectParsed { class CommandOptions : public Options { Index: lldb/source/Commands/CommandObjectTarget.cpp =================================================================== --- lldb/source/Commands/CommandObjectTarget.cpp +++ lldb/source/Commands/CommandObjectTarget.cpp @@ -144,10 +144,8 @@ {eLoadDependentsYes, "false", "Load dependents, even if the target is not an executable."}}; -static constexpr OptionDefinition g_dependents_options[] = { #define LLDB_OPTIONS_target_dependents #include "CommandOptions.inc" -}; class OptionGroupDependents : public OptionGroup { public: @@ -156,7 +154,7 @@ ~OptionGroupDependents() override {} llvm::ArrayRef GetDefinitions() override { - return llvm::makeArrayRef(g_dependents_options); + return llvm::makeArrayRef(g_target_dependents_options); } Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, @@ -169,11 +167,13 @@ return error; } - const char short_option = g_dependents_options[option_idx].short_option; + const char short_option = + g_target_dependents_options[option_idx].short_option; if (short_option == 'd') { LoadDependentFiles tmp_load_dependents; tmp_load_dependents = (LoadDependentFiles)OptionArgParser::ToOptionEnum( - option_value, g_dependents_options[option_idx].enum_values, 0, error); + option_value, g_target_dependents_options[option_idx].enum_values, 0, + error); if (error.Success()) m_load_dependent_files = tmp_load_dependents; } else { @@ -1964,10 +1964,8 @@ {eSortOrderByAddress, "address", "Sort output by symbol address."}, {eSortOrderByName, "name", "Sort output by symbol name."} }; -static constexpr OptionDefinition g_target_modules_dump_symtab_options[] = { #define LLDB_OPTIONS_target_modules_dump_symtab #include "CommandOptions.inc" -}; class CommandObjectTargetModulesDumpSymtab : public CommandObjectTargetModulesModuleAutoComplete { @@ -2364,6 +2362,8 @@ }; #pragma mark CommandObjectTargetModulesDumpLineTable +#define LLDB_OPTIONS_target_modules_dump +#include "CommandOptions.inc" // Image debug line table dumping command @@ -2452,11 +2452,7 @@ } llvm::ArrayRef GetDefinitions() override { - static constexpr OptionDefinition g_options[] = { -#define LLDB_OPTIONS_target_modules_dump -#include "CommandOptions.inc" - }; - return llvm::makeArrayRef(g_options); + return llvm::makeArrayRef(g_target_modules_dump_options); } bool m_verbose; @@ -2958,11 +2954,8 @@ }; // List images with associated information - -static constexpr OptionDefinition g_target_modules_list_options[] = { #define LLDB_OPTIONS_target_modules_list #include "CommandOptions.inc" -}; class CommandObjectTargetModulesList : public CommandObjectParsed { public: @@ -3307,11 +3300,8 @@ #pragma mark CommandObjectTargetModulesShowUnwind // Lookup unwind information in images - -static constexpr OptionDefinition g_target_modules_show_unwind_options[] = { #define LLDB_OPTIONS_target_modules_show_unwind #include "CommandOptions.inc" -}; class CommandObjectTargetModulesShowUnwind : public CommandObjectParsed { public: @@ -3616,11 +3606,8 @@ }; // Lookup information in images - -static constexpr OptionDefinition g_target_modules_lookup_options[] = { #define LLDB_OPTIONS_target_modules_lookup #include "CommandOptions.inc" -}; class CommandObjectTargetModulesLookup : public CommandObjectParsed { public: @@ -4471,11 +4458,8 @@ #pragma mark CommandObjectTargetStopHookAdd // CommandObjectTargetStopHookAdd - -static constexpr OptionDefinition g_target_stop_hook_add_options[] = { #define LLDB_OPTIONS_target_stop_hook_add #include "CommandOptions.inc" -}; class CommandObjectTargetStopHookAdd : public CommandObjectParsed, public IOHandlerDelegateMultiline { Index: lldb/source/Commands/CommandObjectThread.cpp =================================================================== --- lldb/source/Commands/CommandObjectThread.cpp +++ lldb/source/Commands/CommandObjectThread.cpp @@ -237,11 +237,8 @@ }; // CommandObjectThreadBacktrace - -static constexpr OptionDefinition g_thread_backtrace_options[] = { #define LLDB_OPTIONS_thread_backtrace #include "CommandOptions.inc" -}; class CommandObjectThreadBacktrace : public CommandObjectIterateOverThreads { public: @@ -403,10 +400,8 @@ return OptionEnumValues(g_tri_running_mode); } -static constexpr OptionDefinition g_thread_step_scope_options[] = { #define LLDB_OPTIONS_thread_step_scope #include "CommandOptions.inc" -}; class CommandObjectThreadStepWithTypeAndScope : public CommandObjectParsed { public: @@ -983,10 +978,8 @@ return OptionEnumValues(g_duo_running_mode); } -static constexpr OptionDefinition g_thread_until_options[] = { #define LLDB_OPTIONS_thread_until #include "CommandOptions.inc" -}; class CommandObjectThreadUntil : public CommandObjectParsed { public: @@ -1402,11 +1395,8 @@ }; // CommandObjectThreadInfo - -static constexpr OptionDefinition g_thread_info_options[] = { #define LLDB_OPTIONS_thread_info #include "CommandOptions.inc" -}; class CommandObjectThreadInfo : public CommandObjectIterateOverThreads { public: @@ -1536,11 +1526,8 @@ }; // CommandObjectThreadReturn - -static constexpr OptionDefinition g_thread_return_options[] = { #define LLDB_OPTIONS_thread_return #include "CommandOptions.inc" -}; class CommandObjectThreadReturn : public CommandObjectRaw { public: @@ -1711,11 +1698,8 @@ }; // CommandObjectThreadJump - -static constexpr OptionDefinition g_thread_jump_options[] = { #define LLDB_OPTIONS_thread_jump #include "CommandOptions.inc" -}; class CommandObjectThreadJump : public CommandObjectParsed { public: @@ -1854,11 +1838,8 @@ // Next are the subcommands of CommandObjectMultiwordThreadPlan // CommandObjectThreadPlanList - -static constexpr OptionDefinition g_thread_plan_list_options[] = { #define LLDB_OPTIONS_thread_plan_list #include "CommandOptions.inc" -}; class CommandObjectThreadPlanList : public CommandObjectIterateOverThreads { public: Index: lldb/source/Commands/CommandObjectType.cpp =================================================================== --- lldb/source/Commands/CommandObjectType.cpp +++ lldb/source/Commands/CommandObjectType.cpp @@ -95,10 +95,8 @@ return false; } -static constexpr OptionDefinition g_type_summary_add_options[] = { #define LLDB_OPTIONS_type_summary_add #include "CommandOptions.inc" -}; class CommandObjectTypeSummaryAdd : public CommandObjectParsed, public IOHandlerDelegateMultiline { @@ -282,10 +280,8 @@ " '''Optional'''\n" "class synthProvider:\n"; -static constexpr OptionDefinition g_type_synth_add_options[] = { #define LLDB_OPTIONS_type_synth_add #include "CommandOptions.inc" -}; class CommandObjectTypeSynthAdd : public CommandObjectParsed, public IOHandlerDelegateMultiline { @@ -503,10 +499,8 @@ // CommandObjectTypeFormatAdd -static constexpr OptionDefinition g_type_format_add_options[] = { #define LLDB_OPTIONS_type_format_add #include "CommandOptions.inc" -}; class CommandObjectTypeFormatAdd : public CommandObjectParsed { private: @@ -720,10 +714,8 @@ } }; -static constexpr OptionDefinition g_type_formatter_delete_options[] = { #define LLDB_OPTIONS_type_formatter_delete #include "CommandOptions.inc" -}; class CommandObjectTypeFormatterDelete : public CommandObjectParsed { protected: @@ -859,10 +851,8 @@ } }; -static constexpr OptionDefinition g_type_formatter_clear_options[] = { #define LLDB_OPTIONS_type_formatter_clear #include "CommandOptions.inc" -}; class CommandObjectTypeFormatterClear : public CommandObjectParsed { private: @@ -971,11 +961,8 @@ "type format clear", "Delete all existing format styles.") {} }; - -static constexpr OptionDefinition g_type_formatter_list_options[] = { #define LLDB_OPTIONS_type_formatter_list #include "CommandOptions.inc" -}; template class CommandObjectTypeFormatterList : public CommandObjectParsed { @@ -1731,11 +1718,8 @@ }; // CommandObjectTypeCategoryDefine - -static constexpr OptionDefinition g_type_category_define_options[] = { #define LLDB_OPTIONS_type_category_define #include "CommandOptions.inc" -}; class CommandObjectTypeCategoryDefine : public CommandObjectParsed { class CommandOptions : public Options { @@ -1834,11 +1818,8 @@ }; // CommandObjectTypeCategoryEnable - -static constexpr OptionDefinition g_type_category_enable_options[] = { #define LLDB_OPTIONS_type_category_enable #include "CommandOptions.inc" -}; class CommandObjectTypeCategoryEnable : public CommandObjectParsed { class CommandOptions : public Options { @@ -2006,11 +1987,8 @@ }; // CommandObjectTypeCategoryDisable - -OptionDefinition constexpr g_type_category_disable_options[] = { #define LLDB_OPTIONS_type_category_disable #include "CommandOptions.inc" -}; class CommandObjectTypeCategoryDisable : public CommandObjectParsed { class CommandOptions : public Options { @@ -2415,11 +2393,8 @@ } #endif // LLDB_DISABLE_PYTHON - -static constexpr OptionDefinition g_type_filter_add_options[] = { #define LLDB_OPTIONS_type_filter_add #include "CommandOptions.inc" -}; class CommandObjectTypeFilterAdd : public CommandObjectParsed { private: @@ -2663,10 +2638,8 @@ }; // "type lookup" -static constexpr OptionDefinition g_type_lookup_options[] = { #define LLDB_OPTIONS_type_lookup #include "CommandOptions.inc" -}; class CommandObjectTypeLookup : public CommandObjectRaw { protected: Index: lldb/source/Commands/CommandObjectWatchpoint.cpp =================================================================== --- lldb/source/Commands/CommandObjectWatchpoint.cpp +++ lldb/source/Commands/CommandObjectWatchpoint.cpp @@ -146,11 +146,8 @@ // CommandObjectWatchpointList::Options #pragma mark List::CommandOptions - -static constexpr OptionDefinition g_watchpoint_list_options[] = { #define LLDB_OPTIONS_watchpoint_list #include "CommandOptions.inc" -}; #pragma mark List @@ -507,10 +504,8 @@ // CommandObjectWatchpointIgnore #pragma mark Ignore::CommandOptions -static constexpr OptionDefinition g_watchpoint_ignore_options[] = { #define LLDB_OPTIONS_watchpoint_ignore #include "CommandOptions.inc" -}; class CommandObjectWatchpointIgnore : public CommandObjectParsed { public: @@ -625,11 +620,8 @@ // CommandObjectWatchpointModify #pragma mark Modify::CommandOptions - -static constexpr OptionDefinition g_watchpoint_modify_options[] = { #define LLDB_OPTIONS_watchpoint_modify #include "CommandOptions.inc" -}; #pragma mark Modify Index: lldb/source/Commands/CommandObjectWatchpointCommand.cpp =================================================================== --- lldb/source/Commands/CommandObjectWatchpointCommand.cpp +++ lldb/source/Commands/CommandObjectWatchpointCommand.cpp @@ -42,10 +42,8 @@ return OptionEnumValues(g_script_option_enumeration); } -static constexpr OptionDefinition g_watchpoint_command_add_options[] = { #define LLDB_OPTIONS_watchpoint_command_add #include "CommandOptions.inc" -}; class CommandObjectWatchpointCommandAdd : public CommandObjectParsed, public IOHandlerDelegateMultiline { Index: lldb/utils/TableGen/LLDBOptionDefEmitter.cpp =================================================================== --- lldb/utils/TableGen/LLDBOptionDefEmitter.cpp +++ lldb/utils/TableGen/LLDBOptionDefEmitter.cpp @@ -129,18 +129,21 @@ /// Emits all option initializers to the raw_ostream. static void emitOptions(std::string Command, std::vector Option, raw_ostream &OS) { + std::string ID = Command; + std::replace(ID.begin(), ID.end(), ' ', '_'); // Generate the macro that the user needs to define before including the // *.inc file. - std::string NeededMacro = "LLDB_OPTIONS_" + Command; - std::replace(NeededMacro.begin(), NeededMacro.end(), ' ', '_'); + std::string NeededMacro = "LLDB_OPTIONS_" + ID; // All options are in one file, so we need put them behind macros and ask the // user to define the macro for the options that are needed. OS << "// Options for " << Command << "\n"; OS << "#ifdef " << NeededMacro << "\n"; + OS << "constexpr static OptionDefinition g_" + ID + "_options[] = {\n"; for (Record *R : Option) emitOption(R, OS); // We undefine the macro for the user like Clang's include files are doing it. + OS << "};\n"; OS << "#undef " << NeededMacro << "\n"; OS << "#endif // " << Command << " command\n\n"; }