[Lldb-commits] [PATCH] D65185: Let tablegen generate property definitions

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 24 09:42:29 PDT 2019

JDevlieghere added a comment.

In D65185#1599262 <https://reviews.llvm.org/D65185#1599262>, @labath wrote:

> .def files can omit fields too: `#define BOOL_PROPERTY(name, global, default, desc) PROPERTY(name, OptionValue::eTypeBoolean, global, default, nullptr, {}, desc)`. Some sanity checking sounds like it could be useful, but I'm not exactly sure what kind of checks you have in mind. Being able to change the representation is nice, but I expect most of those changes would also be achievable with the def files. More radical changes (like the variable thing I mentioned) would probably require changes regardless of how the properties are generated...

I agree with you and I'm not opposed to def-files at all. I think tablegen and `.def` files have different trade-offs and while the latter could probably work for properties, I have the feeling that tablegen is a better fit. The things are mentioned before are just a few things that came to mind.

To give an example of sanity checking: this isn't in the patch (yet) but with tablegen we can ensure that every option has either a default unsigned or string value. In the table you can't differentiate between a default `0` and an explicit default value of `0`.



More information about the lldb-commits mailing list