[cfe-commits] [PATCH] use templates instead of creating a new class for each OS/Target combination

Török Edwin edwintorok at gmail.com
Mon Jun 29 12:19:17 PDT 2009


Hi,

The attached patch changes the Linux and FreeBSD targetinfo classes to
be templates,
allowing them to be instantiated with any target.

Besides avoiding code duplication (the LinuxX86_32TargetInfo wasn't much
different from LinuxX64_TargetInfo except it inherited from a different
class),
it also makes it easier to add support for a new target for an already
supported OS.
It also avoids the need to create a new class for each OS / Target
combination.

Please review.

If this approach  is good, then maybe the other targets should be
changed to use templates (DragonFlyBSD and OpenBSD at least).
I guess Solaris and Darwin is fixed in the number of targets they support.

Best regards,
--Edwin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: templates.patch
Type: text/x-diff
Size: 3777 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20090629/ff1d9366/attachment.patch>


More information about the cfe-commits mailing list