Commit Graph

325 Commits

Author SHA1 Message Date
Daniel Dunbar c1b1b4b2c9 Don't run dsymutil when making a fat executable direct source.
- Otherwise, we will end up with stray .dSYM files which don't get
   lipo'ed or removed.

 - Ideally we would run dsymutil on the result, but we don't have the
   infrastructure for that yet. Note that gcc doesn't handle this case
   either.

 - <rdar://problem/6809621> [driver] clang leaves .dSYM files lying
   around in tmp.

llvm-svn: 69951
2009-04-24 03:03:52 +00:00
Daniel Dunbar 838cbe19b7 Call ld, not collect2.
- <rdar://problem/6517382> [driver] call ld directly

llvm-svn: 69938
2009-04-23 23:17:23 +00:00
Chris Lattner 6968641ac5 rename -fprint-source-range-info -> -fdiagnostics-print-source-range-info.
Temporarily accept both of them, I'll rip out the old one after awhile.

llvm-svn: 69662
2009-04-21 05:34:31 +00:00
Daniel Dunbar 712e4dee26 Look at the TMP environment variable as well.
llvm-svn: 69638
2009-04-21 00:25:10 +00:00
Daniel Dunbar c35694da21 Also look at the TEMP environment variable as a place to put temporary
files.

llvm-svn: 69622
2009-04-20 20:28:21 +00:00
Daniel Dunbar ab8ce7cddb If defined, use TMPDIR environment variable as location for temporary files.
llvm-svn: 69609
2009-04-20 17:32:49 +00:00
Daniel Dunbar f5e9b1f5d0 Forward f[no-]dollars-in-identifiers to clang, when specified.
llvm-svn: 69549
2009-04-19 21:20:32 +00:00
Daniel Dunbar 8281bdeb4d Forward -fno-diagnostics-fixit-info to clang-cc.
llvm-svn: 69546
2009-04-19 21:09:34 +00:00
Douglas Gregor 111af7d7b4 Preliminary PCH support in the driver
llvm-svn: 69410
2009-04-18 00:34:01 +00:00
Fariborz Jahanian 493d4e080d Added -print-ivar-layout option. No change in functionality
yet.

llvm-svn: 69346
2009-04-17 03:04:15 +00:00
Daniel Dunbar f2df7c283f Driver: Allow using clang as a precompiler, even if it is an
unsupported arch.

llvm-svn: 69322
2009-04-16 23:10:13 +00:00
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