From 7070a0b02a915a2ae60fee442e13b447ef742e71 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Fri, 26 Jul 2019 18:14:04 +0000 Subject: [PATCH] [TableGen] Move interpreter properties into a separate file (NFC) With the plugins having their own tablgen file, it makes sense to split off the interpreter properties as well. llvm-svn: 367138 --- lldb/CMakeLists.txt | 6 +++--- lldb/include/lldb/Core/Properties.td | 28 -------------------------- lldb/source/Interpreter/CMakeLists.txt | 12 ++++++++++- lldb/source/Interpreter/CommandInterpreter.cpp | 4 ++-- lldb/source/Interpreter/Properties.td | 28 ++++++++++++++++++++++++++ 5 files changed, 44 insertions(+), 34 deletions(-) create mode 100644 lldb/source/Interpreter/Properties.td diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt index 6d567b3..231e441 100644 --- a/lldb/CMakeLists.txt +++ b/lldb/CMakeLists.txt @@ -52,14 +52,14 @@ if(CMAKE_CROSSCOMPILING AND LLDB_BUILT_STANDALONE) -DClang_DIR=${NATIVE_Clang_DIR}) endif() +# TableGen add_subdirectory(utils/TableGen) +add_subdirectory(include/lldb/Core) + add_subdirectory(source) add_subdirectory(tools) add_subdirectory(docs) -# Needed by tablegen. -add_subdirectory(include/lldb/Core) - option(LLDB_INCLUDE_TESTS "Generate build targets for the LLDB unit tests." ${LLVM_INCLUDE_TESTS}) option(LLDB_TEST_USE_CUSTOM_C_COMPILER "Use the C compiler provided via LLDB_TEST_C_COMPILER for building test inferiors (instead of the just-built compiler). Defaults to OFF." OFF) option(LLDB_TEST_USE_CUSTOM_CXX_COMPILER "Use the C++ compiler provided via LLDB_TEST_CXX_COMPILER for building test inferiors (instead of the just-built compiler). Defaults to OFF." OFF) diff --git a/lldb/include/lldb/Core/Properties.td b/lldb/include/lldb/Core/Properties.td index de7f8b4..66d7d9f 100644 --- a/lldb/include/lldb/Core/Properties.td +++ b/lldb/include/lldb/Core/Properties.td @@ -349,31 +349,3 @@ let Definition = "debugger" in { DefaultStringValue<"frame #${frame.index}: ${ansi.fg.yellow}${frame.pc}${ansi.normal}{ ${module.file.basename}{`${function.name-without-args}{${frame.no-debug}${function.pc-offset}}}}{ at ${ansi.fg.cyan}${line.file.basename}${ansi.normal}:${ansi.fg.yellow}${line.number}${ansi.normal}{:${ansi.fg.yellow}${line.column}${ansi.normal}}}{${function.is-optimized} [opt]}{${frame.is-artificial} [artificial]}\\\\n">, Desc<"The default frame format string to use when displaying stack frameinformation for threads from thread backtrace unique.">; } - - -let Definition = "commandinterpreter" in { - def ExpandRegexAliases: Property<"expand-regex-aliases", "Boolean">, - Global, - DefaultFalse, - Desc<"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.">; - def PromptOnQuit: Property<"prompt-on-quit", "Boolean">, - Global, - DefaultTrue, - Desc<"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.">; - def StopCmdSourceOnError: Property<"stop-command-source-on-error", "Boolean">, - Global, - DefaultTrue, - Desc<"If true, LLDB will stop running a 'command source' script upon encountering an error.">; - def SpaceReplPrompts: Property<"space-repl-prompts", "Boolean">, - Global, - DefaultFalse, - Desc<"If true, blank lines will be printed between between REPL submissions.">; - def EchoCommands: Property<"echo-commands", "Boolean">, - Global, - DefaultTrue, - Desc<"If true, commands will be echoed before they are evaluated.">; - def EchoCommentCommands: Property<"echo-comment-commands", "Boolean">, - Global, - DefaultTrue, - Desc<"If true, commands will be echoed even if they are pure comment lines.">; -} diff --git a/lldb/source/Interpreter/CMakeLists.txt b/lldb/source/Interpreter/CMakeLists.txt index 987ad47..ece88b1 100644 --- a/lldb/source/Interpreter/CMakeLists.txt +++ b/lldb/source/Interpreter/CMakeLists.txt @@ -1,3 +1,11 @@ +lldb_tablegen(Properties.inc -gen-lldb-property-defs + SOURCE Properties.td + TARGET LLDBInterpreterPropertiesGen) + +lldb_tablegen(PropertiesEnum.inc -gen-lldb-property-enum-defs + SOURCE Properties.td + TARGET LLDBInterpreterPropertiesEnumGen) + add_lldb_library(lldbInterpreter CommandAlias.cpp CommandHistory.cpp @@ -56,7 +64,9 @@ add_lldb_library(lldbInterpreter Support ) -add_dependencies(lldbInterpreter LLDBPropertiesGen LLDBPropertiesEnumGen) +add_dependencies(lldbInterpreter + LLDBInterpreterPropertiesGen + LLDBInterpreterPropertiesEnumGen) if (NOT LLDB_DISABLE_LIBEDIT) target_include_directories(lldbInterpreter PRIVATE ${libedit_INCLUDE_DIRS}) diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index e84fe57..f171c8b 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -91,12 +91,12 @@ static constexpr const char *InitFileWarning = static constexpr PropertyDefinition g_properties[] = { #define LLDB_PROPERTIES_commandinterpreter -#include "lldb/Core/Properties.inc" +#include "Properties.inc" }; enum { #define LLDB_PROPERTIES_commandinterpreter -#include "lldb/Core/PropertiesEnum.inc" +#include "PropertiesEnum.inc" }; ConstString &CommandInterpreter::GetStaticBroadcasterClass() { diff --git a/lldb/source/Interpreter/Properties.td b/lldb/source/Interpreter/Properties.td new file mode 100644 index 0000000..9ca722e --- /dev/null +++ b/lldb/source/Interpreter/Properties.td @@ -0,0 +1,28 @@ +include "../../include/lldb/Core/PropertiesBase.td" + +let Definition = "commandinterpreter" in { + def ExpandRegexAliases: Property<"expand-regex-aliases", "Boolean">, + Global, + DefaultFalse, + Desc<"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.">; + def PromptOnQuit: Property<"prompt-on-quit", "Boolean">, + Global, + DefaultTrue, + Desc<"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.">; + def StopCmdSourceOnError: Property<"stop-command-source-on-error", "Boolean">, + Global, + DefaultTrue, + Desc<"If true, LLDB will stop running a 'command source' script upon encountering an error.">; + def SpaceReplPrompts: Property<"space-repl-prompts", "Boolean">, + Global, + DefaultFalse, + Desc<"If true, blank lines will be printed between between REPL submissions.">; + def EchoCommands: Property<"echo-commands", "Boolean">, + Global, + DefaultTrue, + Desc<"If true, commands will be echoed before they are evaluated.">; + def EchoCommentCommands: Property<"echo-comment-commands", "Boolean">, + Global, + DefaultTrue, + Desc<"If true, commands will be echoed even if they are pure comment lines.">; +} -- 2.7.4