Paul C. Anagnostopoulos via llvm-dev
2020-Sep-08 17:14 UTC
[llvm-dev] 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> 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
Paul C. Anagnostopoulos via llvm-dev
2020-Sep-08 18:09 UTC
[llvm-dev] TableGen enhancements
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? At 9/8/2020 01:55 PM, Chris Lattner wrote:>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