summaryrefslogtreecommitdiffstats
path: root/lldb/utils/TableGen/LLDBPropertyDefEmitter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [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-311-11/+3
| | | | | | | Instead of polluting the LLDBTableGenBackends header with helpers used by both emitters, move them into a separate files. llvm-svn: 367377
* [TableGen] Reuse typedef across emitters (NFC)Jonas Devlieghere2019-07-301-6/+3
| | | | | | | 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
* [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-251-0/+173
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
OpenPOWER on IntegriCloud