Let tablegen generate property definitions

Property definitions are currently defined in a PropertyDefinition array
and have a corresponding enum to index in this array. Unfortunately this
is quite error prone. Indeed, just today we found an incorrect merge
where a discrepancy between the order of the enum values and their
definition caused the test suite to fail spectacularly.

Tablegen can streamline the process of generating the property
definition table while at the same time guaranteeing that the enums stay
in sync. That's exactly what this patch does. It adds a new tablegen
file for the properties, building on top of the infrastructure that
Raphael added recently for the command options. It also introduces two
new tablegen backends: one for the property definitions and one for
their corresponding enums.

It might be worth mentioning that I generated most of the tablegen
definitions from the existing property definitions, by adding a dump
method to the struct. This seems both more efficient and less error
prone that copying everything over by hand. Only Enum properties needed
manual fixup for the EnumValues and DefaultEnumValue fields.

Differential revision: https://reviews.llvm.org/D65185

llvm-svn: 367058
diff --git a/lldb/source/Core/CMakeLists.txt b/lldb/source/Core/CMakeLists.txt
index 7ca37f9..bf6b1a5 100644
--- a/lldb/source/Core/CMakeLists.txt
+++ b/lldb/source/Core/CMakeLists.txt
@@ -76,6 +76,8 @@
     Demangle
   )
 
+add_dependencies(lldbCore LLDBPropertiesGen LLDBPropertiesEnumGen)
+
 # Needed to properly resolve references in a debug build.
 # TODO: Remove once we have better layering
 set_target_properties(lldbCore PROPERTIES LINK_INTERFACE_MULTIPLICITY 4)
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index 1a69fc5..723b79a 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -203,119 +203,13 @@
     {eStopShowColumnNone, "none", "Do not highlight the stop column."}};
 
 static constexpr PropertyDefinition g_properties[] = {
-    {"auto-confirm", OptionValue::eTypeBoolean, true, false, nullptr, {},
-     "If true all confirmation prompts will receive their default reply."},
-    {"disassembly-format", OptionValue::eTypeFormatEntity, true, 0,
-     DEFAULT_DISASSEMBLY_FORMAT, {},
-     "The default disassembly format "
-     "string to use when disassembling "
-     "instruction sequences."},
-    {"frame-format", OptionValue::eTypeFormatEntity, true, 0,
-     DEFAULT_FRAME_FORMAT, {},
-     "The default frame format string to use "
-     "when displaying stack frame information "
-     "for threads."},
-    {"notify-void", OptionValue::eTypeBoolean, true, false, nullptr, {},
-     "Notify the user explicitly if an expression returns void (default: "
-     "false)."},
-    {"prompt", OptionValue::eTypeString, true,
-     OptionValueString::eOptionEncodeCharacterEscapeSequences, "(lldb) ", {},
-     "The debugger command line prompt displayed for the user."},
-    {"script-lang", OptionValue::eTypeEnum, true, eScriptLanguagePython,
-     nullptr, OptionEnumValues(g_language_enumerators),
-     "The script language to be used for evaluating user-written scripts."},
-    {"stop-disassembly-count", OptionValue::eTypeSInt64, true, 4, nullptr, {},
-     "The number of disassembly lines to show when displaying a "
-     "stopped context."},
-    {"stop-disassembly-display", OptionValue::eTypeEnum, true,
-     Debugger::eStopDisassemblyTypeNoDebugInfo, nullptr,
-     OptionEnumValues(g_show_disassembly_enum_values),
-     "Control when to display disassembly when displaying a stopped context."},
-    {"stop-line-count-after", OptionValue::eTypeSInt64, true, 3, nullptr, {},
-     "The number of sources lines to display that come after the "
-     "current source line when displaying a stopped context."},
-    {"stop-line-count-before", OptionValue::eTypeSInt64, true, 3, nullptr, {},
-     "The number of sources lines to display that come before the "
-     "current source line when displaying a stopped context."},
-    {"highlight-source", OptionValue::eTypeBoolean, true, true, nullptr, {},
-     "If true, LLDB will highlight the displayed source code."},
-    {"stop-show-column", OptionValue::eTypeEnum, false,
-     eStopShowColumnAnsiOrCaret, nullptr, OptionEnumValues(s_stop_show_column_values),
-     "If true, LLDB will use the column information from the debug info to "
-     "mark the current position when displaying a stopped context."},
-    {"stop-show-column-ansi-prefix", OptionValue::eTypeString, true, 0,
-     "${ansi.underline}", {},
-     "When displaying the column marker in a color-enabled (i.e. ANSI) "
-     "terminal, use the ANSI terminal code specified in this format at the "
-     "immediately before the column to be marked."},
-    {"stop-show-column-ansi-suffix", OptionValue::eTypeString, true, 0,
-     "${ansi.normal}", {},
-     "When displaying the column marker in a color-enabled (i.e. ANSI) "
-     "terminal, use the ANSI terminal code specified in this format "
-     "immediately after the column to be marked."},
-    {"term-width", OptionValue::eTypeSInt64, true, 80, nullptr, {},
-     "The maximum number of columns to use for displaying text."},
-    {"thread-format", OptionValue::eTypeFormatEntity, true, 0,
-     DEFAULT_THREAD_FORMAT, {},
-     "The default thread format string to use "
-     "when displaying thread information."},
-    {"thread-stop-format", OptionValue::eTypeFormatEntity, true, 0,
-     DEFAULT_THREAD_STOP_FORMAT, {},
-     "The default thread format  "
-     "string to use when displaying thread "
-     "information as part of the stop display."},
-    {"use-external-editor", OptionValue::eTypeBoolean, true, false, nullptr, {},
-     "Whether to use an external editor or not."},
-    {"use-color", OptionValue::eTypeBoolean, true, true, nullptr, {},
-     "Whether to use Ansi color codes or not."},
-    {"auto-one-line-summaries", OptionValue::eTypeBoolean, true, true, nullptr,
-     {},
-     "If true, LLDB will automatically display small structs in "
-     "one-liner format (default: true)."},
-    {"auto-indent", OptionValue::eTypeBoolean, true, true, nullptr, {},
-     "If true, LLDB will auto indent/outdent code. Currently only supported in "
-     "the REPL (default: true)."},
-    {"print-decls", OptionValue::eTypeBoolean, true, true, nullptr, {},
-     "If true, LLDB will print the values of variables declared in an "
-     "expression. Currently only supported in the REPL (default: true)."},
-    {"tab-size", OptionValue::eTypeUInt64, true, 4, nullptr, {},
-     "The tab size to use when indenting code in multi-line input mode "
-     "(default: 4)."},
-    {"escape-non-printables", OptionValue::eTypeBoolean, true, true, nullptr,
-     {},
-     "If true, LLDB will automatically escape non-printable and "
-     "escape characters when formatting strings."},
-    {"frame-format-unique", OptionValue::eTypeFormatEntity, true, 0,
-     DEFAULT_FRAME_FORMAT_NO_ARGS, {},
-     "The default frame format string to use when displaying stack frame"
-     "information for threads from thread backtrace unique."}};
+#define LLDB_PROPERTIES_debugger
+#include "lldb/Core/Properties.inc"
+};
 
 enum {
-  ePropertyAutoConfirm = 0,
-  ePropertyDisassemblyFormat,
-  ePropertyFrameFormat,
-  ePropertyNotiftVoid,
-  ePropertyPrompt,
-  ePropertyScriptLanguage,
-  ePropertyStopDisassemblyCount,
-  ePropertyStopDisassemblyDisplay,
-  ePropertyStopLineCountAfter,
-  ePropertyStopLineCountBefore,
-  ePropertyHighlightSource,
-  ePropertyStopShowColumn,
-  ePropertyStopShowColumnAnsiPrefix,
-  ePropertyStopShowColumnAnsiSuffix,
-  ePropertyTerminalWidth,
-  ePropertyThreadFormat,
-  ePropertyThreadStopFormat,
-  ePropertyUseExternalEditor,
-  ePropertyUseColor,
-  ePropertyAutoOneLineSummaries,
-  ePropertyAutoIndent,
-  ePropertyPrintDecls,
-  ePropertyTabSize,
-  ePropertyEscapeNonPrintables,
-  ePropertyFrameFormatUnique,
+#define LLDB_PROPERTIES_debugger
+#include "lldb/Core/PropertiesEnum.inc"
 };
 
 LoadPluginCallbackType Debugger::g_load_plugin_callback = nullptr;
diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp
index b9b155c..7136843 100644
--- a/lldb/source/Core/ModuleList.cpp
+++ b/lldb/source/Core/ModuleList.cpp
@@ -66,23 +66,14 @@
 namespace {
 
 static constexpr PropertyDefinition g_properties[] = {
-    {"enable-external-lookup", OptionValue::eTypeBoolean, true, true, nullptr,
-     {},
-     "Control the use of external tools and repositories to locate symbol "
-     "files. Directories listed in target.debug-file-search-paths and "
-     "directory of the executable are always checked first for separate debug "
-     "info files. Then depending on this setting: "
-     "On macOS, Spotlight would be also used to locate a matching .dSYM "
-     "bundle based on the UUID of the executable. "
-     "On NetBSD, directory /usr/libdata/debug would be also searched. "
-     "On platforms other than NetBSD directory /usr/lib/debug would be "
-     "also searched."
-    },
-    {"clang-modules-cache-path", OptionValue::eTypeFileSpec, true, 0, nullptr,
-     {},
-     "The path to the clang modules cache directory (-fmodules-cache-path)."}};
+#define LLDB_PROPERTIES_modulelist
+#include "lldb/Core/Properties.inc"
+};
 
-enum { ePropertyEnableExternalLookup, ePropertyClangModulesCachePath };
+enum {
+#define LLDB_PROPERTIES_modulelist
+#include "lldb/Core/PropertiesEnum.inc"
+};
 
 } // namespace
 
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index 4610a44..e84fe57 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -77,10 +77,6 @@
 
 static const char *k_white_space = " \t\v";
 
-static constexpr bool NoGlobalSetting = true;
-static constexpr uintptr_t DefaultValueTrue = true;
-static constexpr uintptr_t DefaultValueFalse = false;
-static constexpr const char *NoCStrDefault = nullptr;
 static constexpr const char *InitFileWarning =
     "There is a .lldbinit file in the current directory which is not being "
     "read.\n"
@@ -94,37 +90,13 @@
     "accept the security risk.";
 
 static constexpr PropertyDefinition g_properties[] = {
-    {"expand-regex-aliases", OptionValue::eTypeBoolean, NoGlobalSetting,
-     DefaultValueFalse, NoCStrDefault, {},
-     "If true, regular expression alias commands will show the "
-     "expanded command that will be executed. This can be used to "
-     "debug new regular expression alias commands."},
-    {"prompt-on-quit", OptionValue::eTypeBoolean, NoGlobalSetting,
-     DefaultValueTrue, NoCStrDefault, {},
-     "If true, LLDB will prompt you before quitting if there are any live "
-     "processes being debugged. If false, LLDB will quit without asking in any "
-     "case."},
-    {"stop-command-source-on-error", OptionValue::eTypeBoolean, NoGlobalSetting,
-     DefaultValueTrue, NoCStrDefault, {},
-     "If true, LLDB will stop running a 'command source' "
-     "script upon encountering an error."},
-    {"space-repl-prompts", OptionValue::eTypeBoolean, NoGlobalSetting,
-     DefaultValueFalse, NoCStrDefault, {},
-     "If true, blank lines will be printed between between REPL submissions."},
-    {"echo-commands", OptionValue::eTypeBoolean, NoGlobalSetting,
-     DefaultValueTrue, NoCStrDefault, {},
-     "If true, commands will be echoed before they are evaluated."},
-    {"echo-comment-commands", OptionValue::eTypeBoolean, NoGlobalSetting,
-     DefaultValueTrue, NoCStrDefault, {},
-     "If true, commands will be echoed even if they are pure comment lines."}};
+#define LLDB_PROPERTIES_commandinterpreter
+#include "lldb/Core/Properties.inc"
+};
 
 enum {
-  ePropertyExpandRegexAliases = 0,
-  ePropertyPromptOnQuit = 1,
-  ePropertyStopCmdSourceOnError = 2,
-  eSpaceReplPrompts = 3,
-  eEchoCommands = 4,
-  eEchoCommentCommands = 5
+#define LLDB_PROPERTIES_commandinterpreter
+#include "lldb/Core/PropertiesEnum.inc"
 };
 
 ConstString &CommandInterpreter::GetStaticBroadcasterClass() {
@@ -170,24 +142,24 @@
 }
 
 bool CommandInterpreter::GetEchoCommands() const {
-  const uint32_t idx = eEchoCommands;
+  const uint32_t idx = ePropertyEchoCommands;
   return m_collection_sp->GetPropertyAtIndexAsBoolean(
       nullptr, idx, g_properties[idx].default_uint_value != 0);
 }
 
 void CommandInterpreter::SetEchoCommands(bool b) {
-  const uint32_t idx = eEchoCommands;
+  const uint32_t idx = ePropertyEchoCommands;
   m_collection_sp->SetPropertyAtIndexAsBoolean(nullptr, idx, b);
 }
 
 bool CommandInterpreter::GetEchoCommentCommands() const {
-  const uint32_t idx = eEchoCommentCommands;
+  const uint32_t idx = ePropertyEchoCommentCommands;
   return m_collection_sp->GetPropertyAtIndexAsBoolean(
       nullptr, idx, g_properties[idx].default_uint_value != 0);
 }
 
 void CommandInterpreter::SetEchoCommentCommands(bool b) {
-  const uint32_t idx = eEchoCommentCommands;
+  const uint32_t idx = ePropertyEchoCommentCommands;
   m_collection_sp->SetPropertyAtIndexAsBoolean(nullptr, idx, b);
 }
 
@@ -227,7 +199,7 @@
 }
 
 bool CommandInterpreter::GetSpaceReplPrompts() const {
-  const uint32_t idx = eSpaceReplPrompts;
+  const uint32_t idx = ePropertySpaceReplPrompts;
   return m_collection_sp->GetPropertyAtIndexAsBoolean(
       nullptr, idx, g_properties[idx].default_uint_value != 0);
 }
diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/CMakeLists.txt b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/CMakeLists.txt
index ffc797b..b4ba84a 100644
--- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/CMakeLists.txt
+++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/CMakeLists.txt
@@ -1,3 +1,11 @@
+lldb_tablegen(Properties.inc -gen-lldb-property-defs
+  SOURCE Properties.td
+  TARGET LLDBPluginDynamicLoaderDarwinKernelPropertiesGen)
+
+lldb_tablegen(PropertiesEnum.inc -gen-lldb-property-enum-defs
+  SOURCE Properties.td
+  TARGET LLDBPluginDynamicLoaderDarwinKernelPropertiesEnumGen)
+
 add_lldb_library(lldbPluginDynamicLoaderDarwinKernel PLUGIN
   DynamicLoaderDarwinKernel.cpp
 
@@ -11,3 +19,7 @@
     lldbUtility
     lldbPluginPlatformMacOSX
   )
+
+add_dependencies(lldbPluginDynamicLoaderDarwinKernel
+  LLDBPluginDynamicLoaderDarwinKernelPropertiesGen
+  LLDBPluginDynamicLoaderDarwinKernelPropertiesEnumGen)
diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index 7ff783d..0d55e34 100644
--- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -73,14 +73,14 @@
      "on 32-bit targets)."}};
 
 static constexpr PropertyDefinition g_properties[] = {
-    {"load-kexts", OptionValue::eTypeBoolean, true, true, nullptr, {},
-     "Automatically loads kext images when attaching to a kernel."},
-    {"scan-type", OptionValue::eTypeEnum, true, eKASLRScanNearPC, nullptr,
-     OptionEnumValues(g_kaslr_kernel_scan_enum_values),
-     "Control how many reads lldb will make while searching for a Darwin "
-     "kernel on attach."}};
+#define LLDB_PROPERTIES_dynamicloaderdarwinkernel
+#include "Properties.inc"
+};
 
-enum { ePropertyLoadKexts, ePropertyScanType };
+enum {
+#define LLDB_PROPERTIES_dynamicloaderdarwinkernel
+#include "PropertiesEnum.inc"
+};
 
 class DynamicLoaderDarwinKernelProperties : public Properties {
 public:
diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/Properties.td b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/Properties.td
new file mode 100644
index 0000000..6c662d7
--- /dev/null
+++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/Properties.td
@@ -0,0 +1,13 @@
+include "../../../../include/lldb/Core/PropertiesBase.td"
+
+let Definition = "dynamicloaderdarwinkernel" in {
+  def LoadKexts: Property<"load-kexts", "Boolean">,
+    Global,
+    DefaultTrue,
+    Desc<"Automatically loads kext images when attaching to a kernel.">;
+  def ScanType: Property<"scan-type", "Enum">,
+    Global,
+    DefaultEnumValue<"eKASLRScanNearPC">,
+    EnumValues<"OptionEnumValues(g_kaslr_kernel_scan_enum_values)">,
+    Desc<"Control how many reads lldb will make while searching for a Darwin kernel on attach.">;
+}
diff --git a/lldb/source/Plugins/JITLoader/GDB/CMakeLists.txt b/lldb/source/Plugins/JITLoader/GDB/CMakeLists.txt
index 190599c..88e8fce 100644
--- a/lldb/source/Plugins/JITLoader/GDB/CMakeLists.txt
+++ b/lldb/source/Plugins/JITLoader/GDB/CMakeLists.txt
@@ -1,3 +1,11 @@
+lldb_tablegen(Properties.inc -gen-lldb-property-defs
+  SOURCE Properties.td
+  TARGET LLDBPluginJITLoaderGDBPropertiesGen)
+
+lldb_tablegen(PropertiesEnum.inc -gen-lldb-property-enum-defs
+  SOURCE Properties.td
+  TARGET LLDBPluginJITLoaderGDBPropertiesEnumGen)
+
 add_lldb_library(lldbPluginJITLoaderGDB PLUGIN
   JITLoaderGDB.cpp
 
@@ -12,3 +20,6 @@
     Support
   )
 
+add_dependencies(lldbPluginJITLoaderGDB
+  LLDBPluginJITLoaderGDBPropertiesGen
+  LLDBPluginJITLoaderGDBPropertiesEnumGen)
diff --git a/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp b/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
index bc429d7..a6db810 100644
--- a/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
+++ b/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
@@ -67,13 +67,15 @@
  };
 
 static constexpr PropertyDefinition g_properties[] = {
-    {"enable", OptionValue::eTypeEnum, true,
-     eEnableJITLoaderGDBDefault, nullptr,
-     OptionEnumValues(g_enable_jit_loader_gdb_enumerators),
-     "Enable GDB's JIT compilation interface (default: enabled on "
-     "all platforms except macOS)"}};
+#define LLDB_PROPERTIES_jitloadergdb
+#include "Properties.inc"
+};
 
-enum { ePropertyEnable, ePropertyEnableJITBreakpoint };
+enum {
+#define LLDB_PROPERTIES_jitloadergdb
+#include "PropertiesEnum.inc"
+  ePropertyEnableJITBreakpoint
+};
 
 class PluginProperties : public Properties {
 public:
diff --git a/lldb/source/Plugins/JITLoader/GDB/Properties.td b/lldb/source/Plugins/JITLoader/GDB/Properties.td
new file mode 100644
index 0000000..0493838
--- /dev/null
+++ b/lldb/source/Plugins/JITLoader/GDB/Properties.td
@@ -0,0 +1,9 @@
+include "../../../../include/lldb/Core/PropertiesBase.td"
+
+let Definition = "jitloadergdb" in {
+  def Enable: Property<"enable", "Enum">,
+    Global,
+    DefaultEnumValue<"eEnableJITLoaderGDBDefault">,
+    EnumValues<"OptionEnumValues(g_enable_jit_loader_gdb_enumerators)">,
+    Desc<"Enable GDB's JIT compilation interface (default: enabled on all platforms except macOS)">;
+}
diff --git a/lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt b/lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt
index 6f0d952..d8fd2aa 100644
--- a/lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt
+++ b/lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt
@@ -1,3 +1,11 @@
+lldb_tablegen(Properties.inc -gen-lldb-property-defs
+  SOURCE Properties.td
+  TARGET LLDBPluginPlatformMacOSXPropertiesGen)
+
+lldb_tablegen(PropertiesEnum.inc -gen-lldb-property-enum-defs
+  SOURCE Properties.td
+  TARGET LLDBPluginPlatformMacOSXPropertiesEnumGen)
+
 list(APPEND PLUGIN_PLATFORM_MACOSX_SOURCES
   PlatformDarwin.cpp
   PlatformDarwinKernel.cpp
@@ -29,7 +37,7 @@
 
 add_lldb_library(lldbPluginPlatformMacOSX PLUGIN
   ${PLUGIN_PLATFORM_MACOSX_SOURCES}
-  
+
   LINK_LIBS
     clangBasic
     lldbBreakpoint
@@ -44,3 +52,7 @@
   LINK_COMPONENTS
     Support
     )
+
+add_dependencies(lldbPluginPlatformMacOSX
+  LLDBPluginPlatformMacOSXPropertiesGen
+  LLDBPluginPlatformMacOSXPropertiesEnumGen)
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
index ee0d192..b1e0f87 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
@@ -178,14 +178,14 @@
 /// Code to handle the PlatformDarwinKernel settings
 
 static constexpr PropertyDefinition g_properties[] = {
-    {"search-locally-for-kexts", OptionValue::eTypeBoolean, true, true, NULL,
-     {}, "Automatically search for kexts on the local system when doing "
-           "kernel debugging."},
-    {"kext-directories", OptionValue::eTypeFileSpecList, false, 0, NULL, {},
-     "Directories/KDKs to search for kexts in when starting a kernel debug "
-     "session."}};
+#define LLDB_PROPERTIES_platformdarwinkernel
+#include "Properties.inc"
+};
 
-enum { ePropertySearchForKexts = 0, ePropertyKextDirectories };
+enum {
+#define LLDB_PROPERTIES_platformdarwinkernel
+#include "PropertiesEnum.inc"
+};
 
 class PlatformDarwinKernelProperties : public Properties {
 public:
diff --git a/lldb/source/Plugins/Platform/MacOSX/Properties.td b/lldb/source/Plugins/Platform/MacOSX/Properties.td
new file mode 100644
index 0000000..07e4e3e
--- /dev/null
+++ b/lldb/source/Plugins/Platform/MacOSX/Properties.td
@@ -0,0 +1,11 @@
+include "../../../../include/lldb/Core/PropertiesBase.td"
+
+let Definition = "platformdarwinkernel" in {
+  def SearchForKexts: Property<"search-locally-for-kexts", "Boolean">,
+    Global,
+    DefaultTrue,
+    Desc<"Automatically search for kexts on the local system when doing kernel debugging.">;
+  def KextDirectories: Property<"kext-directories", "FileSpecList">,
+    DefaultStringValue<"">,
+    Desc<"Directories/KDKs to search for kexts in when starting a kernel debug session.">;
+}
diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/CMakeLists.txt b/lldb/source/Plugins/Process/MacOSX-Kernel/CMakeLists.txt
index bed0e3b..5672008 100644
--- a/lldb/source/Plugins/Process/MacOSX-Kernel/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/MacOSX-Kernel/CMakeLists.txt
@@ -1,3 +1,11 @@
+lldb_tablegen(Properties.inc -gen-lldb-property-defs
+  SOURCE Properties.td
+  TARGET LLDBPluginProcessMacOSXKernelPropertiesGen)
+
+lldb_tablegen(PropertiesEnum.inc -gen-lldb-property-enum-defs
+  SOURCE Properties.td
+  TARGET LLDBPluginProcessMacOSXKernelPropertiesEnumGen)
+
 add_lldb_library(lldbPluginProcessMacOSXKernel PLUGIN
   CommunicationKDP.cpp
   ProcessKDP.cpp
@@ -20,3 +28,7 @@
     lldbPluginDynamicLoaderStatic
     lldbPluginProcessUtility
   )
+
+add_dependencies(lldbPluginProcessMacOSXKernel
+  LLDBPluginProcessMacOSXKernelPropertiesGen
+  LLDBPluginProcessMacOSXKernelPropertiesEnumGen)
diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
index 52c494d..5542018 100644
--- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
+++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
@@ -53,10 +53,14 @@
 namespace {
 
 static constexpr PropertyDefinition g_properties[] = {
-    {"packet-timeout", OptionValue::eTypeUInt64, true, 5, NULL, {},
-     "Specify the default packet timeout in seconds."}};
+#define LLDB_PROPERTIES_processkdp
+#include "Properties.inc"
+};
 
-enum { ePropertyPacketTimeout };
+enum {
+#define LLDB_PROPERTIES_processkdp
+#include "PropertiesEnum.inc"
+};
 
 class PluginProperties : public Properties {
 public:
@@ -72,7 +76,7 @@
   virtual ~PluginProperties() {}
 
   uint64_t GetPacketTimeout() {
-    const uint32_t idx = ePropertyPacketTimeout;
+    const uint32_t idx = ePropertyKDPPacketTimeout;
     return m_collection_sp->GetPropertyAtIndexAsUInt64(
         NULL, idx, g_properties[idx].default_uint_value);
   }
diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/Properties.td b/lldb/source/Plugins/Process/MacOSX-Kernel/Properties.td
new file mode 100644
index 0000000..0063bdb
--- /dev/null
+++ b/lldb/source/Plugins/Process/MacOSX-Kernel/Properties.td
@@ -0,0 +1,8 @@
+include "../../../../include/lldb/Core/PropertiesBase.td"
+
+let Definition = "processkdp" in {
+  def KDPPacketTimeout: Property<"packet-timeout", "UInt64">,
+    Global,
+    DefaultUnsignedValue<5>,
+    Desc<"Specify the default packet timeout in seconds.">;
+}
diff --git a/lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt b/lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt
index 4eb5291..2e0b4a8 100644
--- a/lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt
@@ -1,3 +1,11 @@
+lldb_tablegen(Properties.inc -gen-lldb-property-defs
+  SOURCE Properties.td
+  TARGET LLDBPluginProcessGDBRemotePropertiesGen)
+
+lldb_tablegen(PropertiesEnum.inc -gen-lldb-property-enum-defs
+  SOURCE Properties.td
+  TARGET LLDBPluginProcessGDBRemotePropertiesEnumGen)
+
 if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
   include_directories(${LIBXML2_INCLUDE_DIR})
 endif()
@@ -40,3 +48,7 @@
   LINK_COMPONENTS
     Support
   )
+
+add_dependencies(lldbPluginProcessGDBRemote
+  LLDBPluginProcessGDBRemotePropertiesGen
+  LLDBPluginProcessGDBRemotePropertiesEnumGen)
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 5cb5f14..ade1d84 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -111,39 +111,13 @@
 namespace {
 
 static constexpr PropertyDefinition g_properties[] = {
-    {"packet-timeout",
-     OptionValue::eTypeUInt64,
-     true,
-     5
-#if defined(__has_feature)
-#if __has_feature(address_sanitizer)
-         * 2
-#endif
-#endif
-     ,
-     nullptr,
-     {},
-     "Specify the default packet timeout in seconds."},
-    {"target-definition-file",
-     OptionValue::eTypeFileSpec,
-     true,
-     0,
-     nullptr,
-     {},
-     "The file that provides the description for remote target registers."},
-    {"use-libraries-svr4",
-     OptionValue::eTypeBoolean,
-     true,
-     false,
-     nullptr,
-     {},
-     "If true, the libraries-svr4 feature will be used to get a hold of the "
-     "process's loaded modules."}};
+#define LLDB_PROPERTIES_processgdbremote
+#include "Properties.inc"
+};
 
 enum {
-  ePropertyPacketTimeout,
-  ePropertyTargetDefinitionFile,
-  ePropertyUseSVR4
+#define LLDB_PROPERTIES_processgdbremote
+#include "PropertiesEnum.inc"
 };
 
 class PluginProperties : public Properties {
@@ -2469,7 +2443,7 @@
     // Clear the thread stop stack
     m_stop_packet_stack.clear();
   }
-  
+
   // If we have queried for a default thread id
   if (m_initial_tid != LLDB_INVALID_THREAD_ID) {
     m_thread_list.SetSelectedThreadByID(m_initial_tid);
diff --git a/lldb/source/Plugins/Process/gdb-remote/Properties.td b/lldb/source/Plugins/Process/gdb-remote/Properties.td
new file mode 100644
index 0000000..16e7723
--- /dev/null
+++ b/lldb/source/Plugins/Process/gdb-remote/Properties.td
@@ -0,0 +1,16 @@
+include "../../../../include/lldb/Core/PropertiesBase.td"
+
+let Definition = "processgdbremote" in {
+  def PacketTimeout: Property<"packet-timeout", "UInt64">,
+    Global,
+    DefaultUnsignedValue<5>,
+    Desc<"Specify the default packet timeout in seconds.">;
+  def TargetDefinitionFile: Property<"target-definition-file", "FileSpec">,
+    Global,
+    DefaultStringValue<"">,
+    Desc<"The file that provides the description for remote target registers.">;
+  def UseSVR4: Property<"use-libraries-svr4", "Boolean">,
+    Global,
+    DefaultFalse,
+    Desc<"If true, the libraries-svr4 feature will be used to get a hold of the process's loaded modules.">;
+}
diff --git a/lldb/source/Plugins/StructuredData/DarwinLog/CMakeLists.txt b/lldb/source/Plugins/StructuredData/DarwinLog/CMakeLists.txt
index 4df3912..0b92185 100644
--- a/lldb/source/Plugins/StructuredData/DarwinLog/CMakeLists.txt
+++ b/lldb/source/Plugins/StructuredData/DarwinLog/CMakeLists.txt
@@ -1,3 +1,11 @@
+lldb_tablegen(Properties.inc -gen-lldb-property-defs
+  SOURCE Properties.td
+  TARGET LLDBPluginStructuredDataDarwinLogPropertiesGen)
+
+lldb_tablegen(PropertiesEnum.inc -gen-lldb-property-enum-defs
+  SOURCE Properties.td
+  TARGET LLDBPluginStructuredDataDarwinLogPropertiesEnumGen)
+
 add_lldb_library(lldbPluginStructuredDataDarwinLog PLUGIN
   StructuredDataDarwinLog.cpp
 
@@ -8,3 +16,7 @@
     lldbInterpreter
     lldbTarget
   )
+
+add_dependencies(lldbPluginStructuredDataDarwinLog
+  LLDBPluginStructuredDataDarwinLogPropertiesGen
+  LLDBPluginStructuredDataDarwinLogPropertiesEnumGen)
diff --git a/lldb/source/Plugins/StructuredData/DarwinLog/Properties.td b/lldb/source/Plugins/StructuredData/DarwinLog/Properties.td
new file mode 100644
index 0000000..5c22158
--- /dev/null
+++ b/lldb/source/Plugins/StructuredData/DarwinLog/Properties.td
@@ -0,0 +1,12 @@
+include "../../../../include/lldb/Core/PropertiesBase.td"
+
+let Definition = "darwinlog" in {
+  def EnableOnStartup: Property<"enable-on-startup", "Boolean">,
+    Global,
+    DefaultFalse,
+    Desc<"Enable Darwin os_log collection when debugged process is launched or attached.">;
+  def AutoEnableOptions: Property<"auto-enable-options", "String">,
+    Global,
+    DefaultStringValue<"">,
+    Desc<"Specify the options to 'plugin structured-data darwin-log enable' that should be applied when automatically enabling logging on startup/attach.">;
+}
diff --git a/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp b/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
index d94da5b..0438fde 100644
--- a/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
+++ b/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
@@ -105,29 +105,14 @@
 /// Code to handle the StructuredDataDarwinLog settings
 
 static constexpr PropertyDefinition g_properties[] = {
-    {
-        "enable-on-startup",       // name
-        OptionValue::eTypeBoolean, // type
-        true,                      // global
-        false,                     // default uint value
-        nullptr,                   // default cstring value
-        {},                        // enum values
-        "Enable Darwin os_log collection when debugged process is launched "
-        "or attached." // description
-    },
-    {
-        "auto-enable-options",    // name
-        OptionValue::eTypeString, // type
-        true,                     // global
-        0,                        // default uint value
-        "",                       // default cstring value
-        {},                       // enum values
-        "Specify the options to 'plugin structured-data darwin-log enable' "
-        "that should be applied when automatically enabling logging on "
-        "startup/attach." // description
-    }};
+#define LLDB_PROPERTIES_darwinlog
+#include "Properties.inc"
+};
 
-enum { ePropertyEnableOnStartup = 0, ePropertyAutoEnableOptions = 1 };
+enum {
+#define LLDB_PROPERTIES_darwinlog
+#include "PropertiesEnum.inc"
+};
 
 class StructuredDataDarwinLogProperties : public Properties {
 public:
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/CMakeLists.txt b/lldb/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
index cd588cb..1ca4be3 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
+++ b/lldb/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
@@ -1,3 +1,11 @@
+lldb_tablegen(Properties.inc -gen-lldb-property-defs
+  SOURCE Properties.td
+  TARGET LLDBPluginSymbolFileDWARFPropertiesGen)
+
+lldb_tablegen(PropertiesEnum.inc -gen-lldb-property-enum-defs
+  SOURCE Properties.td
+  TARGET LLDBPluginSymbolFileDWARFPropertiesEnumGen)
+
 add_lldb_library(lldbPluginSymbolFileDWARF PLUGIN
   AppleDWARFIndex.cpp
   DebugNamesDWARFIndex.cpp
@@ -52,3 +60,7 @@
     DebugInfoDWARF
     Support
   )
+
+add_dependencies(lldbPluginSymbolFileDWARF
+  LLDBPluginSymbolFileDWARFPropertiesGen
+  LLDBPluginSymbolFileDWARFPropertiesEnumGen)
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/Properties.td b/lldb/source/Plugins/SymbolFile/DWARF/Properties.td
new file mode 100644
index 0000000..ef6ae34
--- /dev/null
+++ b/lldb/source/Plugins/SymbolFile/DWARF/Properties.td
@@ -0,0 +1,12 @@
+include "../../../../include/lldb/Core/PropertiesBase.td"
+
+let Definition = "symbolfiledwarf" in {
+  def SymLinkPaths: Property<"comp-dir-symlink-paths", "FileSpecList">,
+    Global,
+    DefaultStringValue<"">,
+    Desc<"If the DW_AT_comp_dir matches any of these paths the symbolic links will be resolved at DWARF parse time.">;
+  def IgnoreIndexes: Property<"ignore-file-indexes", "Boolean">,
+    Global,
+    DefaultFalse,
+    Desc<"Ignore indexes present in the object files and always index DWARF manually.">;
+}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 362e152..f14c2db 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -114,17 +114,13 @@
 namespace {
 
 static constexpr PropertyDefinition g_properties[] = {
-    {"comp-dir-symlink-paths", OptionValue::eTypeFileSpecList, true, 0, nullptr,
-     {},
-     "If the DW_AT_comp_dir matches any of these paths the symbolic "
-     "links will be resolved at DWARF parse time."},
-    {"ignore-file-indexes", OptionValue::eTypeBoolean, true, 0, nullptr, {},
-     "Ignore indexes present in the object files and always index DWARF "
-     "manually."}};
+#define LLDB_PROPERTIES_symbolfiledwarf
+#include "Properties.inc"
+};
 
 enum {
-  ePropertySymLinkPaths,
-  ePropertyIgnoreIndexes,
+#define LLDB_PROPERTIES_symbolfiledwarf
+#include "PropertiesEnum.inc"
 };
 
 class PluginProperties : public Properties {
diff --git a/lldb/source/Target/CMakeLists.txt b/lldb/source/Target/CMakeLists.txt
index 2f59a48..491f05e 100644
--- a/lldb/source/Target/CMakeLists.txt
+++ b/lldb/source/Target/CMakeLists.txt
@@ -70,3 +70,5 @@
   LINK_COMPONENTS
     Support
   )
+
+add_dependencies(lldbTarget LLDBPropertiesGen LLDBPropertiesEnumGen)
diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp
index 3eb8ba6..feb43c0 100644
--- a/lldb/source/Target/Platform.cpp
+++ b/lldb/source/Target/Platform.cpp
@@ -64,12 +64,14 @@
 namespace {
 
 static constexpr PropertyDefinition g_properties[] = {
-    {"use-module-cache", OptionValue::eTypeBoolean, true, true, nullptr,
-     {}, "Use module cache."},
-    {"module-cache-directory", OptionValue::eTypeFileSpec, true, 0, nullptr,
-     {}, "Root directory for cached modules."}};
+#define LLDB_PROPERTIES_platform
+#include "lldb/Core/Properties.inc"
+};
 
-enum { ePropertyUseModuleCache, ePropertyModuleCacheDirectory };
+enum {
+#define LLDB_PROPERTIES_platform
+#include "lldb/Core/PropertiesEnum.inc"
+};
 
 } // namespace
 
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index 8888262..4d6d96f 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -113,54 +113,13 @@
 };
 
 static constexpr PropertyDefinition g_properties[] = {
-    {"disable-memory-cache", OptionValue::eTypeBoolean, false,
-     DISABLE_MEM_CACHE_DEFAULT, nullptr, {},
-     "Disable reading and caching of memory in fixed-size units."},
-    {"extra-startup-command", OptionValue::eTypeArray, false,
-     OptionValue::eTypeString, nullptr, {},
-     "A list containing extra commands understood by the particular process "
-     "plugin used.  "
-     "For instance, to turn on debugserver logging set this to "
-     "\"QSetLogging:bitmask=LOG_DEFAULT;\""},
-    {"ignore-breakpoints-in-expressions", OptionValue::eTypeBoolean, true, true,
-     nullptr, {},
-     "If true, breakpoints will be ignored during expression evaluation."},
-    {"unwind-on-error-in-expressions", OptionValue::eTypeBoolean, true, true,
-     nullptr, {}, "If true, errors in expression evaluation will unwind "
-                  "the stack back to the state before the call."},
-    {"python-os-plugin-path", OptionValue::eTypeFileSpec, false, true, nullptr,
-     {}, "A path to a python OS plug-in module file that contains a "
-         "OperatingSystemPlugIn class."},
-    {"stop-on-sharedlibrary-events", OptionValue::eTypeBoolean, true, false,
-     nullptr, {},
-     "If true, stop when a shared library is loaded or unloaded."},
-    {"detach-keeps-stopped", OptionValue::eTypeBoolean, true, false, nullptr,
-     {}, "If true, detach will attempt to keep the process stopped."},
-    {"memory-cache-line-size", OptionValue::eTypeUInt64, false, 512, nullptr,
-     {}, "The memory cache line size"},
-    {"optimization-warnings", OptionValue::eTypeBoolean, false, true, nullptr,
-     {}, "If true, warn when stopped in code that is optimized where "
-         "stepping and variable availability may not behave as expected."},
-    {"stop-on-exec", OptionValue::eTypeBoolean, true, true,
-     nullptr, {},
-     "If true, stop when a shared library is loaded or unloaded."},
-    {"utility-expression-timeout", OptionValue::eTypeUInt64, false, 15,
-     nullptr, {},
-     "The time in seconds to wait for LLDB-internal utility expressions."}
+#define LLDB_PROPERTIES_process
+#include "lldb/Core/Properties.inc"
 };
 
 enum {
-  ePropertyDisableMemCache,
-  ePropertyExtraStartCommand,
-  ePropertyIgnoreBreakpointsInExpressions,
-  ePropertyUnwindOnErrorInExpressions,
-  ePropertyPythonOSPluginPath,
-  ePropertyStopOnSharedLibraryEvents,
-  ePropertyDetachKeepsStopped,
-  ePropertyMemCacheLineSize,
-  ePropertyWarningOptimization,
-  ePropertyStopOnExec,
-  ePropertyUtilityExpressionTimeout,
+#define LLDB_PROPERTIES_process
+#include "lldb/Core/PropertiesEnum.inc"
 };
 
 ProcessProperties::ProcessProperties(lldb_private::Process *process)
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index 2bdfc30..7f7b548 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -3274,221 +3274,13 @@
      "this setting loads sections and all symbols."} };
 
 static constexpr PropertyDefinition g_properties[] = {
-    {"default-arch", OptionValue::eTypeArch, true, 0, nullptr, {},
-     "Default architecture to choose, when there's a choice."},
-    {"move-to-nearest-code", OptionValue::eTypeBoolean, false, true, nullptr,
-     {}, "Move breakpoints to nearest code."},
-    {"language", OptionValue::eTypeLanguage, false, eLanguageTypeUnknown,
-     nullptr, {},
-     "The language to use when interpreting expressions entered in commands."},
-    {"expr-prefix", OptionValue::eTypeFileSpec, false, 0, nullptr, {},
-     "Path to a file containing expressions to be prepended to all "
-     "expressions."},
-    {"prefer-dynamic-value", OptionValue::eTypeEnum, false,
-     eDynamicDontRunTarget, nullptr, OptionEnumValues(g_dynamic_value_types),
-     "Should printed values be shown as their dynamic value."},
-    {"enable-synthetic-value", OptionValue::eTypeBoolean, false, true, nullptr,
-     {}, "Should synthetic values be used by default whenever available."},
-    {"skip-prologue", OptionValue::eTypeBoolean, false, true, nullptr, {},
-     "Skip function prologues when setting breakpoints by name."},
-    {"source-map", OptionValue::eTypePathMap, false, 0, nullptr, {},
-     "Source path remappings are used to track the change of location between "
-     "a source file when built, and "
-     "where it exists on the current system.  It consists of an array of "
-     "duples, the first element of each duple is "
-     "some part (starting at the root) of the path to the file when it was "
-     "built, "
-     "and the second is where the remainder of the original build hierarchy is "
-     "rooted on the local system.  "
-     "Each element of the array is checked in order and the first one that "
-     "results in a match wins."},
-    {"exec-search-paths", OptionValue::eTypeFileSpecList, false, 0, nullptr,
-     {}, "Executable search paths to use when locating executable files "
-         "whose paths don't match the local file system."},
-    {"debug-file-search-paths", OptionValue::eTypeFileSpecList, false, 0,
-     nullptr, {},
-     "List of directories to be searched when locating debug symbol files. "
-     "See also symbols.enable-external-lookup."},
-    {"clang-module-search-paths", OptionValue::eTypeFileSpecList, false, 0,
-     nullptr, {},
-     "List of directories to be searched when locating modules for Clang."},
-    {"auto-import-clang-modules", OptionValue::eTypeBoolean, false, true,
-     nullptr, {},
-     "Automatically load Clang modules referred to by the program."},
-    {"import-std-module", OptionValue::eTypeBoolean, false, false,
-     nullptr, {},
-     "Import the C++ std module to improve debugging STL containers."},
-    {"auto-apply-fixits", OptionValue::eTypeBoolean, false, true, nullptr,
-     {}, "Automatically apply fix-it hints to expressions."},
-    {"notify-about-fixits", OptionValue::eTypeBoolean, false, true, nullptr,
-     {}, "Print the fixed expression text."},
-    {"save-jit-objects", OptionValue::eTypeBoolean, false, false, nullptr,
-     {}, "Save intermediate object files generated by the LLVM JIT"},
-    {"max-children-count", OptionValue::eTypeSInt64, false, 256, nullptr,
-     {}, "Maximum number of children to expand in any level of depth."},
-    {"max-string-summary-length", OptionValue::eTypeSInt64, false, 1024,
-     nullptr, {},
-     "Maximum number of characters to show when using %s in summary strings."},
-    {"max-memory-read-size", OptionValue::eTypeSInt64, false, 1024, nullptr,
-     {}, "Maximum number of bytes that 'memory read' will fetch before "
-         "--force must be specified."},
-    {"breakpoints-use-platform-avoid-list", OptionValue::eTypeBoolean, false,
-     true, nullptr, {}, "Consult the platform module avoid list when "
-                        "setting non-module specific breakpoints."},
-    {"arg0", OptionValue::eTypeString, false, 0, nullptr, {},
-     "The first argument passed to the program in the argument array which can "
-     "be different from the executable itself."},
-    {"run-args", OptionValue::eTypeArgs, false, 0, nullptr, {},
-     "A list containing all the arguments to be passed to the executable when "
-     "it is run. Note that this does NOT include the argv[0] which is in "
-     "target.arg0."},
-    {"env-vars", OptionValue::eTypeDictionary, false, OptionValue::eTypeString,
-     nullptr, {}, "A list of all the environment variables to be passed "
-                  "to the executable's environment, and their values."},
-    {"inherit-env", OptionValue::eTypeBoolean, false, true, nullptr, {},
-     "Inherit the environment from the process that is running LLDB."},
-    {"input-path", OptionValue::eTypeFileSpec, false, 0, nullptr, {},
-     "The file/path to be used by the executable program for reading its "
-     "standard input."},
-    {"output-path", OptionValue::eTypeFileSpec, false, 0, nullptr, {},
-     "The file/path to be used by the executable program for writing its "
-     "standard output."},
-    {"error-path", OptionValue::eTypeFileSpec, false, 0, nullptr, {},
-     "The file/path to be used by the executable program for writing its "
-     "standard error."},
-    {"detach-on-error", OptionValue::eTypeBoolean, false, true, nullptr,
-     {}, "debugserver will detach (rather than killing) a process if it "
-              "loses connection with lldb."},
-    {"preload-symbols", OptionValue::eTypeBoolean, false, true, nullptr, {},
-     "Enable loading of symbol tables before they are needed."},
-    {"disable-aslr", OptionValue::eTypeBoolean, false, true, nullptr, {},
-     "Disable Address Space Layout Randomization (ASLR)"},
-    {"disable-stdio", OptionValue::eTypeBoolean, false, false, nullptr, {},
-     "Disable stdin/stdout for process (e.g. for a GUI application)"},
-    {"inline-breakpoint-strategy", OptionValue::eTypeEnum, false,
-     eInlineBreakpointsAlways, nullptr,
-     OptionEnumValues(g_inline_breakpoint_enums),
-     "The strategy to use when settings breakpoints by file and line. "
-     "Breakpoint locations can end up being inlined by the compiler, so that a "
-     "compile unit 'a.c' might contain an inlined function from another source "
-     "file. "
-     "Usually this is limited to breakpoint locations from inlined functions "
-     "from header or other include files, or more accurately "
-     "non-implementation source files. "
-     "Sometimes code might #include implementation files and cause inlined "
-     "breakpoint locations in inlined implementation files. "
-     "Always checking for inlined breakpoint locations can be expensive "
-     "(memory and time), so if you have a project with many headers "
-     "and find that setting breakpoints is slow, then you can change this "
-     "setting to headers. "
-     "This setting allows you to control exactly which strategy is used when "
-     "setting "
-     "file and line breakpoints."},
-    // FIXME: This is the wrong way to do per-architecture settings, but we
-    // don't have a general per architecture settings system in place yet.
-    {"x86-disassembly-flavor", OptionValue::eTypeEnum, false,
-     eX86DisFlavorDefault, nullptr,
-     OptionEnumValues(g_x86_dis_flavor_value_types),
-     "The default disassembly flavor to use for x86 or x86-64 targets."},
-    {"use-hex-immediates", OptionValue::eTypeBoolean, false, true, nullptr,
-     {}, "Show immediates in disassembly as hexadecimal."},
-    {"hex-immediate-style", OptionValue::eTypeEnum, false,
-     Disassembler::eHexStyleC, nullptr,
-     OptionEnumValues(g_hex_immediate_style_values),
-     "Which style to use for printing hexadecimal disassembly values."},
-    {"use-fast-stepping", OptionValue::eTypeBoolean, false, true, nullptr,
-     {}, "Use a fast stepping algorithm based on running from branch to "
-         "branch rather than instruction single-stepping."},
-    {"load-script-from-symbol-file", OptionValue::eTypeEnum, false,
-     eLoadScriptFromSymFileWarn, nullptr,
-     OptionEnumValues(g_load_script_from_sym_file_values),
-     "Allow LLDB to load scripting resources embedded in symbol files when "
-     "available."},
-    {"load-cwd-lldbinit", OptionValue::eTypeEnum, false, eLoadCWDlldbinitWarn,
-     nullptr, OptionEnumValues(g_load_current_working_dir_lldbinit_values),
-     "Allow LLDB to .lldbinit files from the current directory automatically."},
-    {"memory-module-load-level", OptionValue::eTypeEnum, false,
-     eMemoryModuleLoadLevelComplete, nullptr,
-     OptionEnumValues(g_memory_module_load_level_values),
-     "Loading modules from memory can be slow as reading the symbol tables and "
-     "other data can take a long time depending on your connection to the "
-     "debug target. "
-     "This setting helps users control how much information gets loaded when "
-     "loading modules from memory."
-     "'complete' is the default value for this setting which will load all "
-     "sections and symbols by reading them from memory (slowest, most "
-     "accurate). "
-     "'partial' will load sections and attempt to find function bounds without "
-     "downloading the symbol table (faster, still accurate, missing symbol "
-     "names). "
-     "'minimal' is the fastest setting and will load section data with no "
-     "symbols, but should rarely be used as stack frames in these memory "
-     "regions will be inaccurate and not provide any context (fastest). "},
-    {"display-expression-in-crashlogs", OptionValue::eTypeBoolean, false, false,
-     nullptr, {}, "Expressions that crash will show up in crash logs if "
-                  "the host system supports executable specific crash log "
-                  "strings and this setting is set to true."},
-    {"trap-handler-names", OptionValue::eTypeArray, true,
-     OptionValue::eTypeString, nullptr, {},
-     "A list of trap handler function names, e.g. a common Unix user process "
-     "one is _sigtramp."},
-    {"display-runtime-support-values", OptionValue::eTypeBoolean, false, false,
-     nullptr, {}, "If true, LLDB will show variables that are meant to "
-                  "support the operation of a language's runtime support."},
-    {"display-recognized-arguments", OptionValue::eTypeBoolean, false, false,
-     nullptr, {}, "Show recognized arguments in variable listings by default."},
-    {"non-stop-mode", OptionValue::eTypeBoolean, false, 0, nullptr, {},
-     "Disable lock-step debugging, instead control threads independently."},
-    {"require-hardware-breakpoint", OptionValue::eTypeBoolean, false, 0,
-     nullptr, {}, "Require all breakpoints to be hardware breakpoints."}};
-// clang-format on
+#define LLDB_PROPERTIES_target
+#include "lldb/Core/Properties.inc"
+};
 
 enum {
-  ePropertyDefaultArch,
-  ePropertyMoveToNearestCode,
-  ePropertyLanguage,
-  ePropertyExprPrefix,
-  ePropertyPreferDynamic,
-  ePropertyEnableSynthetic,
-  ePropertySkipPrologue,
-  ePropertySourceMap,
-  ePropertyExecutableSearchPaths,
-  ePropertyDebugFileSearchPaths,
-  ePropertyClangModuleSearchPaths,
-  ePropertyAutoImportClangModules,
-  ePropertyImportStdModule,
-  ePropertyAutoApplyFixIts,
-  ePropertyNotifyAboutFixIts,
-  ePropertySaveObjects,
-  ePropertyMaxChildrenCount,
-  ePropertyMaxSummaryLength,
-  ePropertyMaxMemReadSize,
-  ePropertyBreakpointUseAvoidList,
-  ePropertyArg0,
-  ePropertyRunArgs,
-  ePropertyEnvVars,
-  ePropertyInheritEnv,
-  ePropertyInputPath,
-  ePropertyOutputPath,
-  ePropertyErrorPath,
-  ePropertyDetachOnError,
-  ePropertyPreloadSymbols,
-  ePropertyDisableASLR,
-  ePropertyDisableSTDIO,
-  ePropertyInlineStrategy,
-  ePropertyDisassemblyFlavor,
-  ePropertyUseHexImmediates,
-  ePropertyHexImmediateStyle,
-  ePropertyUseFastStepping,
-  ePropertyLoadScriptFromSymbolFile,
-  ePropertyLoadCWDlldbinitFile,
-  ePropertyMemoryModuleLoadLevel,
-  ePropertyDisplayExpressionsInCrashlogs,
-  ePropertyTrapHandlerNames,
-  ePropertyDisplayRuntimeSupportValues,
-  ePropertyDisplayRecognizedArguments,
-  ePropertyNonStopModeEnabled,
-  ePropertyRequireHardwareBreakpoints,
+#define LLDB_PROPERTIES_target
+#include "lldb/Core/PropertiesEnum.inc"
   ePropertyExperimental,
 };
 
@@ -3565,25 +3357,14 @@
 
 // TargetProperties
 static constexpr PropertyDefinition g_experimental_properties[]{
-    {"inject-local-vars",
-     OptionValue::eTypeBoolean,
-     true,
-     true,
-     nullptr,
-     {},
-     "If true, inject local variables explicitly into the expression text.  "
-     "This will fix symbol resolution when there are name collisions between "
-     "ivars and local variables.  "
-     "But it can make expressions run much more slowly."},
-    {"use-modern-type-lookup",
-     OptionValue::eTypeBoolean,
-     true,
-     false,
-     nullptr,
-     {},
-     "If true, use Clang's modern type lookup infrastructure."}};
+#define LLDB_PROPERTIES_experimental
+#include "lldb/Core/Properties.inc"
+};
 
-enum { ePropertyInjectLocalVars = 0, ePropertyUseModernTypeLookup };
+enum {
+#define LLDB_PROPERTIES_experimental
+#include "lldb/Core/PropertiesEnum.inc"
+};
 
 class TargetExperimentalOptionValueProperties : public OptionValueProperties {
 public:
diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp
index 707559f..0fe9b1e 100644
--- a/lldb/source/Target/Thread.cpp
+++ b/lldb/source/Target/Thread.cpp
@@ -64,30 +64,13 @@
 }
 
 static constexpr PropertyDefinition g_properties[] = {
-    {"step-in-avoid-nodebug", OptionValue::eTypeBoolean, true, true, nullptr,
-     {},
-     "If true, step-in will not stop in functions with no debug information."},
-    {"step-out-avoid-nodebug", OptionValue::eTypeBoolean, true, false, nullptr,
-     {}, "If true, when step-in/step-out/step-over leave the current frame, "
-         "they will continue to step out till they come to a function with "
-         "debug information. Passing a frame argument to step-out will "
-         "override this option."},
-    {"step-avoid-regexp", OptionValue::eTypeRegex, true, 0, "^std::", {},
-     "A regular expression defining functions step-in won't stop in."},
-    {"step-avoid-libraries", OptionValue::eTypeFileSpecList, true, 0, nullptr,
-     {}, "A list of libraries that source stepping won't stop in."},
-    {"trace-thread", OptionValue::eTypeBoolean, false, false, nullptr, {},
-     "If true, this thread will single-step and log execution."},
-    {"max-backtrace-depth", OptionValue::eTypeUInt64, false, 300000, nullptr,
-     {}, "Maximum number of frames to backtrace."}};
+#define LLDB_PROPERTIES_thread
+#include "lldb/Core/Properties.inc"
+};
 
 enum {
-  ePropertyStepInAvoidsNoDebug,
-  ePropertyStepOutAvoidsNoDebug,
-  ePropertyStepAvoidRegex,
-  ePropertyStepAvoidLibraries,
-  ePropertyEnableThreadTrace,
-  ePropertyMaxBacktraceDepth
+#define LLDB_PROPERTIES_thread
+#include "lldb/Core/PropertiesEnum.inc"
 };
 
 class ThreadOptionValueProperties : public OptionValueProperties {