Commit Graph

314 Commits

Author SHA1 Message Date
Daniel Dunbar 092f0ccd9c Pass -fdiagnostics-show-option to clang-cc by default.
- <rdar://problem/6796848> implement -fdiagnostics-show-option

llvm-svn: 69276
2009-04-16 06:32:38 +00:00
Daniel Dunbar b4b3709c5b Driver: Forward -W* to clang, it can handle all these itself now.
Remove clang_W_Group and clang_ignored_W_Group.

llvm-svn: 69261
2009-04-16 03:44:10 +00:00
Daniel Dunbar a7b5e219bb Driver: Add --help-hidden
llvm-svn: 69171
2009-04-15 16:34:29 +00:00
Daniel Dunbar 2edd923c90 Driver: For clang, accept -fsigned-bitfields and reject
-funsigned-bitfields for now (clang defaults to -fsigned-bitfields).
 - <rdar://problem/6790309> ER: Support
   -fsigned-bitfields/-funsigned-bitfields

llvm-svn: 69131
2009-04-15 02:37:43 +00:00
Chris Lattner cac63f359e Implement support for GCC's -dD mode, which dumps -E output *and*
macro definitions.

llvm-svn: 68884
2009-04-12 01:56:53 +00:00
Daniel Dunbar b5023e90f4 Honor MACOSX_DEPLOYMENT_TARGET environment variable.
llvm-svn: 68822
2009-04-10 21:00:07 +00:00
Daniel Dunbar c8b7af89ce Driver: Forward -miphoneos-version-min to clang.
llvm-svn: 68816
2009-04-10 20:11:50 +00:00
Daniel Dunbar 8b723e299c Driver: CCC_ADD_ARGS could end up using dangling pointers.
llvm-svn: 68805
2009-04-10 18:32:59 +00:00
Daniel Dunbar d067f7fbef Driver: Split out CPP specific options for clang so that we don't end
up adding them twice when running with -no-integrated-cpp or
-save-temps.
 - <rdar://problem/6766636> -save-temps falls over with prefix headers

llvm-svn: 68660
2009-04-08 23:54:23 +00:00
Daniel Dunbar 17ddaa677e More fixes to builtin preprocessor defines.
- Add -static-define option driver can use when __STATIC__ should be
   defined (instead of __DYNAMIC__).

 - Don't set __OPTIMIZE_SIZE__ on Os, __OPTIMIZE_SIZE__ is tied to Oz.

 - Set __NO_INLINE__ following GCC 4.2.

 - Set __GNU_GNU_INLINE__ or __GNU_STDC_INLINE__ following GCC 4.2.

 - Set __EXCEPTIONS for Objective-C NonFragile ABI.

 - Set __STRICT_ANSI__ for standard conforming modes.

 - I added a clang style test case in utils for this, but its not
   particularly portable and I don't think it belongs in the test
   suite.

llvm-svn: 68621
2009-04-08 18:03:55 +00:00
Daniel Dunbar ad0f62b203 Darwin ld: Unconditionally add -lstdc++ if we are pretending to be
g++.

llvm-svn: 68601
2009-04-08 06:06:21 +00:00
Daniel Dunbar 3b358a3d83 Make debug info work when using -save-temps.
- This is pretty ugly, but the most obvious solution. Chime in if you
   have a nicer one.

 - The problem is that with -save-temps, clang-cc has no idea what the
   name of the original input file is. However, the user expects to be
   able to set breakpoints based on the input file name.

 - We support this by providing a new option -main-file-name (similar
   to -dumpbase used by gcc) which allows the driver to pass in the
   original file name.

 - <rdar://problem/6753383> building with clang using --save-temps
   gets the compile unit name from the .i file...

llvm-svn: 68595
2009-04-08 05:11:16 +00:00
Daniel Dunbar ab7b2f5623 Set __PIC__ (more) correctly.
- Add -pic-level clang-cc option to specify the value for the define,
   updated driver to pass this.

 - Added __pic__

 - Added OBJC_ZEROCOST_EXCEPTIONS define while I was here (to match gcc).

llvm-svn: 68584
2009-04-08 03:03:23 +00:00
Daniel Dunbar d4510f2223 Driver: Fix forwarding of -fpascal-strings.
llvm-svn: 68570
2009-04-07 23:51:44 +00:00
Daniel Dunbar c44b4ccca8 Driver: Fix forwarding of -{std,ansi,trigraphs} when there are
multiple instances of an option.

Also, removed direct -ansi support from clang-cc.

llvm-svn: 68558
2009-04-07 22:13:21 +00:00
Daniel Dunbar 3a148f2625 Driver: Forward remaining -f options to clang manually.
- Groups are really just intended to hold inherent structure of the
   options, not be abused for individual tool argument translation.

llvm-svn: 68554
2009-04-07 21:51:40 +00:00
Daniel Dunbar 9dc82a2632 Driver: Only forward last instance of -mmacosx-version-min= and
-isysroot to clang.
 - Don't forward arbitrary -i* options to clang, just the ones we know
   about.

llvm-svn: 68553
2009-04-07 21:42:00 +00:00
Daniel Dunbar d18049ab1d Driver: Manually translate a number of -f with no- variants options to
clang.
 - We will eventually want some more driver infrastructre for this
   probably.

 - For now, the clang-cc interface stays relatively the same, but we
   don't accept multiple instances anymore, or the [no-] variants
   directly.

llvm-svn: 68550
2009-04-07 21:16:11 +00:00
Daniel Dunbar 30bf11e181 Driver: Add default for ArgList::hasFlag and simplify implementation.
llvm-svn: 68549
2009-04-07 21:08:57 +00:00
Daniel Dunbar 513d500fda Driver: Explicitly warn that -pg isn't supported (even though we
aren't failing the compilation).

llvm-svn: 68540
2009-04-07 19:18:24 +00:00
Daniel Dunbar a3cfbe33da Driver: Add 'q' flag for options which shouldn't be reported as unused.
- <rdar://problem/6756295> warning about '-dynamic' argument unused
   during compilation seems incorrect

llvm-svn: 68535
2009-04-07 19:04:18 +00:00
Daniel Dunbar b2a7c062aa Driver: Fix a parsing bug where some options were matched
incorrectly. I'm blanking on the smartest way to write this search,
but we should just do the right thing when we move to TableGen.
 - <rdar://problem/6761194> [driver] -Wextra-tokens isn't parsed
   correctly

llvm-svn: 68525
2009-04-07 18:21:47 +00:00
Daniel Dunbar c790b09b81 Driver: More verbosity reduction.
- Ignore some more -W options and -[fm] options which we can somewhat
   safely ignore.

 - Recognize that -W is an alias for -Wextra

W: -Wdeclaration-after-statement -Werror-implicit-function-declaration -Wfour-char-constants -Winit-self -Wmissing-format-attribute -Wno-#warnings -Wno-comment -Wno-long-long -Wno-variadic-macros -Wold-style-definition -Wstrict-prototypes -Wunused-parameter

f: -fconstant-cfstrings -fdollars-in-identifiers -finline -finline-functions -fno-inline -fno-keep-inline-functions -fno-strict-aliasing -fobjc-atdefs -fobjc-call-cxx-cdtors -fobjc-new-property -fstack-protector

m: -mconstant-cfstrings -mfix-and-continue
llvm-svn: 68487
2009-04-07 02:59:27 +00:00
Daniel Dunbar a9bbcfa130 Driver: Handle -dumpversion, this is used by some configuration
scripts.

llvm-svn: 68418
2009-04-04 05:17:38 +00:00
Daniel Dunbar f89733cfb8 Driver: Handle properly calling dsymutil when source input is
preceeded by a linker input flag.
 - <rdar://problem/6757236> clang should make a dSYM when going
   straight from source to binary

 - This still matches gcc, but the right way to solve this would be to
   detect the situation we care about (we are compiling from source
   and linking in one step), instead of looking at the suffix of the
   input file. The Tool doesn't quite have enough information to do
   this yet, however.

 - Also, find the suffix correctly.

llvm-svn: 68417
2009-04-04 00:55:30 +00:00
Daniel Dunbar 90dd6f45cc Driver: Automatically suppress warnings for duplicate versions of
flags which were used for something.

llvm-svn: 68416
2009-04-04 00:52:26 +00:00
Daniel Dunbar f69985511d Driver: Add -Qunused-arguments option to suppress driver "unused
arguments" warning.

llvm-svn: 68410
2009-04-03 22:09:23 +00:00
Daniel Dunbar c2a7189048 Driver: Explicitly ignore -fpch-preprocess when using clang, we don't
need to do anything special to support this.

llvm-svn: 68403
2009-04-03 20:51:31 +00:00
Daniel Dunbar 6a8803a34f Driver: Add missed translation for darwin::Preprocess (gcc), -d*
wasn't being forwarded.

llvm-svn: 68365
2009-04-03 01:27:06 +00:00
Ed Schouten e33194b9d5 Add some whitespace to test my commit privileges.
Approved by:	ddunbar

llvm-svn: 68343
2009-04-02 19:13:12 +00:00
Daniel Dunbar b48a4aaec9 Driver: Tweak search paths for FreeBSD.
- Patch by Pawel Worach!

llvm-svn: 68332
2009-04-02 18:30:04 +00:00
Daniel Dunbar b0006ae76d Wire --version to normal -v version text.
llvm-svn: 68316
2009-04-02 15:05:41 +00:00
Daniel Dunbar 7803c9546b Driver: Allow -ccc-gcc-name to specify the name/path to use when
calling gcc in generic configurations.

llvm-svn: 68260
2009-04-01 23:34:41 +00:00
Daniel Dunbar 0a05d93ed6 Quick and dirty (!) fix to make sure we use powerpc in triples.
- PR3922

 - I have a clean solution for this in flight, but it may take a while
   to come to fruition so we'll take a quick fix for now.

llvm-svn: 68241
2009-04-01 20:33:11 +00:00
Daniel Dunbar d854c8d8a6 Driver: Add freebsd::Link
- Patch by Ed Schouten!

llvm-svn: 68233
2009-04-01 19:36:32 +00:00
Daniel Dunbar 2ec6e8e2ba Remove a FIXME, use -emit-pth to drive PTH generation.
-  c.f. r68164

llvm-svn: 68184
2009-04-01 03:28:10 +00:00
Daniel Dunbar ae8bca038d Tweak/cleanup darwin::Link a bit, add several FIXMES, and improve test
case.

llvm-svn: 68182
2009-04-01 03:17:40 +00:00
Daniel Dunbar 5c9c118600 Tweak darwin::Assemble and add a FIXME.
llvm-svn: 68165
2009-04-01 00:27:44 +00:00
Daniel Dunbar 7c92528530 Driver: Implement basic --help text.
- PR3875.
 - <rdar://problem/6615249> [driver] ccc should support some form of
   --help

llvm-svn: 68148
2009-03-31 21:38:17 +00:00
Daniel Dunbar 77684ead4b Driver: Add OptTable::getOptionKind.
Also, removed default value for getOptionMetaVar.

llvm-svn: 68146
2009-03-31 21:26:12 +00:00
Daniel Dunbar e521a8994c Driver: Forward -Wp, and -Xpreprocessor arguments to clang when using
the preprocessor.
 - PR3602.

 - As is inherent in the blanket forwarding options, this will only
   work if clang-cc happens to accept what the user passed. Users by
   and large should use driver options to interact with the
   preprocessor, if at all possible.

llvm-svn: 68144
2009-03-31 20:53:55 +00:00
Daniel Dunbar a207254f94 Driver: Add extra parameters for help text to option definitions.
- Currently unused.

And yes, now may be about the time I want a TableGen backend.

llvm-svn: 68139
2009-03-31 20:12:05 +00:00
Daniel Dunbar 8eb473c477 Driver: Call 'as' directly on FreeBSD.
- Patch by Ed Schouten!

llvm-svn: 68121
2009-03-31 17:45:15 +00:00
Daniel Dunbar d640be24fd (LLVM up) Update to use llvm::sys::getHostTriple().
- Always pass -triple to clang-cc (-arch will be removed).

 - clang-cc doesn't play guess work with the target triple anymore.

llvm-svn: 68119
2009-03-31 17:35:15 +00:00
Daniel Dunbar cbe5b2f800 Comment fix.
llvm-svn: 68069
2009-03-30 22:11:38 +00:00
Daniel Dunbar e24297c6b5 Driver: Sketch FreeBSD tool chain.
- Patch by Ed Schouten!

llvm-svn: 68061
2009-03-30 21:06:03 +00:00
Daniel Dunbar 13357aef14 Driver: Unbreak ArgList::hasFlag.
- <rdar://problem/6726511> [driver] clang does not have -msoft-float
   hooked up.

llvm-svn: 68044
2009-03-30 18:13:26 +00:00
Daniel Dunbar 759b1c9b80 Fix -MD with no -MT when -o is specified (and fix test case).
llvm-svn: 68042
2009-03-30 17:59:58 +00:00
Daniel Dunbar d67a32252c Driver: Support -M and -MM.
- Not particularly elegant, but my hand is forced by gcc.

Also, tweak -ccc-print-bindings output.

llvm-svn: 68027
2009-03-30 06:36:42 +00:00
Daniel Dunbar 52e96cc932 Improve dependency file support.
- Rip out various bits of logic from clang-cc's dependency file gen,
   force driver to provide instead.

 - -MD output now goes to proper location
<rdar://problem/6723948> clang -MD puts dep file in /tmp with wrong name

 - -M and -MM still don't work correctly.

llvm-svn: 68022
2009-03-30 00:34:04 +00:00