[PATCH] D87393: Enhance TableGen error message capabilities

Paul C. Anagnostopoulos via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 9 09:39:04 PDT 2020


Paul-C-Anagnostopoulos created this revision.
Paul-C-Anagnostopoulos added reviewers: lattner, nhaehnle.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
Paul-C-Anagnostopoulos requested review of this revision.

This is the first step in enhancing TableGen's error message capabilities. I added the source location to the RecordVal class, so that now source locations are associated with both the Record and RecordVal classes. This allows more precise error messages in backends. I added two PrintFatalError methods that accept a Record or a RecordVal.

As a test of this, I improved the error messages in the SearchableTableEmitter backend. Every message now includes at least the record definition location and quite often the field definition location. I also made its messages more consistent.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87393

Files:
  llvm/include/llvm/TableGen/Error.h
  llvm/include/llvm/TableGen/Record.h
  llvm/lib/TableGen/Error.cpp
  llvm/lib/TableGen/Record.cpp
  llvm/lib/TableGen/TGParser.cpp
  llvm/test/TableGen/cond-type.td
  llvm/test/TableGen/generic-tables.td
  llvm/test/TableGen/getsetop.td
  llvm/test/TableGen/if-type.td
  llvm/test/TableGen/self-reference-typeerror.td
  llvm/utils/TableGen/SearchableTableEmitter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87393.290757.patch
Type: text/x-patch
Size: 27444 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200909/c60ad36b/attachment.bin>


More information about the llvm-commits mailing list