Tablgen refactoring

Malul, Elior elior.malul at intel.com
Thu Jan 31 04:05:03 PST 2013


Hi all.
Attached is a re-factoring patch for tblgen. At the moment, adding a new initializer type (T), requires that a new method 'convertValue(T*): Init*'
will be added to all subtypes of RecTy, as well as to the new added type. Moreover, the new class that represents the prototype of T (i.e. 'TRecTy'), will need
to have all the previous overloads of 'convertValue' for every type out there.

This process makes the addition of new types cumbersome, and requires a lot of 'copy pasting' to existing code.
In this patch, I used the visitor pattern to solve this problem.
In an attempt to make the patch small in size, I only dealt with one method at the moment: 'convertValue(UnsetInit*): Init*'.
Removing the other overloads should be pretty much the same.

I would appreciate CR's on this.
Thx a lot, Elior.

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: tblgen.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130131/54c005cd/attachment.ksh>


More information about the llvm-commits mailing list