llvm-capstone/lldb/utils
Raphael Isemann 6f4fb4e7ad [lldb] Let table gen create command option initializers.
Summary:
We currently have man large arrays containing initializers for our command options.
These tables are tricky maintain as we don't have any good place to check them for consistency and
it's also hard to read (`nullptr, {}, 0` is not very descriptive).

This patch fixes this by letting table gen generate those tables. This way we can have a more readable
syntax for this (especially for all the default arguments) and we can let TableCheck check them
for consistency (e.g. an option with an optional argument can't have `eArgTypeNone`, naming of flags', etc.).

Also refactoring the related data structures can now be done without changing the hundred of option initializers.

For example, this line:
```
{LLDB_OPT_SET_ALL, false, "hide-aliases",         'a', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Hide aliases in the command list."},
```
becomes this:
```
  def hide_aliases : Option<"hide-aliases", "a">, Desc<"Hide aliases in the command list.">;
```

For now I just moved a few initializers to the new format to demonstrate the change. I'll slowly migrate the other
option initializers tables  in separate patches.

Reviewers: JDevlieghere, davide, sgraenitz

Reviewed By: JDevlieghere

Subscribers: jingham, xiaobai, labath, mgorny, abidh, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D64365

llvm-svn: 365908
2019-07-12 15:30:55 +00:00
..
git-svn Python 2/3 compat: StringIO 2019-03-25 15:23:34 +00:00
lit-cpuid [CMake] Folder structure for generated Xcode project to cover more targets 2019-05-28 09:29:05 +00:00
lldb-dotest [CMake] Fix lldb-dotest for single-config generators in standalone builds 2019-06-13 17:35:43 +00:00
lui Python 2/3 compat: StringIO 2019-03-25 15:23:34 +00:00
misc Python 2/3 compat: StringIO 2019-03-25 15:23:34 +00:00
sync-source Python 2/3 compat: StringIO 2019-03-25 15:23:34 +00:00
TableGen [lldb] Let table gen create command option initializers. 2019-07-12 15:30:55 +00:00
test Python 2/3 compat: StringIO 2019-03-25 15:23:34 +00:00
vim-lldb Python 2/3 compatibility: from __future__ import print_function 2019-03-21 18:27:40 +00:00