Fix the '-fuse-init-array' option to actually be an option.
authorChandler Carruth <chandlerc@gmail.com>
Wed, 21 Nov 2012 23:40:23 +0000 (23:40 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Wed, 21 Nov 2012 23:40:23 +0000 (23:40 +0000)
commit05fb585a364bab49f09a62d0e5a6a29f5c29c4e1
tree259bf3e72113d16c19c90ce96460034ee319a46e
parentb05cb67b81550c31ac7af441b5aabfc88d3576ea
Fix the '-fuse-init-array' option to actually be an option.

Previously, this flag to CC1 was never exposed at the clang driver
layer, and if you happened to enable it (by being on Android or GCC 4.7
platform), you couldn't *disable* it, because there was no 'no' variant.
The whole thing was confusingly implemented.

Now, the target-specific flag processing gets the driver arg list, and
we use standard hasFlag with a default based on the GCC version and/or
Android platform. The user can still pass the 'no-' variant to forcibly
disable the flag, or pass the positive variant to clang itself to enable
the flag.

The test has also been substantially cleaned up and extended to cover
these use cases.

llvm-svn: 168473
clang/include/clang/Driver/CC1Options.td
clang/include/clang/Driver/Options.td
clang/include/clang/Driver/ToolChain.h
clang/lib/Driver/ToolChain.cpp
clang/lib/Driver/ToolChains.cpp
clang/lib/Driver/ToolChains.h
clang/lib/Driver/Tools.cpp
clang/test/Driver/constructors.c