Commit Graph

1874 Commits

Author SHA1 Message Date
Xinliang David Li 237fc11e5d Disable frame pointer elimination when using -pg
(Re-apply patch after bug fixing)

This diff makes sure that the driver does not pass
-fomit-frame-pointer or -momit-leaf-frame-pointer to
the frontend when -pg is used. Currently, clang gives 
an error if -fomit-frame-pointer is used in combination 
with -pg, but -momit-leaf-frame-pointer was forgotten.
Also, disable frame pointer elimination in the frontend 
when -pg is set.

Patch by Stefan Kempf.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253886 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-23 17:30:31 +00:00
Martell Malone 5ec4b4c5b2 Revert part of r253813
The new lld gnu frontend does not support the -target option

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253874 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-23 16:04:55 +00:00
Xinliang David Li 6277fb58d7 Revert r253846 (build bot failure))
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253851 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-23 05:41:05 +00:00
Xinliang David Li 957c5b5a74 Disable frame pointer elimination when using -pg
This diff makes sure that the driver does not pass
-fomit-frame-pointer or -momit-leaf-frame-pointer to
the frontend when -pg is used. Currently, clang gives 
an error if -fomit-frame-pointer is used in combination 
with -pg, but -momit-leaf-frame-pointer was forgotten.
Also, disable frame pointer elimination in the frontend 
when -pg is set.

Patch by Stefan Kempf.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253846 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-23 05:09:10 +00:00
Martell Malone 77feea30f7 Driver: Specifically tell the linker the target for mingw-w64
Cross compiling from linux and OSX results in Error: Exec format.
This is because the linker is expecting ELF formated objects.
By passing the target we can explicitly tell the linker that
it should be linking COFF objects regardless of the host.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253813 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-22 05:40:06 +00:00
Peter Collingbourne 791fae7a1f Driver: Defer computation of linker path until it is needed.
This allows us to construct Linux toolchains without a valid linker. This
is needed for example to build a CUDA device toolchain after r253385.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253707 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-20 20:49:39 +00:00
Hans Wennborg 24d8ca594e Revert r253582: "clang-cl: Make /W4 imply -Wall -Wextra (PR25563)"
The patch expanded the flag *at the end*, breaking invocations like:

  clang-cl /W4 -Wno-unused-parameter

Reverting for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253678 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-20 16:51:56 +00:00
Douglas Katzman 5885136736 [Myriad]: handle Preprocess job action (-E)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253647 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-20 04:58:12 +00:00
Hans Wennborg d6fdc583ab clang-cl: Make /W4 imply -Wall -Wextra (PR25563)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253582 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-19 17:49:59 +00:00
Bradley Smith f541bc67f4 [ARM] Support +feature targeting in -mcpu/-march
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253471 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-18 16:33:48 +00:00
Douglas Katzman 11a671a08f [Myriad]: insert -L paths into linker cmd only when they exist.
Differential Revision: http://reviews.llvm.org/D14754

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253467 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-18 16:24:46 +00:00
Douglas Katzman 419abc9995 [Myriad]: -nostdlib implies -nostartfiles
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253390 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-17 22:33:34 +00:00
Artem Belevich 2a6c10f5d8 [CUDA] Make CUDA compilation usable by default.
Currently clang requires several additional command
line options in order to enable new features needed
during CUDA compilation. This patch makes these
options default.

* Automatically include cuda_runtime.h if we've found
  a valid CUDA installation.
* Disable automatic CUDA header inclusion during unit tests.
* Added test case for command line construction.
* Enabled target overloads and relaxed call checks that are
  needed in order to include CUDA headers.
* Added CUDA-7.5 installation path to the CUDA installation search list.
* Define __CUDA__ macro to indicate CUDA compilation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253389 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-17 22:28:55 +00:00
Artem Belevich 7211791943 [CUDA] added include paths for both sides of CUDA compilation.
In order to compile a CUDA file clang must be able to find
include files for both both host and device.

This patch passes AuxToolchain to AddPreprocessingOptions and
uses it to add include paths for the opposite side of compilation.

We also must be able to find CUDA include files. If the driver
found CUDA installation, it adds appropriate include path
to CUDA headers. This can be disabled with '-nocudainc'.

- Added include paths for the opposite side of compilation.
- Added include paths to detected CUDA installation.
- Added -nocudainc to prevent adding CUDA include path.
- Added test cases to verify new functionality.

Differential Revision: http://reviews.llvm.org/D13170

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253386 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-17 22:28:46 +00:00
Artem Belevich 556fea86b4 [CUDA] use -aux-triple to pass target triple of opposite side of compilation
Clang needs to know target triple for both sides of compilation so that
preprocessor macros and target builtins from both sides are available.

This change augments Compilation class to carry information about
toolchains used during different CUDA compilation passes and refactors
BuildActions to use it when it constructs CUDA jobs.

Removed DeviceTriple from CudaHostAction/CudaDeviceAction as it's no
longer needed.

Differential Revision: http://reviews.llvm.org/D13144

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253385 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-17 22:28:40 +00:00
Douglas Katzman f418a27719 Use !hasArg with two options instead of !hasArg && !hasArg.
Thereby fixing a warning about failure to claim all args.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253372 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-17 20:28:07 +00:00
Douglas Katzman 5417ea0ce8 Add trivial utility to append -L arguments to linker step. NFC
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253350 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-17 17:41:23 +00:00
Douglas Katzman 124e904edd [Myriad]: pass the 'std=' option to moviCompile
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253213 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 15:38:40 +00:00
Rafael Espindola 5b7eec804c Update for the gnu flavor being renamed to old-gnu.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253191 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-16 09:12:12 +00:00
Yaron Keren 4f60e73bd8 Make the mingw toolchain accept 'ld' and 'lld' only as values to -fuse-ld.
Post-commit suggestion by Filipe Cabecinhas.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253161 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-15 08:06:27 +00:00
Justin Bogner 2615c4a4ab Revert "[AArch64] Unconditionally pass subtarget feature reserve-x18 on Darwin."
This reverts r243310, which is redundant as of r253102.

Conflicts:
	lib/Driver/Tools.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253104 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 23:07:31 +00:00
Akira Hatanaka 89b2048244 Add support for driver option -mno-ms-bitfields.
This option is used to cancel -mms-bitfields on the command line.

rdar://problem/15898553


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252912 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 17:21:22 +00:00
Vasileios Kalintiris 6cbd42c5de Re-recommit: Add support for the new mips-mti-linux toolchain.
Last time, this caused two Windows buildbots and a single ARM buildbot to fail.
I XFAIL'd the failing test on win32,win64 machines in order to see if the ARM
buildbot complains again.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252901 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 15:26:54 +00:00
Joerg Sonnenberger cf22e53990 Use the generic Sparc CPU handling for Linux, FreeBSD and OpenBSD, too.
This currently changes the default toward the more historic -Av8/-Av9,
but as discussed with James Y Knight, consistency is for now more
important than figuring out which default CPU each OS should be using.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252571 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-10 00:40:29 +00:00
Joerg Sonnenberger 26f8a3c655 Use the normal switch over getArch() approach and not a long if chain.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252562 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-10 00:23:12 +00:00
Joerg Sonnenberger 6116fc0887 Reorganise CPU handling for Sparc. When using -mcpu=v9 and co, __sparcv8
is not defined for 32bit mode, but __sparcv9 is. Pass down the correct
-target-cpu flags to the backend, so that instruction restrictions are
applied correctly. Pass down the correct -A flag when not using IAS.
The latter is limited to NetBSD targets in this commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252545 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-09 23:39:45 +00:00
Renato Golin 2afc87e217 [EABI] Add Clang support for -meabi flag
The -meabi flag to control LLVM EABI version.

Without '-meabi' or with '-meabi default' imply LLVM triple default.
With '-meabi gnu' sets EABI GNU.
With '-meabi 4' or '-meabi 5' set EABI version 4 and 5 respectively.

A similar patch was introduced in LLVM.

Patch by Vinicius Tinti.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252463 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-09 12:40:41 +00:00
John McCall 57c6d436f0 After some discussion, promote -fobjc-weak to a driver option.
rdar://problem/23415863

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252187 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 19:19:56 +00:00
Eugene Zelenko 8a76d2e3bd Fix some Clang-tidy modernize warnings, other minor fixes.
Differential revision: http://reviews.llvm.org/D14311


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252081 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-04 21:37:17 +00:00
Aaron Ballman 9e2aa8e15a Silence "enumeral and non-enumeral type in conditional expression" warning; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252047 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-04 14:43:43 +00:00
Teresa Johnson 9a8bffc6b1 Clang format a few prior patches (NFC)
I had clang formatted my earlier patches using the wrong style.
Reformatted with the LLVM style.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251813 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-02 18:03:12 +00:00
Tim Northover 4f3b7565cd Disable SjLj exceptions for watchOS
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251709 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-30 16:30:41 +00:00
Tim Northover 9605ec4bd7 Watch and TV OS: wire up basic ABI choices
This sets the mostly expected Darwin default ABI options for these two
platforms. Active changes from these defaults for watchOS are in a later patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251708 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-30 16:30:36 +00:00
Tim Northover 56c5241273 Support watchOS and tvOS driver options
This patch should add support for almost all command-line options and
driver tinkering necessary to produce a correct "clang -cc1"
invocation for watchOS and tvOS.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251706 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-30 16:30:27 +00:00
Vasileios Kalintiris df2a595cc3 Revert "[mips] Add support for the new mips-mti-linux toolchain."
This reverts commits r251633. I'll investigate the test failure off trunk in
order to keep the buildbots clean.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251698 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-30 11:28:39 +00:00
Renato Golin 4f4b142134 Revert "Try to run and investigate the mips-mti-linux.c test failure on ARM buildbots."
This reverts commit r251695. Debug is meant to be done off tree, not use the buildbots
experiments. I'll help investigate this problem off trunk.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251696 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-30 11:12:36 +00:00
Vasileios Kalintiris 6d07a67d27 Try to run and investigate the mips-mti-linux.c test failure on ARM buildbots.
This should be a NFC for every toolchain other than mips-mti-linux (where we
print the list of directories searched for crt files). It will soon be
reverted once we hit the clang-cmake-armv7-a15-selfhost-neon buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251695 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-30 10:35:38 +00:00
Vasileios Kalintiris 938b22a8b3 [mips] Add support for the new mips-mti-linux toolchain.
The original commit in r249137 added the mips-mti-linux toolchain. However,
the newly added tests of that commit failed in few buildbots. This commit
re-applies the original changes but XFAILs the test file which caused
the buildbot failures. This will allow us to examine what's going wrong
without having to commit/revert large changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251633 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-29 15:33:53 +00:00
Saleem Abdulrasool 0e6de21771 Driver: CrossWindows sanitizers link support
Add the required libraries to the linker invocation when building with
sanitizers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251600 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-29 03:36:45 +00:00
Saleem Abdulrasool ed571a8fac Driver: inline some small arrays
Use an initializer list to remove a couple of small static arrays.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251599 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-29 03:36:42 +00:00
Benjamin Kramer ea62bd9c83 Put global classes into the appropriate namespace.
Most of the cases belong into an anonymous namespace. No functionality
change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251514 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-28 13:54:16 +00:00
Saleem Abdulrasool 3e66583b18 Driver: support -fuse-ld= on cross windows
Update the linker selection to support the `-fuse-ld=` option for selecting a
linker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251493 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-28 04:45:58 +00:00
Daniel Sanders 83c707824a [mips] Separated mips specific -Wa options, so that they are not checked on other platforms.
Summary: This is a follow on to post review comments on revision r248276.

Patch by Scott Egerton.

Reviewers: vkalintiris, dsanders

Subscribers: joerg, rengolin, cfe-commits

Differential Revision: http://reviews.llvm.org/D13100


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251430 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-27 18:04:42 +00:00
John McCall abdd82457f Define weak and __weak to mean ARC-style weak references, even in MRC.
Previously, __weak was silently accepted and ignored in MRC mode.
That makes this a potentially source-breaking change that we have to
roll out cautiously.  Accordingly, for the time being, actual support
for __weak references in MRC is experimental, and the compiler will
reject attempts to actually form such references.  The intent is to
eventually enable the feature by default in all non-GC modes.
(It is, of course, incompatible with ObjC GC's interpretation of
__weak.)

If you like, you can enable this feature with
  -Xclang -fobjc-weak
but like any -Xclang option, this option may be removed at any point,
e.g. if/when it is eventually enabled by default.

This patch also enables the use of the ARC __unsafe_unretained qualifier
in MRC.  Unlike __weak, this is being enabled immediately.  Since
variables are essentially __unsafe_unretained by default in MRC,
the only practical uses are (1) communication and (2) changing the
default behavior of by-value block capture.

As an implementation matter, this means that the ObjC ownership
qualifiers may appear in any ObjC language mode, and so this patch
removes a number of checks for getLangOpts().ObjCAutoRefCount
that were guarding the processing of these qualifiers.  I don't
expect this to be a significant drain on performance; it may even
be faster to just check for these qualifiers directly on a type
(since it's probably in a register anyway) than to do N dependent
loads to grab the LangOptions.

rdar://9674298

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251041 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 18:38:17 +00:00
Xinliang David Li 37bc78dc7a clang driver toolchain refactoring
In this patch, the file static method addProfileRT is
moved to be a virtual member function of base ToolChain class.
This allows derived toolchain to override the default behavior
easily and make it consistent with Darwin toolchain (a TODO was
added for this refactoring - now removed). A new helper method
is also introduced to test if instrumentation profile option
is turned on or not.

Differential Revision: http://reviews.llvm.org/D13326


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250994 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 06:15:31 +00:00
Douglas Katzman 2ca27de5f3 [Myriad]: Always add -L paths even if -nostdlib is set.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250932 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-21 19:33:54 +00:00
Dimitry Andric 08ead09cfb Support linking against OpenMP runtime on FreeBSD.
Summary:
Similar to rL248426 (which was a followup to rL248379 and rL248424), add the
required libraries for OpenMP on the linker command line, and update the test
case.

Reviewers: emaste, theraven, joerg

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D13822

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250657 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-18 13:32:20 +00:00
Craig Topper f112eacb43 Make a bunch of static arrays const.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250647 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-18 05:29:26 +00:00
Filipe Cabecinhas 390d9b3e92 PS4: Make sure to add the sanitizer runtime before any linker input
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250514 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-16 15:07:48 +00:00
Teresa Johnson b30376f1ca Recommit "Clang support for -flto=thin."
This recommits r250398 with fixes to the tests for bot failures.

Add "-target x86_64-unknown-linux" to the clang invocations that
check for the gold plugin.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250455 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-15 20:35:53 +00:00