summaryrefslogtreecommitdiffstats
path: root/lldb/utils/TableGen
Commit message (Collapse)AuthorAgeFilesLines
* [lldb] Respect previously set values of LLDB_TABLEGEN_EXEAlex Langford2019-12-161-11/+13
| | | | | | | If you set LLDB_TABLEGEN_EXE in a CMake cache file or in the CMake invocation line, your setting isn't respected. Setting up the tablegen for the host will overwrite the value that we set LLDB_TABLEGEN_EXE to, which defeats the whole point of setting it in the first place.
* [LLDB] Fix inline variable only used in assertion. (NFC)Jonas Devlieghere2019-10-251-2/+1
| | | | | | | | | This prevents unused variable warning/error in -DNDEBUG builds. The variable was introduced in 5934cd11ea3e. Patch by: Shu-Chun Weng Differential revision: https://reviews.llvm.org/D69451
* [TableGen] Add asserts to make sure default values match property typeJonas Devlieghere2019-10-251-0/+16
| | | | | | This adds a few asserts to the property TableGen backend to prevent mismatches between property types and their default values. This would've prevented a copy-paste mistake we discovered downstream.
* [TableGen] Move helpers into LLDBTableGenUtils.Jonas Devlieghere2019-07-316-28/+62
| | | | | | | Instead of polluting the LLDBTableGenBackends header with helpers used by both emitters, move them into a separate files. llvm-svn: 367377
* [TableGen] Include vectorJonas Devlieghere2019-07-311-0/+1
| | | | | | Fixes "no member named 'vector' in namespace 'std'" compile error. llvm-svn: 367375
* [TableGen] Reuse typedef across emitters (NFC)Jonas Devlieghere2019-07-303-18/+14
| | | | | | | This moves the std::map typedef into the header so it can be reused by all the emitter implementations. llvm-svn: 367363
* [lldb] Also include the array definition in Properties.incJonas Devlieghere2019-07-291-0/+3
| | | | | | | | | | | | | | | | Right now our Properties.inc only generates the initializer for the options list but not the array declaration boilerplate around it. As the array definition is identical for all arrays, we might as well also let the Properties.inc generate it alongside the initializers. Unfortunately we cannot do the same for enums, as there's this magic ePropertyExperimental, which needs to come at the end to be interpreted correctly. Hopefully we can get rid of this in the future and do the same for the property enums. Differential revision: https://reviews.llvm.org/D65353 llvm-svn: 367238
* [lldb][NFC] Split emitting and parsing in LLDBOptionDefEmitterRaphael Isemann2019-07-291-42/+80
| | | | | | | | Splitting the different logic is cleaner and we it will be easier to implement the enum emitting (which otherwise would have to reimplement the Record parsing). llvm-svn: 367207
* [lldb] Also include the array definition in CommandOptions.incRaphael Isemann2019-07-281-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Right now our CommandOptions.inc only generates the initializer for the options list but not the array declaration boilerplate around it. As the array definition is identical for all arrays, we might as well also let the CommandOptions.inc generate it alongside the initializers. This patch will also allow us to generate additional declarations related to that option list in the future (e.g. a enum class representing the specific options which would make our handling code less prone). This patch also fixes a few option tables that didn't follow our naming style. Reviewers: JDevlieghere Reviewed By: JDevlieghere Subscribers: abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D65331 llvm-svn: 367186
* [lldb] Don't dynamically allocate the posix option validator.Raphael Isemann2019-07-261-1/+7
| | | | | | | | We dynamically allocate the option validator which means we can't mark this list of OptionDefinitions as constexpr. It's also more complicated than necessary. llvm-svn: 367102
* [Tablegen] Fix issues caused by incorrect escaping.Jonas Devlieghere2019-07-251-2/+2
| | | | | | | | The printEscapedString would escape newlines by their ASCII values instead of prefixing them with a `\`. Remove the escaping logic and escape the strings in the definition file. llvm-svn: 367065
* Let tablegen generate property definitionsJonas Devlieghere2019-07-254-8/+196
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [TableGen] Fix comments/headers referencing clang (NFC)Jonas Devlieghere2019-07-253-6/+7
| | | | | | | Remove references to clang's TableGen implementation. Presumably these files were originally copied over. llvm-svn: 366982
* [lldb] Fix enum value descriptionJonas Devlieghere2019-07-231-1/+1
| | | | llvm-svn: 366863
* [Utils] Add back utils directoryJonas Devlieghere2019-07-234-0/+272
| | | | | | | Due to a bug my earlier commit removed the whole utils directory: https://reviews.llvm.org/D65123 llvm-svn: 366830
* [Utils] Remove legacy scriptsJonas Devlieghere2019-07-234-272/+0
| | | | | | | As pointed out by Nathan in D65155, these scrips don't seem to serve any real need anymore. llvm-svn: 366827
* [lldb][NFC] Tablegenify breakpointRaphael Isemann2019-07-221-3/+5
| | | | llvm-svn: 366673
* [lldb] Don't double emit option groupsRaphael Isemann2019-07-181-1/+0
| | | | | | | | | We currently emit the option groups twice if Groups<[1,2,3]> is used in the tablegen. This leads to compilation errors. This patch just removes the line that accidentially emits the option group a second time. llvm-svn: 366414
* Only build lldb-tblgen if it's not a current targetNathan Lanza2019-07-181-7/+13
| | | | | | | | | | | | | | | Summary: When doing standalone builds, you could potentially be building against an llvm which also built lldb. If this were the case, you'd be attempting to build this target twice. Reviewers: xiaobai Subscribers: mgorny Differential Revision: https://reviews.llvm.org/D64847 llvm-svn: 366394
* [lldb] Let table gen create command option initializers.Raphael Isemann2019-07-124-0/+265
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
OpenPOWER on IntegriCloud