summaryrefslogtreecommitdiff
path: root/lldb/utils/TableGen/LLDBPropertyDefEmitter.cpp
AgeCommit message (Collapse)Author
2025-05-17[lldb] Use llvm::replace (NFC) (#140343)Kazu Hirata
2024-09-09[LLDB][TableGen] Migrate lldb-tblgen to use const RecordKeeper (#107536)Rahul Joshi
Migrate LLDB TableGen backend to use const RecordKeeper. This is a part of effort to have better const correctness in TableGen backends: https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2023-09-26[llvm][tblgen] Add `Source Filename` for `emitSourceFileHeader` (#65744)Shao-Ce SUN
I think this is very helpful for reading generated `.inc` files.
2020-03-20[lldb]/Tablegen] Use ElementType instead of DefaultValueUnsingedJonas Devlieghere
The fourth field in the property struct is the default unsigned or enum value for all types, except for Array and Dictionary types. For those, it is the element type. During the tablegen conversion, this was incorrectly translated to DefaultValueUnsigned with a value corresponding to the OptionValue: enum type. So for OptionValue::eTypeString this became DefaultUnsignedValue<16>. This patch extends the tablegen backend to understand ElementType to express this as ElementType<"String">. Differential revision: https://reviews.llvm.org/D76535
2019-10-25[LLDB] Fix inline variable only used in assertion. (NFC)Jonas Devlieghere
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
2019-10-25[TableGen] Add asserts to make sure default values match property typeJonas Devlieghere
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.
2019-07-31[TableGen] Move helpers into LLDBTableGenUtils.Jonas Devlieghere
Instead of polluting the LLDBTableGenBackends header with helpers used by both emitters, move them into a separate files. llvm-svn: 367377
2019-07-30[TableGen] Reuse typedef across emitters (NFC)Jonas Devlieghere
This moves the std::map typedef into the header so it can be reused by all the emitter implementations. llvm-svn: 367363
2019-07-29[lldb] Also include the array definition in Properties.incJonas Devlieghere
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
2019-07-25[Tablegen] Fix issues caused by incorrect escaping.Jonas Devlieghere
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
2019-07-25Let tablegen generate property definitionsJonas Devlieghere
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