[llvm-commits] [PATCH] Enhance TableGen with ranges and fixits

Jordan Rose jordan_rose at apple.com
Mon Jan 7 11:31:44 PST 2013


Second pass at this. TableGen and SMDiagnostic are being modified to 

(a) Track anonymous definitions.
(b) Save source ranges for superclass references (for the fixits).
(c) Actually emit fixits (only support here; fixits happening in clang-tblgen)

This should be better than the previous scheme ranges should appear once per superclass per Record, which will not bloat TableGen's memory usage nearly as much as saving ranges on every DefInit. (I would have liked to do it only first the first time a superclass is mentioned, but TableGen represents multiple levels of inheritance by just copying the grandparent into the child as another superclass.) The fixits are a little worse but that's fine.

Again, I'll post the Clang side on cfe-commits soon.

Thanks!
Jordan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-TableGen-record-anonymous-instantiations-of-classes.patch
Type: application/octet-stream
Size: 4819 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130107/dea0bd7f/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Add-basic-fix-its-to-SMDiagnostic.patch
Type: application/octet-stream
Size: 13141 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130107/dea0bd7f/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-TableGen-Keep-track-of-superclass-reference-ranges.patch
Type: application/octet-stream
Size: 15386 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130107/dea0bd7f/attachment-0002.obj>
-------------- next part --------------



On Dec 11, 2012, at 9:44 , Jordan Rose <jordan_rose at apple.com> wrote:

> Hi, Jakob et al. I've been working on adding a warning to Clang-side TableGen, and realized everyone would hate it if it didn't have fixits. So I went in and added the necessary information to TableGen so that it can (a) track anonymous definitions, (b) save source ranges for DefInits (for the fixit), and (c) actually emit fixits.
> 
> The fixit work is fine, I think; it's added to SMDiagnostic, so actually any LLVM-level diagnostics could take advantage of it. My main worry is about the range-tracking info. TableGen currently doesn't do any memory management, but it does unique identical definitions. Once we're tracking source info, though, that uniquing isn't possible. Do we care, or is it okay because it's TableGen and it only runs once and then exits?
> 
> I'll post the Clang side of the patch on cfe-commits soon.
> 
> Thanks!
> Jordan
> 
> <0001-TableGen-record-anonymous-instantiations-of-classes.patch><0002-TableGen-save-source-ranges-for-DefInits.patch><0003-Add-basic-fix-its-to-SMDiagnostic.patch>



More information about the llvm-commits mailing list