[llvm-dev] TableGen enhancements

Chris Lattner via llvm-dev llvm-dev at lists.llvm.org
Tue Sep 8 10:55:07 PDT 2020


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

> On Sep 8, 2020, at 10:14 AM, Paul C. Anagnostopoulos via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> 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.
> 
> 
> 
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



More information about the llvm-dev mailing list