TableGen enhancements

I spent some time playing with TableGen in order to improve the ability of backends to generate error messages with more precise source locations. The main requirement was to add a slot to the RecordVal class to hold the source location of the statement that defined the field. To make that easier to use, I added a third PrintFatalError() method that accepts a RecordVal and grabs the source location from it.

To test these ideas, I worked on the SearchableTable backend. It now includes in every message at least the record location and often the field definition location. I also reworded some message to make them more consistent.

I will submit a patch to Phabricator soon. The problem now is that every backend has to be modified to take advantage of these changes. I plan to start working on a document about how to write a TableGen backend.

Very nice Paul!

I think your approach makes sense. First we need the generic infrastructure to preserve more location information, then each of the backends will need to be updated to take advantage of it.

This will make a lot of developer’s live better, thank you for working on this!

-Chris

I'm happy to give this some attention.

Can you or someone else recommend a moderate-size backend that doesn't have a lot of work going on now, as a second backend to try to improve its error messages?