[cfe-commits] [PATCH] Driver: Unify CC1Options.td and Options.td

James Molloy james.molloy at arm.com
Fri Jan 27 01:44:45 PST 2012


Hi,

The attached patch changes the way CC1 options are handled, unifying the
generated enums for both driver and CC1. This:
  * Will remove duplicated CC1/Driver options, removing around 140
duplicated options.
  * Stops the need to add new compiler options in two places.
  * Paves the way for the driver to construct a CompilerInvocation instead
of manually translating options and adding defaults. When this is done it
will reduce the code in Tools.cpp drastically.

CCing Joerg so he sees this and checks it doesn't destroy his target :-)

There are only two minor functionality changes (apart from that most flags
that were not correctly forwarded by the driver now get forwarded):
  * `-cc1 -fpack-struct N` is now `-cc1 -fpack-struct=N`, because the driver
uses -fpack-struct as a Boolean flag.
  * `-cc1 -Wlarge_by_value_copy N` is now deprecated - use the equivalent
`-cc1 -Wlarge_by_value_copy=N` for the same reason as above. The tests were
using this alias anyway.

This is the first step in having only one place that arguments are parsed
for Clang. 

The patch is large mainly because of all the flags that needed to be
de-duplicated (and I also copied over the HelpText from CC1Options.td in
these cases because Options.td was sorely lacking in help text). I've
therefore attached two patches - one with everything in and one with the
CC1Options.td and Options.td files' diffs removed so you can more easily see
the less mechanical changes.

Cheers,

James
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unify_cc1options.full.patch
Type: application/octet-stream
Size: 100508 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120127/a79d223b/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unify_cc1options.reduced.patch
Type: application/octet-stream
Size: 18697 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120127/a79d223b/attachment-0001.obj>


More information about the cfe-commits mailing list