New TableGen backend for debugging

I'd like to announce a new TableGen backend: Print Detailed Records. I hope this will help people when they are debugging complex TableGen files. It prints all the global variables, classes, and records with more detail than the default backend. In particular, it includes the source locations of the class and record definitions, and the source locations of the places where field values were set. It also includes the defm sequence for records that were generated by one or more defm statements.

You can read about it here:

https://llvm.org/docs/TableGen/BackGuide.html#the-printdetailedrecords-backend

This is really useful. Is there a way to produce this output automatically (by providing some CMake variable)? For example, something like:
-DBUILD_TBLGEN_DEBUG=

I'm glad you find it useful. I haven't thought about it being done as part of the build, nor am I any sort of build guru. What do other people think?

Hi Paul,

I'm glad you find it useful. I haven't thought about it being done as part of the build, nor am I any sort of build guru. What do other people think?

I think this overloads the build system. Our build configuration is
already full of really badly documented options (kind of general
disease of large CMake-using projects), and it removes the developer
from what's really going on. I think it would be better to

- Teach people how to invoke TableGen manually
- Teach people how to determine by themselves how TableGen is invoked
during the build

Teach a person to fish, and all that.

Cheers,
Nicolai

I certainly agree that there are a boatload of CMake options. I haven't even scratched the surface.

In keeping with your suggestion: Is there a way to tell Ninja to build just one target machine?

I certainly agree that there are a boatload of CMake options. I haven't even scratched the surface.

In keeping with your suggestion: Is there a way to tell Ninja to build just one target machine?

There's a cmake variable LLVM_TARGETS_TO_BUILD, is that what you mean?

Cheers,
Nicolai

Yes, I guess that's what I have to use. I was hoping I could tell Ninja rather than having to edit the CMake file. No biggie.