Commit Graph

286 Commits

Author SHA1 Message Date
Daniel Dunbar a442fd5da6 Driver: Fix arg_iterator typing to reflect that it is really an iterator over Arg*s.
llvm-svn: 105838
2010-06-11 22:00:13 +00:00
Jeffrey Yasskin 2b99c6fc4f Add an option -fshow-overloads=best|all to limit the number of overload
candidates printed.  We default to 'all'.  At the moment, 'best' prints only
the first 4 overloads, but we'll improve that over time.

llvm-svn: 105815
2010-06-11 05:57:47 +00:00
Jeffrey Yasskin 460aa54d0a Implement -fcaret-diagnostics to undo -fno-caret-diagnostics.
llvm-svn: 105597
2010-06-08 04:56:20 +00:00
Daniel Dunbar 24e52992c0 Driver: Support invoking Clang on .ll or .bc inputs.
- We actually pretend that we have two separate types for LLVM assembly/bitcode because we need to use the standard suffixes with LTO ('clang -O4 -c t.c' should generate 't.o').

It is now possible to do something like:
  $ clang -emit-llvm -S t.c -o t.ll ... assorted other compile flags ...
  $ clang -c t.ll -o t.o ... assorted other compile flags ...
and expect that the output will be almost* identical to:
  $ clang -c t.c -o t.o ... assorted other compile flags ...
because all the target settings (default CPU, target features, etc.) will all be initialized properly by the driver/frontend.

*: This isn't perfect yet, because in practice we will end up running the optimization passes twice. It's possible to get something equivalent out with a well placed -mllvm -disable-llvm-optzns, but I'm still thinking about the cleanest way to solve this problem more generally.

llvm-svn: 105584
2010-06-07 23:28:45 +00:00
Daniel Dunbar 7f3d95054b Driver: Change -dwarf-debug-flags option to pass the original command line
arguments after translation, instead of the -cc1 level arguments.

llvm-svn: 105476
2010-06-04 18:47:06 +00:00
Daniel Dunbar 6beaf5110f Driver/Darwin: Model dsymutil properly, as a separate action/tool kind which is
added as the last output step, instead of just hacking it into the link step.
 - Among other things, this fixes dSYM generation when using multiple -arch options.

llvm-svn: 105475
2010-06-04 18:28:41 +00:00
Daniel Dunbar 8829962030 Driver: Add an explicit dsymutil action.
llvm-svn: 105474
2010-06-04 18:28:36 +00:00
Daniel Dunbar 99ca8b71cd Driver: Spell -relax-all correctly when calling the cc1as tool.
llvm-svn: 104955
2010-05-28 16:43:21 +00:00
Daniel Dunbar 9296f63ff0 Driver: Update -O -> -O2 replacement for addition of -O0 option.
llvm-svn: 104823
2010-05-27 06:51:08 +00:00
Daniel Dunbar 06e2cc3f86 Driver: Add support for -m[no-]relax-all, and make it the default at -O0.
llvm-svn: 104815
2010-05-27 06:18:05 +00:00
Chandler Carruth e039148801 Daniel re-educated me about what Alias does and does not do. Turn that off for
'-fasm' and explicitly map from that flag to -fgnu-keywords in the driver. Turn
off the driver in the lexer test for this madness and add a test to the driver
that the translation actually works.

llvm-svn: 104428
2010-05-22 02:21:53 +00:00
Daniel Dunbar 4f5e79c67d Driver: Add a tool definition for the Clang integrated assembler.
llvm-svn: 104280
2010-05-20 21:30:13 +00:00
Ted Kremenek bd7b3ccbf8 Expose -fobjc-nonfragile-abi2 as a top-level clang driver option. Fixes <rdar://problem/8007063>.
llvm-svn: 104205
2010-05-20 02:12:37 +00:00
Daniel Dunbar 0d8ca9e91a Driver: Make -fverbose-asm the default for platforms where the integrated
assembler defaults to on.

llvm-svn: 103825
2010-05-14 22:00:22 +00:00
Daniel Dunbar fcc49a8f1f Driver/Darwin/i386: Don't allow compiling C++ with -fapple-kext, we don't support the necessary ABI yet.
llvm-svn: 103632
2010-05-12 18:19:58 +00:00
Daniel Dunbar 4083d044e1 Simplify.
llvm-svn: 103631
2010-05-12 18:19:55 +00:00
Rafael Espindola 66bfb27545 Handle -ffunction-sections and -fdata-sections in the driver.
llvm-svn: 103197
2010-05-06 21:06:04 +00:00
Chandler Carruth a77a72734c Remove a dependency on Frontend headers in the Driver library. Also saves
building and passing arguments to cc1 layer when setting values to their
defaults.

llvm-svn: 103162
2010-05-06 04:55:18 +00:00
Chris Lattner bf6fac8415 add a new -fdiagnostics-show-category=none/id/name option, giving control
over choice of:

t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat]
t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat,1]
t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat,Format String]

dox to come.

llvm-svn: 103056
2010-05-04 21:55:25 +00:00
Douglas Gregor cd121fb013 Introduce a limit on the depth of the macro instantiation backtrace
printed in a diagnostic, similar to the limit we already have on the
depth of the template instantiation backtrace. The macro instantiation
backtrace is limited to 10 "instantiated from:" diagnostics; when it's
longer than that, we'll show the first half, then say how many were
suppressed, then show the second half. The limit can be changed with
-fmacro-instantiation-limit=N, and turned off with N=0.

This eliminates a lot of note spew with libraries making use of the
Boost.Preprocess library.

llvm-svn: 103014
2010-05-04 17:13:42 +00:00
Ted Kremenek d8a23f988d Do not enable '-analyze-check-security-syntactic' by default when using '--analyze'. There
are several known issues to address for it should be turned on by default.

llvm-svn: 102664
2010-04-29 22:50:22 +00:00
Daniel Dunbar 12c82080a2 Driver: Add support for -fobjc-abi-version=.
- <rdar://problem/7919678>

llvm-svn: 102559
2010-04-28 23:25:24 +00:00
Daniel Dunbar 2cb4e7a872 Simplify.
llvm-svn: 102432
2010-04-27 15:35:03 +00:00
Daniel Dunbar 34d7a99062 Add Driver support for -fno-constant-cfstrings.
llvm-svn: 102431
2010-04-27 15:34:57 +00:00
Daniel Dunbar fca18c1b41 NeXT: Clean up dispatch method policy selection.
- Replace -cc1 level -fobjc-legacy-dispatch with -fobjc-dispatch-method={legacy,non-legacy,mixed}.

 - Lift "mixed" vs "non-mixed" policy choice up to driver level, instead of being buried in CGObjCMac.cpp.

 - No intended functionality change.

llvm-svn: 102255
2010-04-24 17:56:46 +00:00
Daniel Dunbar db059592fe Simplify.
llvm-svn: 102254
2010-04-24 17:56:39 +00:00
Douglas Gregor ffed1cb339 Introduce a limit on the depth of the template instantiation backtrace
we will print with each error that occurs during template
instantiation. When the backtrace is longer than that, we will print
N/2 of the innermost backtrace entries and N/2 of the outermost
backtrace entries, then skip the middle entries with a note such as:

  note: suppressed 2 template instantiation contexts; use
  -ftemplate-backtrace-limit=N to change the number of template
  instantiation entries shown

This should eliminate some excessively long backtraces that aren't
providing any value.

llvm-svn: 101882
2010-04-20 07:18:24 +00:00
Chandler Carruth e03aa55bfd Add support for '-fgnu-keywords' and '-fasm' to Clang's driver. They are not
implemented precisely the same as GCC, but the distinction GCC makes isn't
useful to represent. This allows parsing code which uses GCC-specific keywords
('asm', etc.) without parsing in a fully GNU mode.

llvm-svn: 101667
2010-04-17 20:17:31 +00:00
Daniel Dunbar 88534f4201 Driver: Add missing claim() for -mllvm options.
llvm-svn: 101618
2010-04-17 06:10:00 +00:00
Daniel Dunbar 3e0cac6f20 Tidy up comment.
llvm-svn: 101357
2010-04-15 06:18:42 +00:00
Daniel Dunbar 76fa840d09 Driver/Frontend: Add support for -mllvm, which forwards options to the LLVM option parser.
- Note that this is a behavior change, previously -mllvm at the driver level forwarded to clang -cc1. The driver does a little magic to make sure that '-mllvm -disable-llvm-optzns' works correctly, but other users will need to be updated to use -Xclang.

llvm-svn: 101354
2010-04-15 06:09:03 +00:00
Chris Lattner b986aba6db add haiku support, patch by Paul Davey!
llvm-svn: 100982
2010-04-11 19:29:39 +00:00
Daniel Dunbar 16334e143f Driver: Ignore -fobjc-gc and -fobjc-gc-only for platforms which don't support them.
llvm-svn: 100930
2010-04-10 16:20:23 +00:00
John McCall dfea9989ef Turn access control on by default in the driver.
llvm-svn: 100882
2010-04-09 19:12:06 +00:00
John McCall 3155f573f5 Turn access control on by default in -cc1.
Remove -faccess-control from -cc1; add -fno-access-control.
Make the driver pass -fno-access-control by default.
Update a bunch of tests to be correct under access control.

llvm-svn: 100880
2010-04-09 19:03:51 +00:00
Benjamin Kramer f41ccef5eb Remove caseless switch.
llvm-svn: 100770
2010-04-08 15:44:22 +00:00
Chris Lattner b35583df52 add a new driver-level -ferror-limit=412 option, which causes clang to stop
emitting diagnostics after it has produced that many errors.  Give this a
default value of 20 which produces plenty of errors for people to fix before
recompiling but not so many that their entire console scrolls away when the
compiler gets confused.  The experience looks like this:

$ clang foo.c
<tons of crap>
foo.c:102:3: error: unknown type name 'somethingbad'
  somethingbad x;
  ^
fatal error: too many errors emitted, stopping now
36 warnings and 20 errors generated.

llvm-svn: 100689
2010-04-07 20:49:23 +00:00
Chris Lattner bf2803fb20 add support for -MQ flag to quote targets in dependency file,
PR6661, patch by Ori Avtalion!

llvm-svn: 99821
2010-03-29 17:55:58 +00:00
Douglas Gregor 64b046fce4 Implement support for -nostdc++. Fixes PR6446.
llvm-svn: 99417
2010-03-24 20:13:48 +00:00
Ted Kremenek fe449a24a8 Disable the emission of frontend warnings (not errors) under --analyze.
Fixes <rdar://problem/7405601>.

llvm-svn: 99222
2010-03-22 22:32:05 +00:00
Daniel Dunbar e46b52a35f Driver: Fix a number of -fapple-kext issues:
- Disable RTTI.
 - Disable use of __cxa_atexit.
 - Disable unwind tables.
 - Enable freestanding mode.

Also, honor -fhosted correctly.

<rdar://problem/7515383> C++ support: -fapple-kext not honored

llvm-svn: 99041
2010-03-20 04:52:14 +00:00
Daniel Dunbar fe06df4bf3 C++: Add support for -fno-use-cxa-atexit.
- So much typing, so little gain...

Also, rename the __cxx_global_initialization function just to match llvm-gcc.

llvm-svn: 99039
2010-03-20 04:15:41 +00:00
Daniel Dunbar 47d25b18db Driver: Fix possible crash when targetting an unknown (unsupported) Darwin
platform, e.g. ppc.

llvm-svn: 99016
2010-03-20 00:50:21 +00:00
John McCall 59bb1d4657 Make -faccess-control and -fno-access-control driver options.
llvm-svn: 98703
2010-03-17 01:32:13 +00:00
Daniel Dunbar 35621a9dcc Driver: Fix forwarding of -fno-lax-vector-conversions.
llvm-svn: 98639
2010-03-16 16:57:46 +00:00
Rafael Espindola 08a692aba4 Don't produce debug info when given -g. Fixes PR6529.
llvm-svn: 97897
2010-03-07 04:46:18 +00:00
Eric Christopher 0b26a616eb Add in some more MIPS command line options.
Patch by Oleksandr Tymoshenko!

llvm-svn: 97544
2010-03-02 02:41:08 +00:00
Blaine Garst fc83aa04db Unconditionally support block introspection data in a new field at the end
of the block descriptor field.  This field is the ObjC style @encode
signature of the implementation function, and was to this point
conditionally provided in the block literal data structure.  That
provisional support is removed.

Additionally, eliminate unused enumerations for the block literal flags field.
The first shipping ABI unconditionally set (1<<29) but this bit is unused
by the runtime, so the second ABI will unconditionally have (1<<30) set so
that the runtime can in fact distinguish whether the additional data is
present or not.

llvm-svn: 96989
2010-02-23 21:51:17 +00:00
John McCall 8517abc30d Enable -mconstructor-aliases by default on non-darwin platforms.
The linker bug holding this back is Darwin-specific.

llvm-svn: 96655
2010-02-19 02:45:38 +00:00
Daniel Dunbar 4b8ef28400 Driver: Tweak freebsd::Link, by Roman Divacky.
llvm-svn: 96469
2010-02-17 08:07:51 +00:00