Roman Divacky
5e300b82e2
Adjust the linker for PowerPC64/-m32 on FreeBSD too.
...
llvm-svn: 132635
2011-06-04 07:40:24 +00:00
Roman Divacky
00859c29bf
Make -m32 work on FreeBSD/PowerPC64.
...
llvm-svn: 132634
2011-06-04 07:37:31 +00:00
Nick Lewycky
97864dac76
On linux, -nostdlib was causing a --start-group with no --end-group to be passed
...
to the linker.
llvm-svn: 132629
2011-06-04 06:27:06 +00:00
Nick Lewycky
62188bbb90
Identifiers with _CapitalLetter are reserved, so don't use them. Prefer the
...
common C++ pattern of using the same name for the constructor argument as you
do for the member. Noticed by inspection.
llvm-svn: 132626
2011-06-04 05:19:42 +00:00
Rafael Espindola
304902141e
We were looking at /usr/lib only if the distro had multilib. This is bogus:
...
we look in /usr/lib to find crt1.o, and that depends only on where libc
is installed.
This fixes the case of using a different gcc installation in a distro
without multilib.
llvm-svn: 132551
2011-06-03 15:39:42 +00:00
Rafael Espindola
d8f92c8dcc
Add support for centos.
...
llvm-svn: 132550
2011-06-03 15:23:24 +00:00
Eric Christopher
55d4989304
80-col cleanup.
...
llvm-svn: 132543
2011-06-03 13:28:31 +00:00
NAKAMURA Takumi
8b73b3e981
Untabify and fix whitespace.
...
llvm-svn: 132531
2011-06-03 03:49:51 +00:00
Rafael Espindola
0ddfbe230f
We already have support for using c++ headers from a custom location.
...
Before this patch we would still link with the system libstdc++. It worked
fine most of the time, but would break if the used headers were a lot newer
than the system libraries.
This patch changes the driver to use the libraries corresponding to the
headers the user selected.
This fixes, for example, using 4.5 headers in a system with gcc 4.1.
llvm-svn: 132497
2011-06-02 22:18:46 +00:00
Eli Friedman
f7600949f4
Add Debian wheezy/sid to ToolChains.cpp. Patch by Michael Wild. PR10064.
...
llvm-svn: 132489
2011-06-02 21:36:53 +00:00
Rafael Espindola
9d4a8cf481
Change how we link libprofile_rt.a. While at it, refactor the code a bit.
...
llvm-svn: 132474
2011-06-02 18:58:46 +00:00
Rafael Espindola
922a624144
Add -fno-gnu89-inline.
...
llvm-svn: 132468
2011-06-02 17:30:53 +00:00
Rafael Espindola
fb2af643e4
Implement -fgnu89-inline. Fixes PR10041.
...
llvm-svn: 132460
2011-06-02 16:13:27 +00:00
Rafael Espindola
341d9b41d4
Add the necessary -L option for finding libprofile_rt.a. It might be a good
...
idea at some point to split out the directories where we install our runtime
libraries.
llvm-svn: 132425
2011-06-01 21:37:00 +00:00
Daniel Dunbar
116b305d31
Driver/Clang: Simplify code to use arch enumerations.
...
llvm-svn: 132338
2011-05-31 15:58:55 +00:00
Argyrios Kyrtzidis
0e37afa15e
A StringRef-ication of the DiagnosticIDs API and internals.
...
Patch by Matthieu Monrocq with tweaks by me to avoid StringRefs in the static
diagnostic data structures, which resulted in a huge global-var-init function.
Depends on llvm commit r132046.
llvm-svn: 132047
2011-05-25 05:05:01 +00:00
Nick Lewycky
82fe5f43d9
When given one of the applicable coverage flags, try to link against
...
libprofile_rt.a. On Darwin, don't try to link -lgcov.
llvm-svn: 132006
2011-05-24 21:54:59 +00:00
Roman Divacky
fcae03245d
Let amd64 be used in target triple instead of x86_64 on FreeBSD.
...
Patch by Dimitry Andric!
llvm-svn: 131990
2011-05-24 19:54:09 +00:00
Jim Grosbach
7c2c664500
For non-Darwin, a plain 'char' type is unsigned.
...
llvm-svn: 131967
2011-05-24 15:40:46 +00:00
Chandler Carruth
e5d9d906cb
Fix a bug in the most recent openSUSE support patch.
...
This patch also by Ismail Donmez.
llvm-svn: 131958
2011-05-24 07:51:17 +00:00
Chris Lattner
d075c82f8c
add opensuse toolchain support, patch by Ismail Donmez!
...
llvm-svn: 131857
2011-05-22 16:45:07 +00:00
Chris Lattner
84e38557e0
Add Redhat Enterprise Linux to the Linux toolchain, PR9769,
...
patch by Bryce Lelbach
llvm-svn: 131840
2011-05-22 05:36:06 +00:00
Douglas Gregor
643c922e66
Introduce the -fdiagnostics-format=xxx option to control how Clang
...
prints the file, line, and column of a diagnostic. We currently
support Clang's normal format, MSVC, and Vi formats.
Note that we no longer change the diagnostic format based on
-fms-extensions.
Patch by Andrew Fish!
llvm-svn: 131794
2011-05-21 17:07:29 +00:00
Joerg Sonnenberger
3028e46e57
Correction for r131662, the GNU as option is --fatal-warnings.
...
llvm-svn: 131671
2011-05-19 20:46:39 +00:00
Joerg Sonnenberger
b487d2d815
Support -fatal-warnings for the assembler frontend
...
llvm-svn: 131662
2011-05-19 18:42:29 +00:00
David Chisnall
b8f65e25d8
- Fixes openSUSE detection for 11.4 and upcoming 12.1
...
- Adds gcc 4.6 to gcc list so that linking will work on openSUSE 12.1
Patch by İsmail Dönmez!
llvm-svn: 131637
2011-05-19 13:26:33 +00:00
Eric Christopher
b29614b357
Add some support for RHEL5 systems.
...
llvm-svn: 131505
2011-05-17 23:06:53 +00:00
Rafael Espindola
35ab91cc89
Fix comment.
...
llvm-svn: 131478
2011-05-17 19:06:58 +00:00
Rafael Espindola
f934f98ad2
The logic about -static is darwin only. For now assume that all non
...
darwin assembler can handle cfi. Add a test.
llvm-svn: 131464
2011-05-17 16:26:17 +00:00
Joerg Sonnenberger
637603a7cc
Make the triple an explicit argument of FindTargetProgramPath.
...
Preserve the original triple in the NetBSD toolchain when using -m32 or
-m64 and the resulting effective target is different from the triple it
started with. This allows -m32 to use the same assembler/linking in
cross-compiling mode and avoids confusion about passing down target
specific flags in that case like --32.
llvm-svn: 131404
2011-05-16 13:35:02 +00:00
Daniel Dunbar
eb86b04595
Driver/Darwin: Put dsymutil -o arguments first, so that dysmutil doesn't barf
...
when POSIXLY_COMPLIANT is set.
- Patch by Dave Vasilevsky!
llvm-svn: 131084
2011-05-09 17:23:16 +00:00
Joerg Sonnenberger
ef317a27ff
Move logic for passing down -mrelax-all / -relax-all into a common
...
function. Extend the logic to check if the input was compiled.
Use -relax-all as default only if -O0 is used for compilation.
Fixes bug 9290.
llvm-svn: 130983
2011-05-06 14:35:16 +00:00
Joerg Sonnenberger
5fe4a7dc96
Rename ContainsCompileAction to ContainsCompileOrAssembleAction to
...
properly reflect its behavior.
llvm-svn: 130981
2011-05-06 14:05:11 +00:00
Nick Lewycky
85c011ddc4
Preserve the full name of the file, so that '-c -o foo.pic.o' produces
...
foo.pic.gcno instead of foo.gcno.
llvm-svn: 130899
2011-05-05 00:08:20 +00:00
Nick Lewycky
480cb9918d
Record where the GCOV data files should be placed.
...
llvm-svn: 130866
2011-05-04 20:46:58 +00:00
Nick Lewycky
36d8f05211
No, fix this use after free properly.
...
llvm-svn: 130833
2011-05-04 03:44:01 +00:00
Nick Lewycky
776586e20d
Fix use after free through StringRef.
...
llvm-svn: 130828
2011-05-04 02:06:19 +00:00
Eric Christopher
d5c45f6738
Add the -mstackrealign option which just communicates the need to
...
force align the stack to the backend.
Fixes rdar://9289631
llvm-svn: 130725
2011-05-02 21:18:22 +00:00
Daniel Dunbar
8438464b41
Driver/Darwin: Honor --sysroot= when invoking the linker, on Darwin.
...
llvm-svn: 130723
2011-05-02 21:03:47 +00:00
Rafael Espindola
4cfa7971e9
Disable CFI if not using the integrated assembler. We should probably do this only for
...
OS X, but it is probably not all that important.
llvm-svn: 130697
2011-05-02 17:43:32 +00:00
Rafael Espindola
e264187cf2
Implement -fno-dwarf2-cfi-asm.
...
llvm-svn: 130616
2011-04-30 18:35:43 +00:00
Daniel Dunbar
2f31fb99ef
Driver/Darwin: Don't link -lgcc_s.1 when compiling as iOS for the simulator,
...
that library has never been in the SDK. Fortunately, it shouldn't be necessary,
since that library was also removed in 10.6.
llvm-svn: 130595
2011-04-30 04:25:16 +00:00
Daniel Dunbar
72ceb92aa3
Driver/Darwin: When using -mios-simulator-version-min, explicitly pass this on
...
to the linker.
- Only do this explicitly with the argument for now, the linker will need to
explicitly add support for this.
llvm-svn: 130594
2011-04-30 04:22:58 +00:00
Daniel Dunbar
a9cbb6b9d5
Driver/Darwin: Reject invalid arch combinations with
...
-mios-simulator-version-min.
llvm-svn: 130593
2011-04-30 04:20:40 +00:00
Daniel Dunbar
b1189434dd
Driver/Darwin: Change Darwin toolchain to explicitly track is-ios-sim bit, and
...
update -mios-simulator-version-min to set it.
llvm-svn: 130592
2011-04-30 04:18:16 +00:00
Daniel Dunbar
9aaeb6400b
Driver/Darwin: Sketch initial support for a -mios-simulator-version-min= flag
...
and associated deployment target environment variable.
llvm-svn: 130591
2011-04-30 04:15:58 +00:00
Bob Wilson
9a5f84facb
Add -Oz option and use it to set the inline threshold to 25.
...
Radar 9333566. Patch by Chad Rosier!
llvm-svn: 130554
2011-04-29 22:49:50 +00:00
Daniel Dunbar
252e8f9ac1
Driver/cc1as: Forward -mllvm arguments when compiling assembly files.
...
llvm-svn: 130516
2011-04-29 17:53:18 +00:00
Daniel Dunbar
c44d313cff
Driver/Darwin/ld: Set the deployment target following the version information in
...
the tool chain, instead of based on the translated arguments.
llvm-svn: 130440
2011-04-28 21:23:41 +00:00
Ted Kremenek
414a2c0951
Make the top-level driver ignore -fobjc-default-synthesize-properties while this feature undergoes more review and development. This is still available as a -cc1 option for testing.
...
llvm-svn: 130424
2011-04-28 19:26:03 +00:00
Daniel Dunbar
462e7ed497
Driver: When compilation fails, don't try to remove output files we don't have
...
write access to.
llvm-svn: 130150
2011-04-25 20:43:05 +00:00
Nico Weber
adf8ba98e7
Let clang detect gcc triple on Ubuntu Natty. Patch by Thomas Jablin.
...
llvm-svn: 130119
2011-04-25 03:17:35 +00:00
Chandler Carruth
30483fb188
Move all of the logic for __DEPRECATED to the driver based on comments
...
from dgregor.
llvm-svn: 130066
2011-04-23 19:48:40 +00:00
Chandler Carruth
61fbf62838
Fix Clang's __DEPRECATED define to be controled by -Wdeprecated. This
...
matches GCC behavior which libstdc++ uses to limit #warning-based
messages about deprecation.
The machinery involves threading this through a new '-fdeprecated-macro'
flag for CC1. The flag defaults to "on", similarly to -Wdeprecated. We
turn the flag off in the driver when the warning is turned off (modulo
matching some GCC bugs). We record this as a language option, and key
the preprocessor on the option when introducing the define.
A separate flag rather than a '-D' flag allows us to properly represent
the difference between C and C++ builds (only C++ receives the define),
and it allows the specific behavior of following -Wdeprecated without
potentially impacting the set of user-provided macro flags.
llvm-svn: 130055
2011-04-23 09:27:53 +00:00
Chandler Carruth
b009b14971
There were some frustrating problems with the implementation of
...
-Wwrite-strings. First and foremost, once the positive form of the flag
was passed, it could never be disabled by passing -Wno-write-strings.
Also, the diagnostic engine couldn't in turn use -Wwrite-strings to
control diagnostics (as GCC does) because it was essentially hijacked to
drive the language semantics.
Fix this by giving CC1 a clean '-fconst-strings' flag to enable
const-qualified strings in C and ObjC compilations. Corresponding
'-fno-const-strings' is also added. Then the driver is taught to
introduce '-fconst-strings' in the CC1 command when '-Wwrite-strings'
dominates.
This entire flag is basically GCC-bug-compatibility driven, so we also
match GCC's bug where '-w' doesn't actually disable -Wwrite-strings. I'm
open to changing this though as it seems insane.
llvm-svn: 130051
2011-04-23 06:30:43 +00:00
Francois Pichet
1c229c0472
Add -fdelayed-template-parsing option. Using this option all templated function definitions are parsed at the end of the translation unit only if it is required by an actual instantiation. As such all the symbols of the TU are available during name lookup.
...
Using this flag is necessary for compatibility with Microsoft template code.
This also provides some parsing speed improvement.
llvm-svn: 130022
2011-04-22 22:18:13 +00:00
Nick Lewycky
207bce31e1
Wire up the -ftest-coverage and -fprofile-arcs flags to .gcno file emission (at
...
compile time) and .gcda emission (at runtime). --coverage enables both.
This does not yet add the profile_rt library to the link step if -fprofile-arcs
is enabled when linking.
llvm-svn: 129956
2011-04-21 23:44:07 +00:00
Nick Lewycky
ab18d3088a
Fix indentation. No functional change.
...
llvm-svn: 129954
2011-04-21 23:37:32 +00:00
Daniel Dunbar
bbd482226e
Driver/Darwin: Allow OS X deployment targets like 10.4.11, even though they
...
can't be represented in the environment define.
llvm-svn: 129939
2011-04-21 21:27:33 +00:00
Daniel Dunbar
5a784c8ed1
Driver: Tweak -Xarch diags a bit more, we can't actually differentiate between
...
unknown and "required more arguments", but only the latter should be feasible in
practice.
llvm-svn: 129919
2011-04-21 17:41:34 +00:00
Daniel Dunbar
6914a98ccd
Driver: Improve -Xarch argument diagnostics a bit.
...
llvm-svn: 129918
2011-04-21 17:32:21 +00:00
Daniel Dunbar
2db3e73c38
Driver: Suppress some additional warnings with -Qunused-arguments.
...
llvm-svn: 129853
2011-04-20 15:44:48 +00:00
Daniel Dunbar
308cfd045f
Driver/Darwin: Switch to using -macosx for OS name in triples.
...
llvm-svn: 129834
2011-04-19 23:34:17 +00:00
Daniel Dunbar
5c56828d91
Driver/Darwin: Switch to using new style triples.
...
llvm-svn: 129824
2011-04-19 21:45:47 +00:00
Daniel Dunbar
d107638328
Driver/Darwin: Change to use generic iOS runtime library, which we now always need.
...
llvm-svn: 129734
2011-04-18 23:48:36 +00:00
Daniel Dunbar
ed904c82b1
Driver/Darwin: Disable movw/movt with -mkernel or -fapple-kext.
...
llvm-svn: 129721
2011-04-18 21:26:42 +00:00
Daniel Dunbar
10d0868efb
Driver: Support -fno-lto.
...
llvm-svn: 129712
2011-04-18 19:44:09 +00:00
Ted Kremenek
00abe8ee31
Add ToolChain path support for linker on Slackware.
...
llvm-svn: 129704
2011-04-18 17:50:19 +00:00
Douglas Gregor
46ce91a964
Initial work to improve documentation for Clang's diagnostics, from Matthieu Monrocq
...
llvm-svn: 129614
2011-04-15 22:04:17 +00:00
Chris Lattner
57540c5be0
fix a bunch of comment typos found by codespell. Patch by
...
Luis Felipe Strano Moraes!
llvm-svn: 129559
2011-04-15 05:22:18 +00:00
Daniel Dunbar
dc8355e81a
Driver/no-integrated-as: Fix forwarding of -g flag to assembler, when .s input
...
undergoes preprocessing.
llvm-svn: 129414
2011-04-12 23:59:20 +00:00
Chris Lattner
20b90d061a
fix the path to ld.so for darwin/ppc, resolving PR9677. Patch
...
by Jeremy Huddleston!
llvm-svn: 129299
2011-04-11 21:15:37 +00:00
Dylan Noblesmith
70e73a3d60
refactor -ccc-gcc-name code
...
Put the logic for deciding the default name for gcc/g++
in the only place that actually cares about it.
This also pushes an ifdef out of the generic driver code
to a little further down, when the target is actually known.
Hopefully it can be changed into just a runtime check
in the future.
llvm-svn: 129212
2011-04-09 13:31:59 +00:00
Evan Cheng
04c9429f34
Rename -mtrap_function= to -ftrap_function= since it's now a target neutral options.
...
llvm-svn: 129153
2011-04-08 21:37:45 +00:00
Evan Cheng
77cdce9458
Add -mtrap_function=<> option. rdar://9257465
...
llvm-svn: 129145
2011-04-08 18:47:41 +00:00
Chris Lattner
9242b33de7
fix a typo, patch by PaX team.
...
llvm-svn: 129141
2011-04-08 18:06:54 +00:00
Daniel Dunbar
f28c2ffb84
Driver: Don't attempt to forward some Clang-only options to cc1.
...
llvm-svn: 129108
2011-04-07 20:41:03 +00:00
Daniel Dunbar
529c03bc1e
Driver: Sketch driver support for a CC_LOG_DIAGNOSTICS options, similar to the
...
existing CC_PRINT_OPTIONS and CC_PRINT_HEADERS, which can be used to
transparently capture the compiler diagnostics from a build.
llvm-svn: 129082
2011-04-07 18:01:20 +00:00
Eric Christopher
534b6a01e8
Add support for Fedora16, gcc 4.6.0 and Fedora Rawhide.
...
Patch by Bobby Powers
llvm-svn: 129014
2011-04-06 18:22:53 +00:00
Ted Kremenek
43d47cc397
Add ToolChain support to get Clang to recognize Ubuntu/ppc and Gentoo/ppc64.
...
llvm-svn: 128944
2011-04-05 22:04:27 +00:00
Argyrios Kyrtzidis
5cf423ec8a
Move Driver::createInvocationFromArgs function to Frontend library to avoid dependency cycle
...
between libFrontend and libDriver.
llvm-svn: 128852
2011-04-04 23:11:45 +00:00
Argyrios Kyrtzidis
f606b82e9a
Introduce Driver::createInvocationFromArgs used to create a CompilerInvocation from command-line args.
...
llvm-svn: 128848
2011-04-04 21:38:51 +00:00
Daniel Dunbar
16d970950f
Driver/Darwin: Tweak simulator link logic a bit more to be closer to GCC.
...
llvm-svn: 128738
2011-04-01 21:02:42 +00:00
Daniel Dunbar
ebc34dff18
Driver/Darwin: Tweak link logic for simulator.
...
llvm-svn: 128641
2011-03-31 17:12:33 +00:00
Daniel Dunbar
67919b2a5b
Integrated-As: Support -Wa,-L when using the integrated assembler.
...
llvm-svn: 128433
2011-03-28 22:49:28 +00:00
Chandler Carruth
b6766f07c8
Add an option to suppress include stack printing on note diagnostics.
...
These stacks are often less important than those on primary diagnostics.
As the number of notes grows, this becomes increasingly important. The
include stack printing is clever and doesn't print stacks for adjacent
diagnostics from the same file, but when a note is in between a sequence
of errors in a header file, and the notes all refer to some other file,
we end up getting a worst-case ping-pong of include stacks that take up
a great deal of vertical space.
Still, for now, the default behavior isn't changed. We can evaluate user
feedback with the flag.
Patch by Richard Trieu, a couple of style tweaks from me.
llvm-svn: 128371
2011-03-27 01:50:55 +00:00
Chandler Carruth
6e50103acd
Add -f[no-]strict-overflow to the Clang driver. Use it to set the
...
default for -fwrapv if that flag isn't specified explicitly. We always
prefer an explict setting of -fwrapv when present. Also adds support for
-fno-wrapv to allow disabling -fwrapv even when -fno-strict-overflow is
passed.
llvm-svn: 128353
2011-03-27 00:04:55 +00:00
Daniel Dunbar
67fea71c2d
Driver/Darwin: Dsymutil actions should put the dSYM adjacent to the output file.
...
llvm-svn: 128292
2011-03-25 18:16:51 +00:00
Ted Kremenek
49c79790de
Rework checker "packages" and groups to be more hierarchical.
...
llvm-svn: 128187
2011-03-24 00:28:47 +00:00
Chris Lattner
ce6c42f65f
switch a few Driver APIs to use llvm::ArrayRef, cleaning up code.
...
llvm-svn: 128142
2011-03-23 04:04:01 +00:00
Daniel Dunbar
12100e2c7f
Frontend: Add a more explicit -backend-option flag for passing backend command
...
line options, instead of leveraging the blanket -mllvm option.
- This allows using the frontend itself without requiring the backend have
those options available (i.e., if the target wasn't built).
llvm-svn: 128087
2011-03-22 16:48:17 +00:00
Bob Wilson
d9249414b3
Add clang support for cortex-m0 cpus. Patch by James Orr.
...
llvm-svn: 128018
2011-03-21 20:40:05 +00:00
Joerg Sonnenberger
fcc3ec90a5
Introduce FindTargetProgramPath to check for a target-specific helper
...
program and fallback to plain version otherwise. Use this for the NetBSD
target to make it try e.g. i486--netbsdelf-as and -ld for target
i486--netbsdelf.
llvm-svn: 127996
2011-03-21 14:01:40 +00:00
Joerg Sonnenberger
bc923f3f7d
Memorize presence/absence of -nostdlib in Driver.
...
Drop program paths on NetBSD (unused). Only include lib dir, if
-nostdlib is absent. Use = to allow --sysroot to work.
llvm-svn: 127995
2011-03-21 13:59:26 +00:00
Joerg Sonnenberger
6165ab1132
Remember sysroot in Driver. Pass it down to ld for NetBSD, FreeBSD
...
and DragonFly. Use the --sysroot= form for Linux. Fix handling of =
prefix for -B.
llvm-svn: 127994
2011-03-21 13:51:29 +00:00
Daniel Dunbar
8c3d735118
Driver: Forward -traditional and -traditional-cpp in preprocessing modes.
...
- We don't really support the majority of the horrible -traditional-cpp
behavior, but it is unlikely that we ever will either. This allows us to
start trying to use clang as a /usr/bin/cpp replacement and see what pieces
of -traditional-cpp mode people actually care about.
llvm-svn: 127911
2011-03-18 21:23:40 +00:00
Daniel Dunbar
151a372113
Driver/Darwin: Transparently fallback when compiling i386 -fapple-kext code, we
...
don't support the ABI yet.
llvm-svn: 127903
2011-03-18 20:14:03 +00:00
Daniel Dunbar
1e1c3ca51c
Driver: Give SelectTool access to the action inputs.
...
llvm-svn: 127902
2011-03-18 20:14:00 +00:00
Daniel Dunbar
c76a9e6962
Driver/Darwin: Change fallback to use llvm-gcc search paths instead of GCC.
...
llvm-svn: 127897
2011-03-18 19:25:15 +00:00
Daniel Dunbar
50fab351d7
Driver/Darwin: Kill the DarwinGCC toolchain.
...
llvm-svn: 127896
2011-03-18 19:25:10 +00:00