Граф коммитов

1433 Коммитов

Автор SHA1 Сообщение Дата
Chandler Carruth adc4afb4a5 Factor the data apart from the logic of locating various GCC
installations. This first selects a set of prefixes and a set of
compatible triples for the current architecture. Once selected, we drive
the search with a single piece of code.

This code isn't particularly efficient as it stands, but its only
executed once. I'm hoping as I clean up the users of this information,
it will also slowly become both cleaner and more efficient.

This also changes the behavior slightly. Previously, we had an ad-hoc
list of prefixes and triples, and we only looked for some triples
beneath specific prefixes and vice versa. This has led to lots of
one-off patches to support triple X, or support lib dir Y. Even without
going to a fully universal driver, we can do better here. This patch
makes us always look first in either 'lib32' or 'lib64' on 32- or 64-bit
hosts (resp.). However, we *always* look in 'lib'.

Currently I have one lingering problem with this strategy. We might find
a newer or better GCC version under a different (but equally compatible)
triple. Fundamentally, this loop needs to be fused with the one below.
That's my next patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141056 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-04 02:28:41 +00:00
Chad Rosier d0790b8a06 [driver] Improve r141053 by only emitting the warning if the original input
was assembly.  Otherwise, something like -save-temps causes the integrated
assembler to warn.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141055 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-04 01:53:36 +00:00
Chad Rosier 968b7a71c8 [driver] Emit a warning if the user has requested debug information and we're
using the integrated assembler.
rdar://10216353

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141053 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-04 01:01:30 +00:00
Chandler Carruth 048e649070 Refactor the detection of a GCC installation into a helper class. This
is designed to allow the detection to record more rich information about
the installation than just a single path.

Mostly, the functionality remains the same. This is primarily
a factoring change. However, the new factoring immediately fixes one
issue where on ubuntu we didn't walk up enough layers to reach the
parent lib path. I'll have a test tree for that once I finish making the
Ubuntu tree work reasonably.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141011 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-03 18:16:54 +00:00
Chandler Carruth 38ec546a56 Enable generic multilib support on 32bit hosts. Previously this was only
enabled for debian hosts, which is quite odd. I think all restriction on
when Clang attempts to use a multilib installation should go away. Clang
is fundamentally a cross compiler. It behaves more like GCC when built
as a cross compiler, and so it should just use multilib installs when
they are present on the system. However, there is a very specific
exemption for Exherbo, which I can't test on, so I'm leaving that in
place.

With this, check in a generic test tree for multilib on a 32-bit host.
This stubs out many directories that most distributions don't use but
that uptsream GCC supports. This is intended to be an agnostic test that
the driver behaves properly compared with the GCC driver it aims for
compatibility with.

Also, fix a bug in the driver that this testing exposed (see!) where it
was incorrectly testing the target architecture rather than the host
architecture.

If anyone is having trouble with the tree-structure stubs I'm creating
to test this, let me know and I can revisit the design. I chose this
over (for example) a tar-ball in order to make tests run faster at the
small, hopefully amortized VCS cost.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140999 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-03 09:00:50 +00:00
Chandler Carruth 663abc976a Teach the logic for locating an installed GCC about the system root.
This requires fixing a latent bug -- if we used the default host triple
instead of an autodetected triple to locate GCC's installation, we
didn't go back and fix the GCC triple. Correct that with a pile of
hacks. This entire routine needs a major refactoring which I'm saving
for a subsequent commit. Essentially, the detection of the GCC triple
should be hoisted into the same routine as we locate the GCC
installation: the first is intrinsically tied to the latter. Then the
routine will just return the triple and base directory.

Also start to bring the rest of the library search path logic under
test, including locating crtbegin.o. Still need to test the multilib and
other behaviors, but there are also bugs in the way of that.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140995 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-03 08:02:58 +00:00
Chandler Carruth fde8d14ea3 Add initial support for applying the sysroot to library search paths.
This is still very much a WIP, but sysroot was completely broken before
this so we are moving closer to correctness.

The crux of this is that 'ld' (on Linux, the only place I'm touching
here) doesn't apply the sysroot to any flags given to it. Instead, the
driver must translate all the paths it adds to the link step with the
system root. This is easily observed by building a GCC that supports
sysroot, and checking its driver output.

This patch just fixes the non-multilib library search paths. We should
also use this in many other places, but first things first.

This also allows us to make the Linux 'ld' test independent of the host
system. This in turn will allow me to check in test tree configurations
based on various different distro's configuration. Again, WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140990 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-03 06:41:08 +00:00
Chandler Carruth d2deee17ad Rework the selection of builtin library search paths on Linux to
precisely match the pattern and logic used by the GCC driver on Linux as
of a recent SVN checkout.

This happens to follow a *much* more principled approach. There is
a strict hierarchy of paths examined, first with multilib-suffixing,
second without such suffixing. Any and all of these directories which
exist will be added to the library search path when using GCC.

There were many places where Clang followed different paths, omitted
critical entries, and worst of all (in terms of challenges to debugging)
got the entries in a subtly wrong order.

If this breaks Clang on a distro you use, please let me know, and I'll
work with you to figure out what is needed to work on that distro. I've
checked the behavior of the latest release of Ubuntu, OpenSUSE, Fedora,
and Gentoo. I'll be testing it on those as well as Debian stable and
unstable and ArchLinux. I may even dig out a Slackware install.

No real regression tests yet, those will follow once I add enough
support for sysroot to simulate various distro layouts in the testsuite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140981 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-03 05:28:29 +00:00
Chandler Carruth a9402e4b43 Simplify this through the power of the ternary operator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140965 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-02 07:28:34 +00:00
Chandler Carruth bc0df72408 Consolidate the currently bizarre 32/64 multilib selection logic a bit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140964 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-02 07:06:48 +00:00
John McCall d1e40d5389 Make -fobjc-nonfragile-abi the -cc1 default, since it's the
increasingly prevailing case to the point that new features
like ARC don't even support the fragile ABI anymore.

This required a little bit of reshuffling with exceptions
because a check was assuming that ObjCNonFragileABI was
only being set in ObjC mode, and that's actually a bit
obnoxious to do.

Most, though, it involved a perl script to translate a ton
of test cases.

Mostly no functionality change for driver users, although
there are corner cases with disabling language-specific
exceptions that we should handle more correctly now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140957 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-02 01:16:38 +00:00
Chandler Carruth eb86b5b039 Revert r140604: "Let -B work for ld paths on Linux."
This patch may do what it describes, it may not. It's hard to tell as
its completely unclear what this is supposed to do. There are also no
test cases. More importantly, this seems to have broken lots of linker
invocations on multilib Linux systems.

The manual pages for 'ld' on Linux mention translating a '=' at the
beginning of the path into a *configure time* sysroot prefix (this is,
I believe, distinct from the --sysroot flag which 'ld' also can
support). I tested this with a normal binutils 'ld', a binutils 'ld'
with the sysroot flag enabled, and gold with the sysroot flag enabled,
and all of them try to open the path '=/lib/../lib32', No translation
occurs.

I think at the very least inserting an '=' needs to be conditioned on
some indication that it is supported and desired. I'm also curious to
see what toolchain and whan environment cause it to actually make
a difference.

I'm going to add a test case for basic sanity of Linux 'ld' invocations
from Clang in a follow-up commit that would have caught this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140908 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-01 00:37:35 +00:00
Daniel Dunbar 26e0b30455 Revert my --working-directory option, which wasn't well thought through.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140889 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 21:33:09 +00:00
David Chisnall 3c3ccd283f Remove the conditional that avoided passing the Objective-C runtime specification flags to cc1. This fixes PR10369 (__builtin_NSStringMakeConstantString() selecting the wrong runtime in C / C++ code and crashing, although it doesn't fix the problem that instantiating the Mac runtime for non-Darwin targets was crashing.)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140853 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 13:32:35 +00:00
Peter Collingbourne a95b9f6dab Driver: use correct search paths for multilib
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140782 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-29 13:42:24 +00:00
Benjamin Kramer 7ca268423c Driver: Fix two bad typos that were breaking the buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140682 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-28 05:33:02 +00:00
Chad Rosier 4f8de278b7 [driver] If no OSX or iOS target has been specified and we're compiling for
armv7, go ahead as assume we're targeting iOS.
rdar://10147774

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140668 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-28 00:46:32 +00:00
David Chisnall 5adcec16cb Check for GCC paths that have the target triple in them. This is required for a lot of cross-compile toolchains. Also add some slightly better support for -B.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140645 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-27 22:03:18 +00:00
David Chisnall 7f9b58b171 Let -B work for ld paths on Linux.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140604 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-27 13:31:58 +00:00
Akira Hatanaka 9f36062866 Make necessary changes in AddMIPSTargetArgs for targeting Mips64. Enable use of
-mcpu.
 






git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140562 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-26 21:07:52 +00:00
David Blaikie d6471f7c19 Rename Diagnostic to DiagnosticsEngine as per issue 5397
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140478 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-25 23:23:43 +00:00
Daniel Dunbar 51be75eccd Driver: Use sys::Process::SetWorkingDirectory, for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140434 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-23 23:32:02 +00:00
Benjamin Kramer 5cca4eb629 Driver: Explicitly include <unistd.h>, libstdc++'s <map> pulls it in, libc++ doesn't.
Also, on windows, chdir seems to live in <direct.h>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140414 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-23 21:03:19 +00:00
Daniel Dunbar 63bc59bf22 Driver: Add a --working-directory option which can be used to cause the compiler
to operate "as if" in a certain working directory.
 - For now, we just implement this by changing the actual working directory, but
   eventually we would want to handle this transparently. This is useful to
   avoid an extra exec() pair in some situations, and will be something we would
   want to support for more flexibility in using the Clang libraries.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140409 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-23 20:33:41 +00:00
David Blaikie eb2d1f1c88 Removing a bunch of dead returns/breaks after llvm_unreachables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140407 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-23 20:26:49 +00:00
David Blaikie 548f6c8e80 More missing header inclusions from llvm_unreachable migration.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140369 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-23 05:57:42 +00:00
David Blaikie b219cfc4d7 Switch assert(0/false) llvm_unreachable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140367 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-23 05:06:16 +00:00
Benjamin Kramer 47adebef0d Add support for CPATH and friends.
This moves the existing code for CPATH into the driver and adds the environment lookup and path splitting there.
The paths are then passed down to cc1 with -I options (CPATH), added after the normal user-specified include dirs.
Language specific paths are passed via -LANG-isystem and the actual filtering is performed in the frontend.

I tried to match GCC's behavior as close as possible

Fixes PR8971.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140341 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-22 21:41:16 +00:00
Akira Hatanaka 7ec0258505 Add case labels for Mips64 architectures.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140226 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-21 02:13:07 +00:00
Bob Wilson 8aa76ea447 For i386 kext fallback to llvm-gcc, search paths for several Darwin versions.
This replaces the hack to read UNAME_RELEASE from the environment when
identifying the OS version on Darwin, and it's more flexible.  It's also
horribly ugly, but at least this consolidates the ugliness to touch less of
the code so that it will be easier to rip out later.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140187 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-20 22:00:38 +00:00
Chad Rosier 61ab80a8b3 [driver] Default to arm mode when using the integrated assembler.
rdar://10125227

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140179 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-20 20:44:06 +00:00
Francois Pichet ae55608a29 As per discussion with Doug Gregor on the IRC channel, introduce a new compiler switch: -fms-compatility.
Microsoft specific tweaking will now fall into 2 categories:

    - fms-extension: Microsoft specific extensions that should never change the meaning of an otherwise well formed code. Currently map to LangOptions::Microsoft. (To be clearer, I am planning to change the name to LangOptions::MicrosoftExt).

    - fms-compatibility: Really a MSVC emulation mode. Map to LangOptions::MicrosoftMode. Can change the meaning of an otherwise standard conformant program.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139978 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-17 04:32:15 +00:00
Douglas Gregor 9bdbec17c3 Pass -fmodule-cache-path along to -cc1 properly
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139977 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-17 02:20:28 +00:00
Eli Friedman 733a83b324 Fix search paths for Ubuntu 11.04 x86. Patch by Stepan Dyatkovskiy.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139941 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-16 21:04:38 +00:00
Douglas Gregor fba18aa8f2 Add an experimental flag -fauto-module-import that automatically turns
#include or #import direcctives of framework headers into module
imports of the corresponding framework module.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139860 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-15 22:00:41 +00:00
Douglas Gregor 8ee51ef211 Teach the driver to always pass down a module cache path. If none is
supplied, use something derived from the system's temporary
directory. Depends on LLVM r139725.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139726 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 20:28:46 +00:00
Chad Rosier 815eb6b807 [driver] Add support for the COMPILER_PATH environment variable, which adds the
specified path(s) to the list of prefix directories.
rdar://10097714

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139677 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-14 00:47:55 +00:00
John McCall 13db5cfc4e Treat the weak export of block runtime symbols as a deployment-target
feature akin to the ARC runtime checks.  Removes a terrible hack where
IR gen needed to find the declarations of those symbols in the translation
unit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139404 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-09 20:41:01 +00:00
Chad Rosier 4fe4d73bce [driver] i386 kext preprocessor jobs also need their unsupported options
filtered.  This happenis when -save-temps is specified. 
<rdar://problem/10088387>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139269 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-08 00:38:00 +00:00
Chad Rosier 46e3908af1 [driver] When clang crashes, don't try to generate diagnostics (i.e.,
preprocessor output) with multiple -arch options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139207 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-06 23:52:36 +00:00
Peter Collingbourne 41ee7a3717 Add the resource directory to the search path for Driver::GetFilePath,
as well as the search path printed by -print-search-dirs.

The main purpose of this change is to cause -print-file-name=include
to print the path to the include directory under Clang's resource
directory, instead of the system compiler's include directory, whose
header files Clang may not be able to parse.  Some build scripts will
do something like:
  $(CC) -nostdinc -I`$(CC) -print-file-name=include`
to exclude all header paths except the compiler's.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139127 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-06 02:08:31 +00:00
Fariborz Jahanian e3685fd4c2 default property synthesis is off by default
for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138958 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-01 20:23:17 +00:00
Fariborz Jahanian 4a04247099 objective-c: Make auto synthesis of properties the default.
This concludes //rdar://8843851


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138947 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-01 17:50:05 +00:00
Francois Pichet 8efcc0184a Enable -fdelayed-template-parsing by default on Win32.
I had to force -fno-delayed-template-parsing on some Index tests because delayed template parsing will change the output of some tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138942 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-01 16:38:08 +00:00
Rafael Espindola ab784085b7 Fix PR10744 by adding the toolchain path to the regular program path
and doing a simple search. Before we would manually check for the linker
before the -B options were searched.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138941 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-01 16:25:49 +00:00
Hans Wennborg 104087b59d Add 4.4.6 to GccVersions[] in lib/Driver/ToolChains.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138940 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-01 14:41:39 +00:00
Fariborz Jahanian 8697d308c1 objective-c: this patch (re)introduces objective-c's default property
synthesis. This new feature is currently placed under 
-fobjc-default-synthesize-properties option
and is off by default pending further testing.
It will become the default feature soon. 
// rdar://8843851


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138913 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-31 22:24:06 +00:00
Chad Rosier a488497c7c [driver] If no -miphoneos-version-min is specified on the command line *and*
IPHONEOS_DEPLOYMENT_TARGET if undefined, set -miphoneos-version-min based on 
isysroot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138892 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-31 20:56:25 +00:00
Eli Friedman b1f2f47820 Some minor updates to the Linux search path handling for Slackware. Patch by Will Dietz. PR10692.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138753 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-29 18:56:43 +00:00
Chad Rosier f43b5e84aa Cleanup r138662 per Ben and David's suggestions, thanks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138670 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-26 22:27:02 +00:00
Chad Rosier ee99c8191c Make sure the std::string isn't deallocated prior to use. Many thanks to Eli
for catching this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138666 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-26 21:47:20 +00:00
Chad Rosier fe87fc73c0 [driver] When generating temporary files allow a prefix to be added. In many
cases we want the prefix to be the original file name less the suffix.  For an
input such as test.c to named temporary would be something like test-3O4Clq.o
Part of <rdar://problem/8314451>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138662 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-26 21:28:44 +00:00
Chad Rosier 807179763b [driver] Remove a few more options when clang invokes cc1plus for i386 kexts.
<rdar://problem/10027287>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138637 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-26 18:30:43 +00:00
Chad Rosier f59f5dab08 Take 2: Actually fix spacing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138617 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-26 00:49:52 +00:00
Chad Rosier 669cffa41a 80-column.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138614 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-26 00:44:04 +00:00
Chad Rosier 1b90605532 [driver] Add -mglobal-merge/-mno-global-merge machine options to enable/disable merging of
globals during codegen.
Fixes <rdar://problem/10017909>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138612 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-26 00:26:29 +00:00
Francois Pichet 805bc1f6fb revert 138610, accidental commit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138611 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-26 00:22:34 +00:00
Francois Pichet 0bb39319cf git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138610 91177308-0d34-0410-b5e6-96231b3b80d8 2011-08-26 00:18:13 +00:00
Chad Rosier fab83b5e7c [driver] Do not add -kext to the link command line when compiling with
-fapple-kext.
Fixes <rdar://problem/10013310>. Reverts <rdar://problem/7809940>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138564 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-25 17:33:03 +00:00
Eric Christopher f857186fd1 Add support for a verifier to the driver. Currently only verifies debug
output on darwin so is hard coded there.

As a note this will need a little bit of refactoring in the class
hierarchy to separate it out for different verifiers based on input type.

Fixes rdar://8256258.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138343 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-23 17:56:55 +00:00
Nico Weber 2fef11164c enable -fstack-protector on 10.5 for usermode binaries by default.
This matches gcc's behavior.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138324 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-23 07:38:27 +00:00
Chad Rosier 6b0baf97dc Typo spotted by Ivan Krasin.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138200 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-20 06:56:17 +00:00
Eric Christopher 88b7cf00fc Add a completely hacky workaround for pch kext files with different extensions
when falling back to cc1plus for our compile.

rdar://9963920


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138017 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-19 00:30:14 +00:00
Chad Rosier 8722a5d483 Use StringRef, rather than C string APIs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137958 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-18 17:56:32 +00:00
Chad Rosier 7e9e74b0cc No seriously, remove the unsupported warning options.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137918 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-18 02:08:52 +00:00
Chad Rosier f01f8474e2 Fix off by one.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137915 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-18 01:23:31 +00:00
Chad Rosier 04225c1409 [driver] Implement in a more table-like manner and add many more warning options
that aren't handled by llvm-gcc on fallback.
Enhancement to rdar://9964354



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137912 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-18 01:18:28 +00:00
Eric Christopher 81ae90200a Add some more options that aren't handled by llvm-gcc on fallback.
This is going to be made a table.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137907 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-18 00:26:15 +00:00
Chad Rosier 90c88023fd [driver] Don't generate diagnostics (i.e., preprocessed source) if reading
from stdin.  This allows Eli and the like to continue with their debugging 
trickery without loss of limb (or car) on my part. :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137906 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-18 00:22:25 +00:00
Chad Rosier 3060178ad9 Fix else style. No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137896 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-17 23:08:45 +00:00
Eric Christopher 59f9b26bcb Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137893 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-17 22:59:59 +00:00
Chad Rosier cc0de8c081 Fix iterator end for r137842.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137849 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-17 18:51:56 +00:00
Chad Rosier 285f9a2847 [driver] Clang doesn't support -mkernel/-fapple-kext for i386, so it's
automatically invoking llvm-gcc's cc1plus, which doesn't support all options
supported by Clang.  Therefore, filter out unsupported options.
rdar://9964354


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137842 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-17 18:24:55 +00:00
Eli Friedman cb6239ae97 Add additional path to Linux toolchain. Patch by Will Dietz. PR10690.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137839 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-17 18:17:26 +00:00
Bob Wilson faef9fcb41 Make -findirect-virtual-calls and -fterminated-vtables aliases of -fapple-kext.
Outside the driver, they were already treated that way, but the driver was not
giving them the same special treatment as -fapple-kext, e.g., falling back to
llvm-gcc for i386/Darwin kexts.  Radar 9868422.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137639 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-15 19:13:06 +00:00
Bob Wilson 0ac1ccc0f0 Remove duplicate option.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137638 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-15 19:13:02 +00:00
NAKAMURA Takumi 57c43a29f5 Fix "Uninitialized" warnings on g++-4.4.
In fact, they are false warnings but it seems g++-4.4 might be unable to know they must be false.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137568 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-14 00:37:22 +00:00
Bob Wilson a544aeece3 Reject -mkernel for i386/Darwin C++ code; fall back to llvm-gcc instead.
Since -mkernel implies -fapple-kext, this just extends the current behavior
for -fapple-kext to apply for -mkernel as well.  Radar 9933387.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137566 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-13 23:48:55 +00:00
Nico Weber cc52a0688f Add support of -x objc-cpp-output, -x objc++-cpp-output to the Driver.
Matches gcc, and is also required for using ccache with clang.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137563 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-13 23:13:37 +00:00
Chad Rosier b18d503bc9 [driver] Make sure to update the iterator end when erasing for Args.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137539 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12 23:38:19 +00:00
Chad Rosier 137a20b5f9 [driver] When generating clang failure diagnostics, don't try to preprocess
inputs that aren't preprocessable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137532 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12 23:30:05 +00:00
Chad Rosier 20fd867483 Return the proper type for objects when given a .o extension.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137531 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12 23:16:53 +00:00
Chad Rosier be69f60926 [driver] Refactor a bit to enable a few fixes when generating diagnostics. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137524 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12 22:08:57 +00:00
Chad Rosier 98fdfd30c9 If no -miphoneos-version-min specified, see if we can set the default based on
-isysroot.
rdar://9837120

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137075 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-08 23:39:34 +00:00
Chad Rosier aec8f4538d Improved efficiency by using iterator returned by erase, rather then restarting.
Thanks to David Blaikie for pointing this out.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137051 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-08 17:17:15 +00:00
Chad Rosier fc6142779f Fix cmake for r136702 (at least for the most part). Chandler has been kind
enough to offer to investigate the underlying issue.  Thanks to Doug for his
assistance as well.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136719 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-02 20:44:34 +00:00
Chad Rosier 4068eaaec4 Temporarily revert parts of r136702 to make cmake builds happy.
Someone with more cmake experience want to throw me a bone? :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136709 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-02 18:33:29 +00:00
Chad Rosier 2b81910618 When the compiler crashes, the compiler driver now produces diagnostic
information including the fully preprocessed source file(s) and command line 
arguments.  The developer is asked to attach this diagnostic information to a 
bug report.
rdar://9575623


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136702 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-02 17:58:04 +00:00
Chad Rosier 8c221b84ca Driver: When compiling i386 -fapple-kext code, we fallback to llvmgcc.
Unfortunately, llvmgcc doesn't always work when writing temporary output to
/dev/null.  Therefore, create a temp file that is later deleted.
rdar://9837692

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136644 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-01 19:58:48 +00:00
Douglas Gregor 65e02fa80e Introduce the "-index-header-map" option, to give special semantics
for quoted header lookup when dealing with not-yet-installed
frameworks. Fixes <rdar://problem/9824020>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136331 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-28 04:45:53 +00:00
Chad Rosier 1fc1de48cd The -fapple-kext flag was designed to "do the right thing" for building code for
use in KEXTs. However, users/Xcode still need to tweak the linker flags to do 
the right thing, and end up using -Xlinker, for example.  Instead, have the 
driver "do the right thing" when linking when -fapple-kext is present on the 
command line, and we should have Xcode use -fapple-kext instead of setting other
flags like -Xlinker -kext or -nodefaultlibs.
rdar://7809940

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136294 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-27 23:36:45 +00:00
Chris Lattner 2d3ba4f5a9 Move ArrayRef to LLVM.h and eliminate now-redundant qualifiers, patch by Jon Mulder!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135855 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-23 17:14:25 +00:00
Francois Pichet 1c3199afb8 Unbreak the MSVC build, using namespace clang is required otherwise MSVC will not find raw_ostream.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135853 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-23 11:36:43 +00:00
Chris Lattner 5f9e272e63 remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-23 10:55:15 +00:00
Rafael Espindola 19d9d2ebbe Avoid warning on "clang -c -Dfoo test.i". Lines like these are created
when using ccache and libtool.m4 assumes that the compiler cannot print
warnings about options it knows about.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135723 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-21 23:40:37 +00:00
Chad Rosier d7a3ba03f6 Temporarily revert r135614 while I fix the cmake build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135621 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-20 21:16:17 +00:00
Chad Rosier 2da13b1595 When the compiler crashes, the compiler driver now produces diagnostic information
including the fully preprocessed source file(s) and command line arguments.  The 
developer is asked to attach this diagnostic information to a bug report.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135614 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-20 20:26:32 +00:00
Chad Rosier c57114ab9f If -ccc-host-triple i386-pc-win32-macho or -ccc-host-triple
x86_64-pc-win32-macho is used in conjunction with -no-integrated-as go ahead and
use the Darwin system assembler.
rdar://9785470


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135604 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-20 19:14:30 +00:00
Chris Lattner 686775deca now that we have a centralized place to do so, add some using declarations for
some common llvm types: stringref and smallvector.  This cleans up the codebase
quite a bit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135576 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-20 06:58:45 +00:00
Chris Lattner 9594675cc1 introduce a centralized place to introduce and inject llvm types into the
clang namespace.  There are a number of LLVM types that are used pervasively
and it doesn't make sense to keep qualifying them.  Start with casting
operators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135574 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-20 06:37:11 +00:00
Argyrios Kyrtzidis 7ee2049278 [arcmt] Add some additional driver flags to optionally emit or save the pre-migration ARC errors.
-arcmt-migrate-emit-errors : Emits the pre-migration ARC errors but it doesn't affect anything else
-arcmt-migrate-report-output : Writes out the pre-migration ARC errors to the provided plist file

rdar://9791454

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135491 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-19 17:20:03 +00:00
Joerg Sonnenberger 59c8457f01 Correctly handle sysroot prefix in -print-search-dirs. Makes libtool
more happy on NetBSD.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135344 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-16 10:50:05 +00:00
Chad Rosier 3e4d10917a Prevent the -save-temps flag from modifying the input file if the input filename
conflicts with a to be produced temp filename.
rdar://9724657

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135308 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-15 21:54:29 +00:00
Peter Collingbourne bb52786da8 Implement -MG. Fixes PR9613
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134996 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 19:35:15 +00:00
Argyrios Kyrtzidis 69325d5b7c [arcmt] Introduce new '-ccc-arcmt-migrate <path>' ARC migration driver option.
This is a new mode of migration, where we avoid modifying the original files but
we emit temporary files instead.

<path> will be used to keep migration process metadata. Currently the temporary files
that are produced are put in the system's temp directory but we can put them
in the <path> if is necessary.

Also introduce new ARC migration functions in libclang whose only purpose,
currently, is to accept <path> and provide pairs of original file/transformed file
to map from the originals to the files after transformations are applied.

Finally introduce the c-arcmt-test utility that exercises the new libclang functions,
update arcmt-test, and add tests for the whole process.

rdar://9735086.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134844 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 20:00:58 +00:00
Argyrios Kyrtzidis 72ac120023 [arcmt] Add -ccc-arcmt-check/-ccc-arcmt-modify driver option aliases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134591 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-07 04:00:39 +00:00
John McCall f1443bedeb Somehow the -fgnu-runtime option itself got lost in all that shuffling.
Restore it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134459 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 02:36:30 +00:00
John McCall 256a76e0b0 Call objc_terminate() instead of abort() when a cleanup throws an
exception in Objective-C;  in Objective-C++ we still use std::terminate().
This is only available in very recent runtimes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134456 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 01:22:26 +00:00
John McCall c06e074343 Missing header from last commit; accidental change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134455 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 00:38:59 +00:00
John McCall 9f084a3166 Change the driver's logic about Objective-C runtimes: abstract out a
structure to hold inferred information, then propagate each invididual
bit down to -cc1.  Separate the bits of "supports weak" and "has a native
ARC runtime";  make the latter a CodeGenOption.

The tool chain is still driving this decision, because it's the place that
has the required deployment target information on Darwin, but at least it's
better-factored now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134453 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 00:26:06 +00:00
Joerg Sonnenberger 5b2b89b3e8 Drop "soft" argument that would be considered as file argument by cc1.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134438 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-05 19:52:46 +00:00
Douglas Gregor bcf6a8025a StringRef'ize clang::drive::Option::getName(), from Zach Wheeler!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134418 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-05 16:56:25 +00:00
Chandler Carruth 37187cc455 Make the GCC version proliferation worse by N+1 for the sake of
ArchLinux. =/ Fixes PR10246.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134299 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-02 00:51:03 +00:00
Eli Friedman d18eecac71 Make clang behave in a gcc-compatible way in the presence of multiple flags for the same x86 target feature (e.g. -mno-sse -msse). gcc uses a somewhat unintuitive algorithm here in that the enabled SSE instructions is based on the order of the *last* flag for *each* feature-level, so that "-mno-sse -msse2" only enables SSE2, but "-mno-sse -msse2 -msse" enables all SSE levels.
Issue reported on cfe-dev.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134296 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-02 00:34:19 +00:00
Eric Christopher aa7333c860 Update for llvm commit r134291.
Fixes rdar://9714064


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134292 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-02 00:20:22 +00:00
Fariborz Jahanian 5d9b6bf9de Use existing -fcatch-undefined-behavior option,
replacing -freset-local-blocks. // rdar://9227352


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134082 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 18:41:17 +00:00
Fariborz Jahanian 1077e420b8 Under a compiler flag, -freset-local-blocks,
wipe out stack blocks when they go out of scope.
// rdar://9227352


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134045 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-28 23:51:26 +00:00
Daniel Dunbar 99ca47b21f Driver/Darwin: -force_load can be specified multiple times.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134025 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-28 20:16:02 +00:00
Bill Wendling 3f4be6fb88 libprofile_rt may be installed as a dylib on Darwin.
If we cannot find the static library, use the dylib instead.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133926 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-27 19:15:03 +00:00
Dylan Noblesmith 89bb6146a8 fix autoconf build from r133710
Sorry! This commit worked in CMake, but
CXX_INCLUDE_ROOT is defined in a different
config.h for autoconf.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133715 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 13:50:47 +00:00
Eric Christopher 3404fe7105 Build and use libcompiler_rt whenever possible.
Patch by Jean-Daniel Dupas!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133624 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22 17:41:40 +00:00
John McCall d71315c551 It is possible to request the nonfragile ABI with -fobjc-abi-version=2;
respect that when deciding whether -objc-exceptions implies the
-fexceptions -cc1 option.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133590 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22 00:53:57 +00:00
Daniel Dunbar a68e1c398a Driver/Darwin: Fixup version check for -object_path_lto support.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133548 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 21:18:32 +00:00
Bob Wilson 13c4f2144b Fix the default libc++ header search path to be sysrooted. Radar 9639692.
The -cxx-isystem path is not prefixed with the sysroot directory, so it's
not a good way for the driver to set the system default C++ search path.
Instead, add -stdlib as a cc1 option and teach the frontend how to find the
headers.  The driver can then just pass -stdlib through to "cc1".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133547 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 21:12:29 +00:00
Daniel Dunbar 5bfa656e13 Driver/Darwin: When invoking the linker, automatically pass -object_path_lto so
that the linker has a place to put the temporary object file and can leave it
around (for the driver to clean up). This is important so that the object file
references in the debug info are preserved for possible use by dsymutil.
 - <rdar://problem/8294279> executable has no debug symbols when compiled with LTO

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133543 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 20:55:11 +00:00
Daniel Dunbar ed798951b4 Driver: Factor out IsUsingLTO helper function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133542 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 20:55:08 +00:00
Joerg Sonnenberger 468eb7ddd6 Fix typo. From Damjan Marion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133511 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 08:45:08 +00:00
Daniel Dunbar 2a45fa7cf6 Driver/Darwin: Honor -Xarch_FOO when the arch matches either the toolchain or
the architecture being bound.
 - Fixes things like -Xarch_armv7.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133490 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 00:20:17 +00:00
Nick Lewycky c3b9014c72 Add support for -Wa,--noexecstack when building from a non-assembly file. For
an assembly file it worked correctly, while for a .c file it would given an
error about how --noexecstack is not a supported argument to -Wa.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133489 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-21 00:14:18 +00:00
Argyrios Kyrtzidis c2e70b46b6 [arcmt] Remove '-arcmt-modify-in-memory', it turned out less useful than we hoped it would be.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133315 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-17 23:49:31 +00:00
Eli Friedman 7a883e3e17 Add support for -force_load flag, for compat with Apple gcc. rdar://9555962 .
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133218 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-16 23:59:43 +00:00
NAKAMURA Takumi c37039803a Be aware of (x86_64-redhat-linux6E-)g++44 on RHEL5.
AFAIK, RHEL5 (and its clones) provides g++44 as the package "gcc44-c++".
By default, g++-4.1.1 is available, though, its libstdc++ would not be suitable to clang++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133156 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-16 12:43:57 +00:00
John McCall 8f0e8d2296 The ARC Migration Tool. All the credit goes to Argyrios and Fariborz
for this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133104 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-15 23:25:17 +00:00
John McCall f85e193739 Automatic Reference Counting.
Language-design credit goes to a lot of people, but I particularly want
to single out Blaine Garst and Patrick Beard for their contributions.

Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself,
in no particular order.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133103 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-15 23:02:42 +00:00
Douglas Gregor 74da19fc3a Introduce a -cc1-level option to turn off related result type
inference, to be used (only) by the Objective-C rewriter.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133025 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-14 23:20:43 +00:00
Douglas Gregor 4c4efee6d3 Eliminate the -f[no]objc-infer-related-result-type flags; there's no
reason to allow the user to control these semantics through a flag.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132919 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-13 16:42:53 +00:00
Douglas Gregor 926df6cfab Implement Objective-C Related Result Type semantics.
Related result types apply Cocoa conventions to the type of message
sends and property accesses to Objective-C methods that are known to
always return objects whose type is the same as the type of the
receiving class (or a subclass thereof), such as +alloc and
-init. This tightens up static type safety for Objective-C, so that we
now diagnose mistakes like this:

t.m:4:10: warning: incompatible pointer types initializing 'NSSet *'
with an
      expression of type 'NSArray *' [-Wincompatible-pointer-types]
  NSSet *array = [[NSArray alloc] init];
         ^       ~~~~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:72:1:
note: 
      instance method 'init' is assumed to return an instance of its
      receiver
      type ('NSArray *')
- (id)init;
^

It also means that we get decent type inference when writing code in
Objective-C++0x:

  auto array = [[NSMutableArray alloc] initWithObjects:@"one",  @"two",nil];
  //    ^ now infers NSMutableArray* rather than id




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132868 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-11 01:09:30 +00:00
Chandler Carruth 169dd31c6c Revert "hack in my new variables for GCC"
Very sorry for the accidental commit of WIP code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132745 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-08 10:14:38 +00:00
Chandler Carruth 8afdd56bab hack in my new variables for GCC
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132743 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-08 10:13:14 +00:00
Joerg Sonnenberger db6393f259 Sort -lgcc after -lgcc_s for NetBSD, otherwise shared libraries on i386
may pick it up. This would create bad text relocations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132736 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-07 23:39:17 +00:00
Benjamin Kramer 25a857b803 Toolchain support for Ubuntu Oneiric. Patch by Michael Wild!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132669 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-05 16:08:59 +00:00
Roman Divacky 000a6552ad Adjust the linker for PowerPC64/-m32 on FreeBSD too.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132635 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-04 07:40:24 +00:00
Roman Divacky 3393cef18e Make -m32 work on FreeBSD/PowerPC64.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132634 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-04 07:37:31 +00:00
Nick Lewycky 80df02592c On linux, -nostdlib was causing a --start-group with no --end-group to be passed
to the linker.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132629 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-04 06:27:06 +00:00
Nick Lewycky 7e46d0b843 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132626 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-04 05:19:42 +00:00
Rafael Espindola c7409a0005 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132551 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-03 15:39:42 +00:00
Rafael Espindola 5a640efa55 Add support for centos.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132550 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-03 15:23:24 +00:00
Eric Christopher 9af535a011 80-col cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132543 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-03 13:28:31 +00:00
NAKAMURA Takumi 304ed3f81b Untabify and fix whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132531 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-03 03:49:51 +00:00
Rafael Espindola 14ea13cb5a 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132497 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-02 22:18:46 +00:00
Eli Friedman 0b200f66b4 Add Debian wheezy/sid to ToolChains.cpp. Patch by Michael Wild. PR10064.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132489 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-02 21:36:53 +00:00
Rafael Espindola db3f24ac0d Change how we link libprofile_rt.a. While at it, refactor the code a bit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132474 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-02 18:58:46 +00:00
Rafael Espindola 01ba8545fb Add -fno-gnu89-inline.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132468 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-02 17:30:53 +00:00
Rafael Espindola fb3f4aad04 Implement -fgnu89-inline. Fixes PR10041.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132460 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-02 16:13:27 +00:00
Rafael Espindola 446b8472c7 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132425 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-01 21:37:00 +00:00
Daniel Dunbar 951733d6ce Driver/Clang: Simplify code to use arch enumerations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132338 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-31 15:58:55 +00:00
Argyrios Kyrtzidis 477aab6782 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132047 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-25 05:05:01 +00:00
Nick Lewycky 2e95a6d7d0 When given one of the applicable coverage flags, try to link against
libprofile_rt.a. On Darwin, don't try to link -lgcov.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132006 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 21:54:59 +00:00
Roman Divacky 776bff74a6 Let amd64 be used in target triple instead of x86_64 on FreeBSD.
Patch by Dimitry Andric!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131990 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 19:54:09 +00:00
Jim Grosbach 5b4e7b11e7 For non-Darwin, a plain 'char' type is unsigned.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131967 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 15:40:46 +00:00
Chandler Carruth f0b60ecc82 Fix a bug in the most recent openSUSE support patch.
This patch also by Ismail Donmez.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131958 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 07:51:17 +00:00
Chris Lattner 64a8917701 add opensuse toolchain support, patch by Ismail Donmez!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131857 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-22 16:45:07 +00:00
Chris Lattner d753b56d77 Add Redhat Enterprise Linux to the Linux toolchain, PR9769,
patch by Bryce Lelbach


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131840 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-22 05:36:06 +00:00
Douglas Gregor c9471b0ff1 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!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131794 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-21 17:07:29 +00:00
Joerg Sonnenberger 46a49391ef Correction for r131662, the GNU as option is --fatal-warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131671 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 20:46:39 +00:00
Joerg Sonnenberger d793350dee Support -fatal-warnings for the assembler frontend
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131662 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 18:42:29 +00:00
David Chisnall de5c048fed - 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!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131637 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 13:26:33 +00:00
Eric Christopher 199e09a938 Add some support for RHEL5 systems.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131505 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 23:06:53 +00:00
Rafael Espindola cb773921b1 Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131478 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 19:06:58 +00:00
Rafael Espindola 97f6abb447 The logic about -static is darwin only. For now assume that all non
darwin assembler can handle cfi. Add a test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131464 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-17 16:26:17 +00:00
Joerg Sonnenberger 182564cd14 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131404 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 13:35:02 +00:00
Daniel Dunbar 03e92303e6 Driver/Darwin: Put dsymutil -o arguments first, so that dysmutil doesn't barf
when POSIXLY_COMPLIANT is set.
 - Patch by Dave Vasilevsky!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131084 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-09 17:23:16 +00:00
Joerg Sonnenberger 359cf927cf 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130983 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-06 14:35:16 +00:00
Joerg Sonnenberger 9d0fbeadc4 Rename ContainsCompileAction to ContainsCompileOrAssembleAction to
properly reflect its behavior.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130981 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-06 14:05:11 +00:00
Nick Lewycky 3dc0541853 Preserve the full name of the file, so that '-c -o foo.pic.o' produces
foo.pic.gcno instead of foo.gcno.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130899 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-05 00:08:20 +00:00
Nick Lewycky 5ea4f44e34 Record where the GCOV data files should be placed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130866 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 20:46:58 +00:00
Nick Lewycky 574bb5a5bb No, fix this use after free properly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130833 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 03:44:01 +00:00
Nick Lewycky 3c989fc446 Fix use after free through StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130828 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 02:06:19 +00:00
Eric Christopher 1a584022c8 Add the -mstackrealign option which just communicates the need to
force align the stack to the backend.

Fixes rdar://9289631


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130725 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-02 21:18:22 +00:00
Daniel Dunbar cc95719054 Driver/Darwin: Honor --sysroot= when invoking the linker, on Darwin.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130723 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-02 21:03:47 +00:00
Rafael Espindola 61b1efe2d0 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130697 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-02 17:43:32 +00:00
Rafael Espindola f24a151d64 Implement -fno-dwarf2-cfi-asm.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130616 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 18:35:43 +00:00
Daniel Dunbar 87e945f0f1 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130595 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 04:25:16 +00:00
Daniel Dunbar b7f5ef73ae 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130594 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 04:22:58 +00:00
Daniel Dunbar 3fd823b062 Driver/Darwin: Reject invalid arch combinations with
-mios-simulator-version-min.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130593 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 04:20:40 +00:00
Daniel Dunbar 5f5c37b123 Driver/Darwin: Change Darwin toolchain to explicitly track is-ios-sim bit, and
update -mios-simulator-version-min to set it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130592 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 04:18:16 +00:00
Daniel Dunbar 9d609f2b0d Driver/Darwin: Sketch initial support for a -mios-simulator-version-min= flag
and associated deployment target environment variable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130591 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 04:15:58 +00:00
Bob Wilson a0fa203f04 Add -Oz option and use it to set the inline threshold to 25.
Radar 9333566.  Patch by Chad Rosier!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130554 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 22:49:50 +00:00
Daniel Dunbar 3df2325a0f Driver/cc1as: Forward -mllvm arguments when compiling assembly files.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130516 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 17:53:18 +00:00
Daniel Dunbar ce911f5fd7 Driver/Darwin/ld: Set the deployment target following the version information in
the tool chain, instead of based on the translated arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130440 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 21:23:41 +00:00
Ted Kremenek 295163797a 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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130424 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 19:26:03 +00:00
Daniel Dunbar 8ac127a09a Driver: When compilation fails, don't try to remove output files we don't have
write access to.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130150 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 20:43:05 +00:00
Nico Weber 80585d8c96 Let clang detect gcc triple on Ubuntu Natty. Patch by Thomas Jablin.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130119 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-25 03:17:35 +00:00
Chandler Carruth f8c247d247 Move all of the logic for __DEPRECATED to the driver based on comments
from dgregor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130066 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-23 19:48:40 +00:00
Chandler Carruth 1cfe3c305c 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130055 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-23 09:27:53 +00:00
Chandler Carruth 50465d1d2f 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130051 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-23 06:30:43 +00:00
Francois Pichet 8387e2a41e 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130022 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-22 22:18:13 +00:00
Nick Lewycky e8ba8d78a2 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129956 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 23:44:07 +00:00
Nick Lewycky 3cc3ffc740 Fix indentation. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129954 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 23:37:32 +00:00
Daniel Dunbar 8a3a7f36ae Driver/Darwin: Allow OS X deployment targets like 10.4.11, even though they
can't be represented in the environment define.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129939 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 21:27:33 +00:00
Daniel Dunbar 0e02f6ef48 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129919 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 17:41:34 +00:00
Daniel Dunbar 7e9293b8be Driver: Improve -Xarch argument diagnostics a bit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129918 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 17:32:21 +00:00
Daniel Dunbar 32c8cb66af Driver: Suppress some additional warnings with -Qunused-arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129853 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 15:44:48 +00:00
Daniel Dunbar 659d23a4e6 Driver/Darwin: Switch to using -macosx for OS name in triples.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129834 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 23:34:17 +00:00
Daniel Dunbar 729f38ebc6 Driver/Darwin: Switch to using new style triples.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129824 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-19 21:45:47 +00:00
Daniel Dunbar 3cceec5e05 Driver/Darwin: Change to use generic iOS runtime library, which we now always need.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129734 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-18 23:48:36 +00:00
Daniel Dunbar b5fbb89314 Driver/Darwin: Disable movw/movt with -mkernel or -fapple-kext.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129721 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-18 21:26:42 +00:00
Daniel Dunbar 877ded8532 Driver: Support -fno-lto.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129712 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-18 19:44:09 +00:00
Ted Kremenek d130c7df5d Add ToolChain path support for linker on Slackware.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129704 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-18 17:50:19 +00:00
Douglas Gregor 7d2b8c1fcc Initial work to improve documentation for Clang's diagnostics, from Matthieu Monrocq
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129614 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-15 22:04:17 +00:00
Chris Lattner fc8f0e14ad fix a bunch of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129559 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-15 05:22:18 +00:00
Daniel Dunbar 34bac1f7b1 Driver/no-integrated-as: Fix forwarding of -g flag to assembler, when .s input
undergoes preprocessing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129414 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-12 23:59:20 +00:00
Chris Lattner 09f43ed8a1 fix the path to ld.so for darwin/ppc, resolving PR9677. Patch
by Jeremy Huddleston!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129299 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-11 21:15:37 +00:00
Dylan Noblesmith b8a3e8139b 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129212 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-09 13:31:59 +00:00
Evan Cheng 49af1f3ced Rename -mtrap_function= to -ftrap_function= since it's now a target neutral options.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129153 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-08 21:37:45 +00:00
Evan Cheng b20e442b31 Add -mtrap_function=<> option. rdar://9257465
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129145 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-08 18:47:41 +00:00
Chris Lattner f44a1a04a3 fix a typo, patch by PaX team.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129141 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-08 18:06:54 +00:00
Daniel Dunbar 089f872fed Driver: Don't attempt to forward some Clang-only options to cc1.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129108 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-07 20:41:03 +00:00
Daniel Dunbar c8a22b0916 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129082 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-07 18:01:20 +00:00
Eric Christopher 8f1cc075c3 Add support for Fedora16, gcc 4.6.0 and Fedora Rawhide.
Patch by Bobby Powers


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129014 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-06 18:22:53 +00:00
Ted Kremenek 43ac297829 Add ToolChain support to get Clang to recognize Ubuntu/ppc and Gentoo/ppc64.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128944 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-05 22:04:27 +00:00
Argyrios Kyrtzidis 832316e9a0 Move Driver::createInvocationFromArgs function to Frontend library to avoid dependency cycle
between libFrontend and libDriver.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128852 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-04 23:11:45 +00:00
Argyrios Kyrtzidis 054e4f50e2 Introduce Driver::createInvocationFromArgs used to create a CompilerInvocation from command-line args.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128848 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-04 21:38:51 +00:00
Daniel Dunbar 1051fc0ba0 Driver/Darwin: Tweak simulator link logic a bit more to be closer to GCC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128738 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-01 21:02:42 +00:00
Daniel Dunbar 4035580e34 Driver/Darwin: Tweak link logic for simulator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128641 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-31 17:12:33 +00:00
Daniel Dunbar 969323239f Integrated-As: Support -Wa,-L when using the integrated assembler.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128433 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-28 22:49:28 +00:00
Chandler Carruth abaca7a8be 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128371 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-27 01:50:55 +00:00
Chandler Carruth 5adb5a84bf 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128353 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-27 00:04:55 +00:00
Daniel Dunbar 59f9046031 Driver/Darwin: Dsymutil actions should put the dSYM adjacent to the output file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128292 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-25 18:16:51 +00:00
Ted Kremenek 5188507b9a Rework checker "packages" and groups to be more hierarchical.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128187 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-24 00:28:47 +00:00
Chris Lattner 7f9fc3f7ce switch a few Driver APIs to use llvm::ArrayRef, cleaning up code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128142 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-23 04:04:01 +00:00
Daniel Dunbar 3c66d30d51 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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128087 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 16:48:17 +00:00
Bob Wilson 1ec0ade3bb Add clang support for cortex-m0 cpus. Patch by James Orr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128018 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-21 20:40:05 +00:00
Joerg Sonnenberger 10c6435e90 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127996 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-21 14:01:40 +00:00
Joerg Sonnenberger 05e5930166 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127995 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-21 13:59:26 +00:00
Joerg Sonnenberger 8ab2bdcc4f 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127994 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-21 13:51:29 +00:00
Daniel Dunbar d98750f065 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127911 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-18 21:23:40 +00:00
Daniel Dunbar 5ce872fdcd Driver/Darwin: Transparently fallback when compiling i386 -fapple-kext code, we
don't support the ABI yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127903 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-18 20:14:03 +00:00
Daniel Dunbar ac0659ae41 Driver: Give SelectTool access to the action inputs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127902 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-18 20:14:00 +00:00
Daniel Dunbar 4702309fb6 Driver/Darwin: Change fallback to use llvm-gcc search paths instead of GCC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127897 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-18 19:25:15 +00:00
Daniel Dunbar 79be940271 Driver/Darwin: Kill the DarwinGCC toolchain.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127896 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-18 19:25:10 +00:00
Rafael Espindola 7693b10218 On !Darwin, do use the integrated as with -static.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127879 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-18 15:50:12 +00:00
John McCall 32096695c7 The Darwin kernel does not provide useful guard variable support.
Issue this as an IR-gen error;  it's not really worthwhile doing this
"right", i.e. in Sema, because IR gen knows a lot of tricks beyond
what the constant evaluator knows.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127854 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-18 02:56:14 +00:00
Daniel Dunbar d47ea69370 Driver/Obj-C: Be compatible with GCC behavior in that -fno-exceptions *does not*
disable Obj-C exceptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127836 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-17 23:28:31 +00:00
Daniel Dunbar 0133917074 Driver/Darwin: These are command line options, not target features.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127820 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-17 18:29:04 +00:00
Daniel Dunbar 7f6f8c8ab2 Driver/Darwin: Suppress spurious warning about -force_cpusubtype_ALL.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127819 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-17 17:37:29 +00:00
Daniel Dunbar fa41d69750 Driver/Darwin/ARM: Kernel/kext code has more strict alignment requirements.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127815 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-17 17:10:06 +00:00
Daniel Dunbar 7187fac0f1 Driver/ARM: Match GCC behavior in that -msoft-float disables NEON, despite this
not being consistent at all with other parts of the GCC implementation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127777 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-17 00:07:34 +00:00
Joerg Sonnenberger 9a2927c4e6 Use C as fallback type if in C preprocessor mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127769 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-16 22:45:02 +00:00
Douglas Gregor 814638ed5a Support Ubuntu hardy and intrepid, from Thomas Gamper!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127583 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-14 15:39:50 +00:00