[llvm-commits] TableGen: simplify TableGenMain interface.

Sean Silva silvas at purdue.edu
Tue Oct 2 21:14:30 PDT 2012


TableGenMain()'s second argument is a "dummy" class TableGenAction
which basically just has a virtual operator(). This patch set moves
the interface over to being just a function pointer, which is a lot
simpler, and fits the needs of existing users just fine. The switch
allows removing 2 files which just had dummy declarations/definitions.

In order to avoid rev-lock between the Clang and LLVM trees, the patch
set maintains the old API until all users are migrated, then removes
the old API completely. Both projects build at each intermediate step.

A description of the patches:

0001-tblgen-Put-new-TableGenMain-API-in-place.patch:
Sets up the new API by introducing a new overload of TableGenMain()
accepting the function pointer. The old API is kept in place.

0002-tblgen-Migrate-llvm-tblgen-to-new-TableGenMain-API.patch,
0003-tblgen-Migrate-clang-tblgen-to-new-TableGenMain-API.patch:
Moves {llvm,clang}-tblgen over to using the new API. This is basically
just moving a large block of code from an operator() to a free
function.

0004-tblgen-Remove-last-traces-of-old-TableGenMain-API.patch:
Removes the old API.

Review and feedback welcome. Does this look OK to commit?

-- Sean Silva
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-tblgen-Put-new-TableGenMain-API-in-place.patch
Type: application/octet-stream
Size: 2359 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121003/f17fe801/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-tblgen-Migrate-llvm-tblgen-to-new-TableGenMain-API.patch
Type: application/octet-stream
Size: 5612 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121003/f17fe801/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-tblgen-Migrate-clang-tblgen-to-new-TableGenMain-API.patch
Type: application/octet-stream
Size: 6015 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121003/f17fe801/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-tblgen-Remove-last-traces-of-old-TableGenMain-API.patch
Type: application/octet-stream
Size: 4749 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121003/f17fe801/attachment-0003.obj>


More information about the llvm-commits mailing list