[llvm-dev] TableGen enhancements

Paul C. Anagnostopoulos via llvm-dev llvm-dev at lists.llvm.org
Tue Sep 8 10:14:33 PDT 2020


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.





More information about the llvm-dev mailing list