Commit Graph

3713 Commits

Author SHA1 Message Date
Rafael Espindola f8f01c3d59 Handle -Wa,--mrelax-relocations=[no|yes].
llvm-svn: 271162
2016-05-29 02:01:14 +00:00
Simon Atanasyan 96d06c6972 [driver][mips] Fix local variable naming. NFC
llvm-svn: 271110
2016-05-28 09:44:15 +00:00
Simon Atanasyan 4de8e6d283 [driver][mips] Revert support for CodeSourcery MIPS toolchain
This is revert of r270366. The support for CS toolchain were dropped too early.

llvm-svn: 271109
2016-05-28 09:44:04 +00:00
Bruno Cardoso Lopes 681d717219 [Driver] Fix driver support for color diagnostics
Diagnostics that happen during driver time do not have color output support
unless -fcolor-diagonostic is explicitly passed into the driver.  This is not a
problem for cc1 since dianostic arguments are properly handled and color is
enabled by default if the terminal supports it.

Make the driver behave like CC1. There are tests that already check for these
flags, but for the color itself there's no sensible way to test it.

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

rdar://problem/26290980

llvm-svn: 271042
2016-05-27 20:43:00 +00:00
Simon Dardis d0e83bad13 [mips] Compact branch policy setting.
This patch adds the commandline option -mcompact-branches={never,optimal,always),
which controls how LLVM generates compact branches for MIPSR6 targets. By default,
the compact branch policy is 'optimal' where LLVM will generate the most
appropriate branch for any situation. The 'never' and 'always' policy will disable
or always generate compact branches wherever possible respectfully.

Reviewers: dsanders, vkalintiris, atanasyan

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

llvm-svn: 271000
2016-05-27 15:13:31 +00:00
Daniel Sanders 07c8654284 [mips] Kill 'support' for untested EABI.
Summary:
There are no llvm backend tests* for EABI and no EABI buildbots. There were only
three clang tests, all of which checked that -mabi=eabi was passed to the
assembler.

*There is a single backend test that specifies EABI but it actually tests MIPS16.

Reviewers: atanasyan

Subscribers: emaste, sdardis, atanasyan, cfe-commits

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

llvm-svn: 270998
2016-05-27 14:30:23 +00:00
Benjamin Kramer cfeacf56f0 Apply clang-tidy's misc-move-constructor-init throughout Clang.
No functionality change intended, maybe a tiny performance improvement.

llvm-svn: 270996
2016-05-27 14:27:13 +00:00
Benjamin Kramer 2e018efa9b Turn copies into references as suggested by clang-tidy's performance-unnecessary-copy-initialization.
llvm-svn: 270994
2016-05-27 13:36:58 +00:00
Alexey Bataev 18c4852607 [OPENMP] Fixed processing of '-fopenmp-version=' option and test.
llvm-svn: 270962
2016-05-27 04:13:39 +00:00
Konstantin Zhuravlyov e6dbd902c0 [AMDGPU] Remove individual debugger options + update features
Differential Revision: http://reviews.llvm.org/D20336

llvm-svn: 270895
2016-05-26 19:36:39 +00:00
Alexey Bataev c6bd8917f2 [OPENMP] Add option '-fopenmp-version=[31|40|45]' allowing choosing
OpenMP version.

If '-fopenmp' option is provided '-fopenmp-version=' allows to control,
which version of OpenMP must be supported. Currently it affects only the
value of _OPENMP define.

llvm-svn: 270838
2016-05-26 11:10:11 +00:00
Renato Golin 3b8709c583 Revert "[AArch64] Using new TargetParser in Clang"
This reverts commit r270688 and r270689. The issue is not a random order, but a
different order for some targets and others (prob. Linux vs Darwin). Reverting until
we have a better fix.

llvm-svn: 270691
2016-05-25 12:36:31 +00:00
Renato Golin d4d4da74a6 [AArch64] Using new TargetParser in Clang
Using AArch64TargetParser in clang to avoid repetitive string parsing.

Use TargetParser to do ARCH/CPU/ArchExt parsing instead of local implementation.

Patch by Jojo Ma.

llvm-svn: 270688
2016-05-25 12:02:58 +00:00
Hans Wennborg debfed9ef0 clang-cl: Fix unused argument warning when combining /O2 and /Ob2
llvm-svn: 270642
2016-05-25 00:43:45 +00:00
Hans Wennborg 3270bdbb03 clang-cl: Bake /Ob0 and /Ob2 into the general /O option handling
This is a follow-up to r270609, wherein I forgot that /O options can
be combined, and e.g. /Odb2 is a valid combination.

llvm-svn: 270614
2016-05-24 21:23:29 +00:00
Hans Wennborg 7a00888a08 [Driver] Add support for -finline-functions and /Ob2 flags
-finline-functions and /Ob2 are currently ignored by Clang. The only way to
enable inlining is to use the global O flags, which also enable other options,
or to emit LLVM bitcode using Clang, then running opt by hand with the inline
pass.

This patch allows to simply use the -finline-functions flag (same as GCC) or
/Ob2 in clang-cl mode to enable inlining without other optimizations.

This is the first patch of a serie to improve support for the /Ob flags.

Patch by Rudy Pons <rudy.pons@ilod.org>!

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

llvm-svn: 270609
2016-05-24 20:40:51 +00:00
Jacob Baungard Hansen 13a4937404 [Sparc] Add software float option -msoft-float
Summary:
Following patch D19265 which enable software floating point support in the Sparc backend, this patch enables the option to be enabled in the front-end using the -msoft-float option.

The user should ensure a library (such as the builtins from Compiler-RT) that includes the software floating point routines is provided.

Reviewers: jyknight, lero_chris

Subscribers: jyknight, cfe-commits

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

llvm-svn: 270538
2016-05-24 08:30:08 +00:00
Justin Lebar 91f6f07bb8 [CUDA] Add -fcuda-approx-transcendentals flag.
Summary:
This lets us emit e.g. sin.approx.f32.  See
http://docs.nvidia.com/cuda/parallel-thread-execution/#floating-point-instructions-sin

Reviewers: rnk

Subscribers: tra, cfe-commits

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

llvm-svn: 270484
2016-05-23 20:19:56 +00:00
Jacob Baungard Hansen c345705bee Test commit
llvm-svn: 270435
2016-05-23 13:12:29 +00:00
Saleem Abdulrasool 6f8442bdd8 Driver: support exherbo's multiarch support
Exherbo has an alternative file system layout to accommodate multiarch.  The
loader is located at /usr/${triple}/lib/${loader}.  Adjust the Linux toolchain
to support that on exherbo.

llvm-svn: 270392
2016-05-23 02:17:28 +00:00
Simon Atanasyan 6c51f5aca8 [driver][mips] clang-format the code. NFC
llvm-svn: 270374
2016-05-22 18:18:41 +00:00
Simon Atanasyan 2834a229b2 [driver][mips] Support new versions of MIPS CodeScape toolchains
llvm-svn: 270373
2016-05-22 18:18:07 +00:00
Simon Atanasyan 4f3fe5b1a6 [driver][mips] Use target triple mips-mti-linux-gnu for toolchain detection
llvm-svn: 270368
2016-05-22 15:28:34 +00:00
Simon Atanasyan cf7ac67f69 [driver][mips] Rename some variables to better reflect their purpose. NFC
llvm-svn: 270367
2016-05-22 15:27:58 +00:00
Simon Atanasyan 74468a5bc9 [driver][mips] Drop support for outdated version of CodeSourcery MIPS toolchain
llvm-svn: 270366
2016-05-22 15:27:36 +00:00
Saleem Abdulrasool 783fc635f6 Driver: sink getLinuxDynamicLoader into the Toolchain
The parameter already requires the toolchain, sink the method into the class.
This also enables the use of the distro detection logic which will be needed to
support Exherbo's multiarch approach.

llvm-svn: 270352
2016-05-22 03:12:19 +00:00
Saleem Abdulrasool c9befbf552 Driver: simplify getDynameLinker
Convert the cascading if/else to a switch.  This makes it easier to follow the
logic.  Minor difference is that we no longer default to x86_64 but rather to
the architecture specified by the architecture.

llvm-svn: 270351
2016-05-22 01:37:36 +00:00
Adrian McCarthy 8e0879a9d3 Eliminate unnecessary file access checks in Clang driver on Windows
Differential Revision: http://reviews.llvm.org/D20454

llvm-svn: 270226
2016-05-20 15:46:23 +00:00
Artem Belevich ffa5fc51b8 [CUDA] Allow sm_50,52,53 GPUs
LLVM accepts them since r233575.

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

llvm-svn: 270084
2016-05-19 17:47:47 +00:00
Simon Atanasyan a45502d412 [driver] Do not pass install dir to the MultilibSet include dirs callback
All additional include directories are relative to the toolchain install
folder. So let's do not pass this folder to each callback to simplify
and slightly reduce the code.

llvm-svn: 270069
2016-05-19 15:07:21 +00:00
Simon Atanasyan c69d28162b [driver] Do not pass target triple to the MultilibSet include dirs callback
No one callback uses target triple so we can escape passing the unused
argument.

llvm-svn: 270068
2016-05-19 15:07:00 +00:00
Simon Atanasyan d9fc3f030a [driver][mips] Hardcode triple name in case of CodeSourcery toolchain. NFC
CodeSourcery toolchain is a standalone toolchain which always uses
the same triple name in its paths. It is independent from target
triple used by the driver.

llvm-svn: 270067
2016-05-19 15:05:22 +00:00
Rafael Espindola 3c70d38d1f Update for llvm change.
llvm-svn: 269989
2016-05-18 22:04:57 +00:00
Steven Wu 1257cd8fd8 [Driver] Fix the case when use -fembed-bitcode and -flto= together
Summary:
-fembed-bitcode was only checking for old style LTO flag (-flto) but not
considering the new -flto= style option. That makes clang output bitcode
embedded in bitcode object when using -flto= and -fembed-bitcode= together.
Now clang should output normal bitcode file when using LTO and ignores
-fembed-bitcode option.

Reviewers: joker.eph

Subscribers: joker.eph, cfe-commits

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

llvm-svn: 269961
2016-05-18 17:04:52 +00:00
Petar Jovanovic 3ca1622a90 [Mips] Finetuning MIPS32 Android default variants
MIPS32 Android defaults to FPXX ("-fpxx").
MIPS32R6 Android defaults to FP64A ("-mfp64 -mno-odd-spreg").

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

llvm-svn: 269914
2016-05-18 12:46:06 +00:00
Alexey Bataev a7547183ec Support for MSVS default calling convention options (/Gd, /Gz, /Gv,
/Gr), by Alexander Makarov

Patch for bug #27711
Differential Revision: http://reviews.llvm.org/D20171

llvm-svn: 269891
2016-05-18 09:06:38 +00:00
Yaron Keren 5439b64af0 Teach clang to look for libcxx in /usr/local/include/c++ on Linux
As The default CMAKE install prefix is /usr/local ( https://cmake.org/cmake/help/v3.0/variable/CMAKE_INSTALL_PREFIX.html ),
sudo ninja install ends up installing clang, LLVM and libcxx under /usr/local.
In development scenario, when clang is run from the build location it will not
find libcxx at neither (build location)/../include/c++ nor /usr/include/c++.
This patch lets development clang find system installed libcxx without adding
-isystem /usr/local/include/c++. Also addresses the FIXME by explaining the 
use-case for these include paths.

llvm-svn: 269801
2016-05-17 19:01:16 +00:00
Petar Jovanovic 009494fe09 [Mips] Set mips32 as default CPU for MIPS32 Android
Change default CPU for MIPS32 Android. Now it is mips32 (rev1).

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

llvm-svn: 269754
2016-05-17 10:46:10 +00:00
Paul Robinson 9d61361acb [PS4] Change the names of some "environmental" things to what our
licensees actually see in the toolchain we deliver to them.  This will
reduce the set of local patches we have to maintain.  The triple is
not changing.  (The term ORBIS is an internal code name for PS4.)

llvm-svn: 269671
2016-05-16 17:22:25 +00:00
Daniel Sanders e160f83f71 [mips] Enable IAS by default for 32-bit MIPS targets (O32).
Summary:
The MIPS IAS can now pass 'ninja check-all', recurse, build a bootable linux
kernel, and pass a variety of LNT testing.

Unfortunately we can't enable it by default for 64-bit targets yet since the N32
ABI is still very buggy and this also means we can't enable it for N64 either
because we can't distinguish between N32 and N64 in the relevant code.

Reviewers: vkalintiris

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D18759
Differential Revision: http://reviews.llvm.org/D18761

llvm-svn: 269560
2016-05-14 12:43:08 +00:00
NAKAMURA Takumi 2326f79a60 MSVCToolChain.cpp: Make version.dll generic for win32.
We may consider msvc features may be capable on mingw host, if it can.
Consider --host=mingw --target=msvc.

llvm-svn: 269557
2016-05-14 08:12:37 +00:00
NAKAMURA Takumi 4b8e3e59cd MSVCToolChain.cpp: Use explicit constructor for SmallString from std::string, to appease mingw-g++.
llvm-svn: 269556
2016-05-14 08:09:12 +00:00
Adrian McCarthy e4b26fc7a7 Get default -fms-compatibility-version from cl.exe's version
-fms-compatibility-version was defaulting to 18 (VS 2013), which is a pain if your environment is pointing to version 19 (VS 2015) libraries.

If cl.exe can be found, this patch uses its version number as the default instead. It re-uses the existing code to find the Visual Studio binaries folder and WinAPI methods to check its version. You can still explicitly specify a compatibility version on the command line. If you don't have cl.exe, this should be a no-op and you'll get the old default of 18.

This affected the tests, which assumed that if you didn't specific a version, that it would default to 18, but this won't be true for all machines. So a couple test cases had to be eliminated and a couple others had to be tweaked to allow for various outputs.

Addresses: https://llvm.org/bugs/show_bug.cgi?id=27215

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

llvm-svn: 269515
2016-05-13 23:20:11 +00:00
Vasileios Kalintiris fc1186510b Simplify getLinuxDynamicLinker() by using a common variable for the triple. NFC.
llvm-svn: 269412
2016-05-13 12:34:14 +00:00
Vasileios Kalintiris b3f9f5f963 [mips] Consult triple's vendor field before using musl's interpreter.
This should affect only the mips-mti-linux toolchain.

llvm-svn: 269411
2016-05-13 12:13:13 +00:00
Filipe Cabecinhas ab731f7e86 [ubsan] Add -fsanitize-undefined-strip-path-components=N
Summary:
This option allows the user to control how much of the file name is
emitted by UBSan. Tuning this option allows one to save space in the
resulting binary, which is helpful for restricted execution
environments.

With a positive N, UBSan skips the first N path components.
With a negative N, UBSan only keeps the last N path components.

Reviewers: rsmith

Subscribers: cfe-commits

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

llvm-svn: 269309
2016-05-12 16:51:36 +00:00
Marcin Koscielnicki 10721435d6 [Driver] Squash misleading indentation warning.
llvm-svn: 269279
2016-05-12 10:27:59 +00:00
Steven Wu 27fb5227ec Embed bitcode in object file (clang cc1 part)
Summary:
Teach clang to embed bitcode inside bitcode. When -fembed-bitcode cc1
option is used, clang will embed both the input bitcode and cc1
commandline into the bitcode in special sections before compiling to
the object file.  Using -fembed-bitcode-marker will only introduce a
marker in both sections.

Depends on D17390

Reviewers: rsmith

Subscribers: yaron.keren, vsk, cfe-commits

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

llvm-svn: 269202
2016-05-11 16:26:03 +00:00
Reid Kleckner 330fb175d4 Update clang support on recent Haiku
[ Copied from https://llvm.org/bugs/show_bug.cgi?id=26404 ]

clang support on Haiku is lagging a bit, and missing on x86_64.

This patch updates support for x86 and add support for x86_64. It should
apply directly to trunk and it's harmless in the sense that it only
affects Haiku.

Reviewers: rnk, rsmith

Patch by Jérôme Duval

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

llvm-svn: 269201
2016-05-11 16:19:05 +00:00
Douglas Katzman 5eddc2395b [Myriad] Use Generic_ELF::addClangTargetOptions()
llvm-svn: 268956
2016-05-09 19:09:59 +00:00
Nemanja Ivanovic d99f21b0e6 [Power9] Enable -mcpu=pwr9 (-mcpu=power9) in the front end
This patch corresponds to review:
http://reviews.llvm.org/D19684

It simply adds the handling for the option and the corresponding macros.

llvm-svn: 268951
2016-05-09 18:58:02 +00:00
Rafael Espindola 52fe8966b5 Proper detection and handling of RHEL and variants.
- Don't consider "/etc/lsb-release" to be Ubuntu only.
- Detect SL, too.
- Only add "--no-add-needed" for RHEL7 (or Fedora), not for RHEL6
  (that's what the compilers shipped with RHEL do).
- removed RHEL4 which is now four years past EOL and certainly incapable
  of building or running any recent version of llvm/clang.

llvm-svn: 268914
2016-05-09 13:13:50 +00:00
Rafael Espindola 2edca417c1 RHEL: Look in more places to find g++ headers and runtime.
Some distros with ten years of support ship an old gcc but later offer
more recent versions for installation in parallel. These versions are
typically not only needed for the compilation of llvm/clang, but also to
properly use the clang binary that comes out.

Clang already searches /usr at runtime for the most recent installation
of gcc. This patch appends paths for add-on installations of gcc in
RHEL.

Patch by Michael Lampe.

llvm-svn: 268912
2016-05-09 13:03:10 +00:00
Chandler Carruth 81296fb3a4 Teach header search about GCC 4.9 header search paths in Gentoo, they
now use the full GCC version in their weird suffix.

llvm-svn: 268874
2016-05-08 07:59:56 +00:00
Tom Stellard f6699f5047 AMDGPU: Use lld as the linker again
Summary:
Now that LLVM is emitting version 2 of the AMD code object, we can
start using lld again for linking instead of our custom tool.

Reviewers: arsenm, kzhuravl

Subscribers: rafael, cfe-commits

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

llvm-svn: 268648
2016-05-05 17:03:41 +00:00
Akira Hatanaka e42181315c Do not add uwtable attribute by default for MachO targets.
r217178 changed clang to add function attribute uwtable by default on
Win64, which caused the __eh_frame section to be emitted by default.
This commit restores the previous behavior for MachO targets.

rdar://problem/25282627

llvm-svn: 268589
2016-05-05 01:41:07 +00:00
Marcin Koscielnicki b31ee6db11 [SystemZ] Add -mbackchain option.
This option, like the corresponding gcc option, is SystemZ-specific and
enables storing frame backchain links, as specified in the ABI.

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

llvm-svn: 268575
2016-05-04 23:37:40 +00:00
Kostya Serebryany ceb1add630 document -f[no-]sanitize-recover=all and mention it in warning messages
llvm-svn: 268540
2016-05-04 20:21:47 +00:00
Bruno Cardoso Lopes 34c549ea02 Revert "[Driver] Quote clang full version in dwarf producer when invoking cc1as"
This reverts commit r264813 / 6484b95d634f53dd929c75265ef3c4decf397584.

While using it in the shell is fine, this a problem when cc1as is
invoked directly by the driver because single quoting the clang full
version makes cc1as write out the version with the quotes in the final
binary.

If the user wants to copy-n-pastable output, it could use either -###
or CC_PRINT_OPTIONS=1 clang -v ...

llvm-svn: 268297
2016-05-02 20:20:49 +00:00
Chris Bieneman e60e7c2987 Add a new warning to notify users of mismatched SDK and deployment target
Summary:
This patch adds a new driver warning -Wincompatible-sdk which notifies the user when they are mismatching the version min options and the sysroot.

The patch works by checking the sysroot (if present) for an SDK name, then matching that against the target platform. In the case of a mismatch it logs a warning.

Reviewers: bob.wilson, rsmith

Subscribers: rsmith, edward-san, cfe-commits

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

llvm-svn: 268127
2016-04-29 22:28:34 +00:00
Peter Collingbourne 3afb266886 Re-apply r267784, r267824 and r267830.
I have updated the compiler-rt tests.

llvm-svn: 267903
2016-04-28 17:09:37 +00:00
Benjamin Kramer 5556a5cf3b Revert r267784, r267824 and r267830.
It makes compiler-rt tests fail if the gold plugin is enabled.

Revert "Rework interface for bitset-using features to use a notion of LTO visibility."
Revert "Driver: only produce CFI -fvisibility= error when compiling."
Revert "clang/test/CodeGenCXX/cfi-blacklist.cpp: Exclude ms targets. They would be non-cfi."

llvm-svn: 267871
2016-04-28 12:14:47 +00:00
Peter Collingbourne f10237b689 Driver: only produce CFI -fvisibility= error when compiling.
The -fvisibility= flag only affects compile jobs, so there's no need to
error out because of it if we aren't compiling (e.g. if we are only linking).

llvm-svn: 267824
2016-04-28 00:18:30 +00:00
Peter Collingbourne a8b2f7c0d7 Rework interface for bitset-using features to use a notion of LTO visibility.
Bitsets, and the compiler features they rely on (vtable opt, CFI),
only have visibility within the LTO'd part of the linkage unit. Therefore,
only enable these features for classes with hidden LTO visibility. This
notion is based on object file visibility or (on Windows)
dllimport/dllexport attributes.

We provide the [[clang::lto_visibility_public]] attribute to override the
compiler's LTO visibility inference in cases where the class is defined
in the non-LTO'd part of the linkage unit, or where the ABI supports
calling classes derived from abstract base classes with hidden visibility
in other linkage units (e.g. COM on Windows).

If the cross-DSO CFI mode is enabled, bitset checks are emitted even for
classes with public LTO visibility, as that mode uses a separate mechanism
to cause bitsets to be exported.

This mechanism replaces the whole-program-vtables blacklist, so remove the
-fwhole-program-vtables-blacklist flag.

Because __declspec(uuid()) now implies [[clang::lto_visibility_public]], the
support for the special attr:uuid blacklist entry is removed.

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

llvm-svn: 267784
2016-04-27 20:39:53 +00:00
Nico Weber 47bf505775 driver: Add a `--rsp-quoting` flag to pick response file quoting.
Currently, clang-cl always uses Windows style for unquoting, and clang always
uses POSIX style for unquoting.

With this flag, it's possible to change these defaults.

In general, response file quoting should match the shell the response file is
used in.  On Windows, it's possible to run clang-cl in a bash shell, or clang in
cmd.exe, so a flag for overriding the default behavior is natural there.

On non-Windows, Windows quoting probably never makes sense (except maybe in
Wine), but having clang-cl behave differently based on the host OS seems
strange too.  So require that people who want to use posix-style response
files with clang-cl on non-Windows pass --rsp-quoting=posix.

http://reviews.llvm.org/D19425

llvm-svn: 267474
2016-04-25 21:15:49 +00:00
Derek Bruening 256c2e14c7 [esan] EfficiencySanitizer driver flags
Summary:
Adds a framework to enable the instrumentation pass for the new
EfficiencySanitizer ("esan") family of tools.  Adds a flag for esan's
cache fragmentation tool via -fsanitize=efficiency-cache-frag.
Adds appropriate tests for the new flag.

Reviewers: eugenis, vitalybuka, aizatsky, filcab

Subscribers: filcab, kubabrecka, llvm-commits, zhaoqin, kcc

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

llvm-svn: 267059
2016-04-21 21:32:04 +00:00
Nico Weber ad2d8f3dfd clang-cl: Don't assert on using /Yc with non-source files, PR27450
Move phase handling after input type validation.

llvm-svn: 267040
2016-04-21 19:59:10 +00:00
Andrey Turetskiy 6a8b91df64 Compilation for Intel MCU (Part 1/3)
Add -miamcu option which:
  * Sets IAMCU triple
  * Sets IAMCU ABI
  * Enforces static compilation

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

llvm-svn: 266972
2016-04-21 10:16:48 +00:00
Douglas Katzman 3103f25320 Fix PR26999 better- RenderDebugEnablingArgs() once only
llvm-svn: 266797
2016-04-19 18:55:53 +00:00
Douglas Katzman 5a9a685405 Pass dwarf-version to cc1as.
Fix PR26999 - crashing in cc1as with any '*bsd' target.

llvm-svn: 266775
2016-04-19 17:43:54 +00:00
Andrey Turetskiy f7d9b26384 Revert r266747 (Compilation for Intel MCU (Part 1/3)) since it breaks a few buildbots.
llvm-svn: 266753
2016-04-19 16:25:30 +00:00
Andrey Turetskiy bbfd556640 Compilation for Intel MCU (Part 1/3)
Add -miamcu option which:
  * Sets IAMCU triple
  * Sets IAMCU ABI
  * Enforces static compilation

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

llvm-svn: 266747
2016-04-19 15:50:57 +00:00
Justin Lebar b41f33cf02 [CUDA] Add --no-cuda-noopt-debug, which disables --cuda-noopt-debug.
Reviewers: tra

Subscribers: cfe-commits, jhen

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

llvm-svn: 266708
2016-04-19 02:27:11 +00:00
Justin Lebar dc3c50434e [CUDA] Add --cuda-compile-host-device, which overrides --cuda-host-only and --cuda-device-only.
Summary:
This completes the flag's tristate, letting you override it at will on
the command line.

Reviewers: tra

Subscribers: cfe-commits, jhen

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

llvm-svn: 266707
2016-04-19 02:27:07 +00:00
Kostya Serebryany f5b25f83e3 [sanitizer-coverage] make sure coverage flags are not passed to clang if the driver thinks they are unused
llvm-svn: 266673
2016-04-18 21:30:17 +00:00
Justin Lebar 423019d059 [CUDA] Raise an error if the CUDA install can't be found.
Summary:
Without this change, we silently proceed on without including
__clang_cuda_runtime_wrapper.h.  This leads to very strange behavior --
you say you're compiling CUDA code, but e.g. __device__ is not defined!

Reviewers: tra

Subscribers: cfe-commits

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

llvm-svn: 266496
2016-04-16 00:11:11 +00:00
Hans Wennborg 12f4f8be90 clang-cl: Don't check for existence of linker inputs when /link is used
There might be flags passed to the linker (e.g. /libpath), causing it
to search in paths the Clang driver doesn't know about.

PR27234

llvm-svn: 266402
2016-04-15 01:12:32 +00:00
Tim Northover 99694feca5 ARM: make Darwin's "-arch armv7em" default to hard-float.
We've already paid the price for separate "armv7m" and "armv7em" slices
(support in other tools), it's silly to make them identical other than the
default CPU.

rdar://23055688

llvm-svn: 266211
2016-04-13 17:08:51 +00:00
Konstantin Zhuravlyov 5124bf8edc [AMDGPU] Add debugger related target options
Differential Revision: http://reviews.llvm.org/D18748

llvm-svn: 266133
2016-04-12 21:42:15 +00:00
Ed Maste 1bc232d342 Always use --eh-frame-hdr on FreeBSD, even for -static
FreeBSD uses LLVM's libunwind on FreeBSD/arm64 today (and is expected to
use it more widely in the future), and it requires the EH frame segment
in static binaries.

This is the same as r203742 for NetBSD.

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

llvm-svn: 266123
2016-04-12 21:11:46 +00:00
Nico Weber fd3e1ad0ce clang-cl: Remove -isystem, add -imsvc.
r260990 exposed -isystem in clang-cl. -isystem adds a directory to the front of
the system include search path. The idea was to use this to point to a hermetic
msvc install, but as it turns out this doesn't work: -isystem then adds the
hermetic headers in front of clang's builtin headers, and clang's headers that
are supposed to wrap msvc headers (say, stdarg.h) aren't picked up at all
anymore.

So revert that, and instead expose -imsvc which works as if the passed
directory was part of %INCLUDE%: The header is treated as a system header, but
it is searched after clang's lib/Header headers.

Fixes half of PRPR26751.

llvm-svn: 266108
2016-04-12 19:04:37 +00:00
Evgeniy Stepanov 368d3074ba Allow simultaneous safestack and stackprotector attributes.
This is the clang part of http://reviews.llvm.org/D18846.
SafeStack instrumentation pass adds stack protector canaries if both
attributes are present on a function. StackProtector pass will step
back if the function has a safestack attribute.

llvm-svn: 266005
2016-04-11 22:27:55 +00:00
Ed Schouten 506f295a10 Enable PIE for CloudABI.
As we're currently working on making CloudABI executables easier to
emulate in userspace (e.g., on OS X and Windows), it makes a whole lot
of sense to build these using PIE. By using PIE, they can simply be
loaded into the existing process address space without clashes.

PIE support got added to CloudABI's C library and seems to work pretty
well. CloudABI does not make use of an ld.so, so the binary's _start()
has all the logic in it to do the relocations.

Now that all but one bug in LLD relating to PIE support have been
squashed (and a patch for that is already in code review), I'd like to
go ahead and force the use of PIE for Clang 3.9. When released, we'll
also switch over to using LLD exclusively.

llvm-svn: 265546
2016-04-06 15:37:06 +00:00
Justin Lebar d3a44f6885 [CUDA] Add -fcuda-flush-denormals-to-zero.
Summary:
Setting this flag causes all functions are annotated with the
"nvvm-f32ftz" = "true" attribute.

In addition, we annotate the module with "nvvm-reflect-ftz" set
to 0 or 1, depending on whether -cuda-flush-denormals-to-zero is set.
This is read by the NVVMReflect pass.

Reviewers: tra, rnk

Subscribers: cfe-commits

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

llvm-svn: 265435
2016-04-05 18:26:20 +00:00
Nirav Dave d2f44d8de0 Add -fno-jump-tables and-fjump-tables flags
Add no-jump-tables flag to disable use of jump tables when lowering
switch statements

Reviewers: echristo, hans

Subscribers: llvm-commits

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

llvm-svn: 265425
2016-04-05 17:50:43 +00:00
Bruno Cardoso Lopes b810b02b85 [CrashReproducer] Pass -I, -F and -resource-dir to the reproducer script when using modules/vfs
The reproducer should use -I/-F/-resource-dir in the same way as the
original command. The VFS already collects the right headers but without
these flags the reproducer will fail to do the right thing.

llvm-svn: 265343
2016-04-04 20:26:57 +00:00
Nico Weber d8ff0eedbb clang-cl: Don't skip i_group flags other than -include when building pchs.
Before this change, e.g. -isystem flags in front of the /FI corresponding to the
pch file would be incorrectly ignored.

llvm-svn: 265238
2016-04-02 19:10:07 +00:00
Bruno Cardoso Lopes f854b042e7 [CrashReproducer] Add -fmodule-cache-path to reproducer script
The cc1 invocation in the reproducer script should contain a valid path in
-fmodule-cache-path; for that reuse "<name>.cache/module" dir we already
use to dump the vfs and modules.

llvm-svn: 265162
2016-04-01 17:39:08 +00:00
Bruno Cardoso Lopes 8ed5cac97c [DarwinDriver] Increase the number of valid digits for ld64 version string.
Previously only 3 digits were valid. Increase it to 5.

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

rdar://problem/24843016

llvm-svn: 264987
2016-03-31 02:45:46 +00:00
Justin Lebar 0e450a5d61 [CUDA] Don't initialize the CUDA toolchain if we don't have any CUDA inputs.
Summary:
This prevents errors when you invoke clang with a flag that the NVPTX
toolchain doesn't support.  For example, on x86-64,

  clang -mthread-model single -x c++ /dev/null -o /dev/null

should output just one error about "invalid thread model 'single' in
'-mthread-model single' for this target"; x86-64 doesn't support
-mthread-model, but we shouldn't also instantiate a NVPTX target!

Reviewers: echristo

Subscribers: tra, sunfish, cfe-commits

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

llvm-svn: 264965
2016-03-30 23:30:25 +00:00
Bruno Cardoso Lopes b741e10402 [Driver] Quote clang full version in dwarf producer when invoking cc1as
Convenience to allow easy copy-n-paste from clang -v output when
reproducing cc1as comandline.

rdar://problem/23959295

llvm-svn: 264813
2016-03-30 00:25:57 +00:00
Ed Schouten fc79d2ca42 Enable the SafeStack sanitizer on CloudABI by default.
Over the last month we've been testing SafeStack extensively. As far as
we know, it works perfectly fine. That why I'd like to see us having
this enabled by default for CloudABI.

This change introduces a getDefaultSanitizers() function that toolchains
can use to specify which sanitizers are enabled by default. Once all
flags are processed, only flags that had no -fno-sanitize overrides are
enabled.

Extend the thests for CloudABI to test both the default case and the
case in which we want to explicitly disable SafeStack.

Reviewed by:	eugenis, pcc
Differential Revision:	http://reviews.llvm.org/D18505

llvm-svn: 264787
2016-03-29 21:13:53 +00:00
Justin Lebar 25c4a81e79 [CUDA] Remove three obsolete CUDA cc1 flags.
Summary:
* -fcuda-target-overloads

  Previously unconditionally set to true by the driver.  Necessary for
  correct functioning of the compiler -- our CUDA headers wrapper won't
  compile without this.

* -fcuda-disable-target-call-checks

  Previously unconditionally set to true by the driver.  Necessary to
  compile almost any external CUDA code -- almost all libraries assume
  that host+device code can call host or device functions.

* -fcuda-allow-host-calls-from-host-device

  No effect when target overloading is enabled.

Reviewers: tra

Subscribers: rsmith, cfe-commits

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

llvm-svn: 264739
2016-03-29 16:24:16 +00:00
Konstantin Zhuravlyov 656871124e [AMDGPU] Switch linker to amdphdrs + update test
Differential Revision: http://reviews.llvm.org/D18253

llvm-svn: 264737
2016-03-29 15:54:09 +00:00
Jacques Pienaar d964cc22d1 [lanai] Add Lanai backend to clang driver.
Changes to clang to add Lanai backend. Adds a new target, ABI and toolchain.

General Lanai backend discussion on llvm-dev thread "[RFC] Lanai backend" (http://lists.llvm.org/pipermail/llvm-dev/2016-February/095118.html).

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

llvm-svn: 264655
2016-03-28 21:02:54 +00:00
Eric Christopher 0945a64767 Modules builds are necessarily compile actions, but they don't
necessarily produce object files. Turn off split dwarf if we're not
producing a file that the driver believes is an object file.

llvm-svn: 264227
2016-03-24 00:34:02 +00:00
Nico Weber 9a95275132 clang-cl: Add a FIXME for bumping the default msc version.
llvm-svn: 264216
2016-03-23 23:26:59 +00:00
Nico Weber d1728f0e5f clang-cl: Add more tests for the interaction of /FI and /Yc /Yu.
Most things even work; see the included FIXMEs for things that need polishing.

Also don't warn about unused flags for the `/Yuh2.h /FIh1.h /FIh2.h`.  The
common case is that the pch was built with `/Ych2.h /FIh1.h /FIh2.h`, so h1.h
is in the PCH, and we shouldn't warn about /FIh1.h not having an effect.
(If we wanted to get fancy, we could store the list of -include flags in the
pch and then check that it matches later on.)

llvm-svn: 264178
2016-03-23 18:17:02 +00:00
Nico Weber 9c3fca3698 clang-cl: Don't warn about /Oy- being unused in 64-bit builds.
http://reviews.llvm.org/D18392

llvm-svn: 264163
2016-03-23 15:37:41 +00:00
NAKAMURA Takumi 8794f98e21 Revert r263974, "clang-cl: With -fmsc-version=1900, use MSVS2015 diag formatting."
It seems the test wouldn't expect if default target is *-win32.

llvm-svn: 264007
2016-03-21 23:51:50 +00:00
Pete Cooper 948677131f Revert "Convert some ObjC msgSends to runtime calls."
This reverts commit r263607.

This change caused more objc_retain/objc_release calls in the IR but those
are then incorrectly optimized by the ARC optimizer.  Work is going to have
to be done to ensure the ARC optimizer doesn't optimize user written RR, but
that should land before this change.

This change will also need to be updated to take account for any changes required
to ensure that user written calls to RR are distinct from those inserted by ARC.

llvm-svn: 263984
2016-03-21 20:50:03 +00:00
Nico Weber 920341c7a9 clang-cl: With -fmsc-version=1900, use MSVS2015 diag formatting.
llvm-svn: 263974
2016-03-21 19:44:18 +00:00
Richard Smith 8d83d6db7c [modules] Don't invent a module cache path unless implicit module builds are enabled.
llvm-svn: 263970
2016-03-21 19:06:06 +00:00
Devin Coughlin fcfa38cf76 [tsan] Allow -fsanitize=thread for iOS-style simulator targets
Update the clang driver to allow -fsanitize=thread when targeting x86_64 iOS and tvOS
simulators. Also restrict TSan targeting OS X to only be supported on x86_64 and not i386.

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

llvm-svn: 263913
2016-03-20 18:24:33 +00:00
Chaoren Lin 37cbc43ecb Remove usage of LLVM_PREFIX.
Summary: LLVM_PREFIX could be undefined if CMAKE_INSTALL_PREFIX were set to empty.

Reviewers: kparzysz, bkramer, chandlerc

Subscribers: cfe-commits

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

llvm-svn: 263766
2016-03-18 00:05:37 +00:00
Junmo Park e19d6796ee Minor code cleanups. NFC.
llvm-svn: 263694
2016-03-17 06:41:27 +00:00
Pete Cooper be6c750a8e Convert some ObjC msgSends to runtime calls.
It is faster to directly call the ObjC runtime for methods such as retain/release instead of sending a message to those functions.

This patch adds support for converting messages to retain/release/alloc/autorelease to their equivalent runtime calls.

Tests included for the positive case of applying this transformation, negative tests that we ensure we only convert "alloc" to objc_alloc, not "alloc2", and also a driver test to ensure we enable this only for supported runtime versions.

Reviewed by John McCall.

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

llvm-svn: 263607
2016-03-16 00:33:21 +00:00
Chris Bieneman 7f2844f8f7 [Driver] [Darwin] Fix linking libclang_rt.profile_*sim.a
Summary: isTarget*() calls are order-dependent. This is because iOS Sim *is* iOS. This means checks for the simulator version of the platform must always be ahead of checks for the embedded platform.

Reviewers: zaks.anna, bogner

Subscribers: cfe-commits

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

llvm-svn: 263567
2016-03-15 18:08:20 +00:00
Douglas Katzman 4c12508362 Myriad: Pass -mcpu to movi{Compile,Asm}
Differential Revision: http://reviews.llvm.org/D18186

llvm-svn: 263556
2016-03-15 16:41:31 +00:00
Jonas Hahnfeld 099541907f Make FreeBSD and NetBSD use CLANG_DEFAULT_CXX_STDLIB
Also introduce -stdlib=platform to override the configured value
and use it to make the tests always pass.

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

llvm-svn: 263434
2016-03-14 14:34:04 +00:00
Andrey Turetskiy a486857cd4 [Driver] Enable --rtlib option for MSVC target
This enables "--rtlib compiler-rt" option under MSVC environment.

Patch by Roman Shirokiy.

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

llvm-svn: 263422
2016-03-14 11:19:43 +00:00
Mehdi Amini 557c20a886 Remove compile time PreserveName in favor of a runtime cc1 -discard-value-names option
Summary:
This flag is enabled by default in the driver when NDEBUG is set. It
is forwarded on the LLVMContext to discard all value names (but
GlobalValue) for performance purpose.

This an improved version of D18024

Reviewers: echristo, chandlerc

Subscribers: cfe-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 263394
2016-03-13 21:05:23 +00:00
Peter Zotov e43b741359 Accept absolute paths in the -fuse-ld option.
This patch extends the -fuse-ld option to accept a full path to an executable
and use it verbatim to invoke the linker. There are generally two reasons
to desire this.

The first reason relates to the sad truth is that Clang is retargetable,
Binutils are not.

While any Clang from a binary distribution is sufficient to compile code
for a wide range of architectures and prefixed BFD linkers (e.g.
installed as /usr/bin/arm-none-linux-gnueabi-ld) as well as cross-compiled
libc's (for non-bare-metal targets) are widely available, including on all
Debian derivatives, it is impossible to use them together because
the -fuse-ld= option allows to specify neither a linker prefix nor
a full path to one.

The second reason is linker development, both when porting existing linkers
to new architectures and when working on a new linker such as LLD.

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

llvm-svn: 262996
2016-03-09 05:18:16 +00:00
Nico Weber 381ec2afbf clang-cl: Enable PCH flags by default.
Now that pragma comment and pragma detect_mismatch are implemented, this might
just work.

Some pragmas aren't serialized yet (from the top of my head: code_seg, bss_seg,
data_seg, const_seg, init_seg, section, vtordisp), but these are as far as I
know usually pushed and popped within the header and usually don't leak out.
If it turns out the current PCH support isn't good enough yet, we can turn it
off again.

llvm-svn: 262749
2016-03-04 21:59:42 +00:00
Stephen Hines e3f91e31ab Switch krait to use -mcpu=cortex-a15 for assembler tool invocations.
Summary:
Using -no-integrated-as causes -mcpu=krait to be transformed into
-march=armv7-a today. This precludes the assembler from using
instructions like sdiv, which are present for krait. Cortex-a15 is the
closest subset of functionality for krait, so we should switch the
assembler to use that instead.

Reviewers: cfe-commits, apazos, weimingz

Subscribers: aemerson

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

llvm-svn: 262742
2016-03-04 20:57:22 +00:00
Bradley Smith f4affc13c5 [ARM] Add Clang targeting for ARMv8-M Baseline/Mainline
llvm-svn: 262619
2016-03-03 13:52:22 +00:00
Nico Weber 8ab9219295 clang-cl pch test: Instead of copying the input, use /Fp to not write into the test directory.
Also fix a bug with /Fp and absolute paths uncovered by this.
Follow-up to r262487.

llvm-svn: 262541
2016-03-02 23:29:29 +00:00
Rong Xu 9c6f1538cc [PGO] Change profile use cc1 option to handle IR level profiles
This patch changes cc1 option for PGO profile use from
-fprofile-instr-use=<path> to -fprofile-instrument-use-path=<path>.
-fprofile-instr-use=<path> is now a driver only option.

In addition to decouple the cc1 option from the driver level option, this patch
also enables IR level profile use. cc1 option handling now reads the profile
header and sets CodeGenOpt ProfileUse (valid values are {None, Clang, LLVM}
-- this is a common enum for -fprofile-instrument={}, for the profile
instrumentation), and invoke the pipeline to enable the respective PGO use pass.

Reviewers: silvas, davidxl

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

llvm-svn: 262515
2016-03-02 20:59:36 +00:00
Kostya Serebryany 578787ad30 [libFuzzer] allow -fsanitize-coverage=0 (disables all coverage)
llvm-svn: 262503
2016-03-02 19:16:54 +00:00
Nico Weber 2ca4be97de clang-cl: Implement initial limited support for precompiled headers.
In the gcc precompiled header model, one explicitly runs clang with `-x
c++-header` on a .h file to produce a gch file, and then includes the header
with `-include foo.h` and if a .gch file exists for that header it gets used.
This is documented at
http://clang.llvm.org/docs/UsersManual.html#precompiled-headers

cl.exe's model is fairly different, and controlled by the two flags /Yc and
/Yu. A pch file is generated as a side effect of a regular compilation when
/Ycheader.h is passed. While the compilation is running, the compiler keeps
track of #include lines in the main translation unit and writes everything up
to an `#include "header.h"` line into a pch file. Conversely, /Yuheader.h tells
the compiler to skip all code in the main TU up to and including `#include
"header.h"` and instead load header.pch. (It's also possible to use /Yc and /Yu
without an argument, in that case a `#pragma hrdstop` takes the role of
controlling the point where pch ends and real code begins.)

This patch implements limited support for this in that it requires the pch
header to be passed as a /FI force include flag – with this restriction,
it can be implemented almost completely in the driver with fairly small amounts
of code. For /Yu, this is trivial, and for /Yc a separate pch action is added
that runs before the actual compilation. After r261774, the first failing
command makes a compilation stop – this means if the pch fails to build the
main compilation won't run, which is what we want. However, in /fallback builds
we need to run the main compilation even if the pch build fails so that the
main compilation's fallback can run. To achieve this, add a ForceSuccessCommand
that pretends that the pch build always succeeded in /fallback builds (the main
compilation will then fail to open the pch and run the fallback cl.exe
invocation).

If /Yc /Yu are used in a setup that clang-cl doesn't implement yet, clang-cl
will now emit a "not implemented yet; flag ignored" warning that can be
disabled using -Wno-clang-cl-pch.

Since clang-cl doesn't yet serialize some important things (most notably
`pragma comment(lib, ...)`, this feature is disabled by default and only
enabled by an internal driver flag. Once it's more stable, this internal flag
will disappear.

(The default stdafx.h setup passes stdafx.h as explicit argument to /Yc but not
as /FI – instead every single TU has to `#include <stdafx.h>` as first thing it
does. Implementing support for this should be possible with the approach in
this patch with minimal frontend changes by passing a --stop-at / --start-at
flag from the driver to the frontend. This is left for a follow-up. I don't
think we ever want to support `#pragma hdrstop`, and supporting it with this
approach isn't easy: This approach relies on the driver knowing the pch
filename in advance, and `#pragma hdrstop(out.pch)` can set the output
filename, so the driver can't know about it in advance.)

clang-cl now also honors /Fp and puts pch files in the same spot that cl.exe
would put them, but the pch file format is of course incompatible. This has
ramifications on /fallback, so /Yc /Yu aren't passed through to cl.exe in
/fallback builds.

http://reviews.llvm.org/D17695

llvm-svn: 262420
2016-03-01 23:16:44 +00:00
Steven Wu 574b0f2f9c Introduce -fembed-bitcode driver option
Summary:
This is the clang driver part of the change to embedded bitcode. This
includes:
1. -fembed-bitcode option which breaks down the compilation into two
stages. The first stage emits optimized bitcode and the second stage
compiles bitcode into object file.
2. -fembed-bitcode-marker option which doesn't really break down to
two stages to speedup the compilation flow.
3. pass the correct linker flag to darwin linker if tool chains supports
embedded bitcode.

Reviewers: rsmith, thakis

Subscribers: thakis, cfe-commits

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

llvm-svn: 262282
2016-03-01 01:07:58 +00:00
David Majnemer cd5855e354 [clang-cl] /EHc should not effect functions with explicit exception specifications
Functions with an explicit exception specification have their behavior
dictated by the specification.  The additional /EHc behavior only comes
into play if no exception specification is given.

llvm-svn: 262198
2016-02-29 01:40:36 +00:00
David Majnemer 387fccd8da [clang-cl] /EHc should not have an effect on /EHa
This matches behavior with MSVC.

llvm-svn: 262197
2016-02-29 01:40:30 +00:00
Akira Hatanaka 8f5866a7a8 [Driver] Disable frame pointer elimination by default if target is
x86_64-pc-win32-macho.

rdar://problem/24470634

llvm-svn: 261976
2016-02-26 05:07:00 +00:00
Peter Collingbourne ceef145ffa Fix build by using hasFlag instead of hasArg.
llvm-svn: 261782
2016-02-24 22:03:06 +00:00
Justin Lebar 8671c441c3 Bail on compilation as soon as a job fails.
Summary:
(Re-land of r260448, which was reverted in r260522 due to a test failure
in Driver/output-file-cleanup.c that only showed up in fresh builds.)

Previously we attempted to be smart; if one job failed, we'd run all
jobs that didn't depend on the failing job.

Problem is, this doesn't work well for e.g. CUDA compilation without
-save-temps.  In this case, the device-side and host-side Assemble
actions (which actually are responsible for preprocess, compile,
backend, and assemble, since we're not saving temps) are necessarily
distinct.  So our clever heuristic doesn't help us, and we repeat every
error message once for host and once for each device arch.

The main effect of this change, other than fixing CUDA, is that if you
pass multiple cc files to one instance of clang and you get a compile
error, we'll stop when the first cc1 job fails.

Reviewers: echristo

Subscribers: cfe-commits, jhen, echristo, tra, rafael

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

llvm-svn: 261774
2016-02-24 21:49:28 +00:00
Peter Collingbourne fb532b9a34 Add whole-program vtable optimization feature to Clang.
This patch introduces the -fwhole-program-vtables flag, which enables the
whole-program vtable optimization feature (D16795) in Clang.

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

llvm-svn: 261767
2016-02-24 20:46:36 +00:00
Tim Northover 2279b5f8f5 AArch64: fix Cyclone CPU features list.
It turns out we don't have CRC after all. Who knew?

llvm-svn: 261758
2016-02-24 17:57:48 +00:00
Nico Weber 5a459f8249 Rename Action::begin() to Action::input_begin().
Also introduce inputs() that reutnrs an llvm::iterator_range.
Iterating over A->inputs() is much less mysterious than
iterating over *A.  No intended behavior change.

llvm-svn: 261674
2016-02-23 19:30:43 +00:00
Dan Gohman 57b62c5e16 [WebAssembly] Initial driver support for standard library paths.
llvm-svn: 261560
2016-02-22 19:26:15 +00:00
David Majnemer a7bdc5ad54 Don't enable /GX by default
The /GX flag is disabled unless explicitly specified on the command
line.  This partially addresses PR26698.

llvm-svn: 261537
2016-02-22 17:44:51 +00:00
David Majnemer 960813e164 [MSVC Compat] Implement -EHc semantics
The -EHc flag implicitly adds a nothrow attribute to any extern "C"
function when exceptions are enabled.

llvm-svn: 261425
2016-02-20 09:23:47 +00:00
David Majnemer b880909ab5 [MSVC Compat] Add support for /GX, /GX-
These are legacy flags which map to /EHsc and /EHs-c- respectively.

llvm-svn: 261424
2016-02-20 09:23:44 +00:00
Richard Smith 7e82e019c6 [modules] Flatten -fmodule-name= and -fmodule-implementation-of= into a single
option. Previously these options could both be used to specify that you were
compiling the implementation file of a module, with a different set of minor
bugs in each case.

This change removes -fmodule-implementation-of, and instead tracks a flag to
determine whether we're currently building a module. -fmodule-name now behaves
the same way that -fmodule-implementation-of previously did.

llvm-svn: 261372
2016-02-19 22:25:36 +00:00
Nico Weber 4152f522aa Make deprecation message for -fsanitize-coverage= with numeric argument friendlier.
http://reviews.llvm.org/D17397

llvm-svn: 261247
2016-02-18 19:32:54 +00:00
David Majnemer 597293981d [MSVC] Turn C++ EH on my default
Our support for C++ EH is sufficiently good that it makes sense to
enable support for it out of the box.

While we are here, update the MSVCCompatibility doc.

llvm-svn: 261195
2016-02-18 08:15:05 +00:00
Kostya Serebryany 52e86493e3 [sanitizer-coverage] allow -fsanitize-coverage=trace-pc w/o any other sanitizer and w/o ...=[func,bb,edge]. This makes this syntax a superset of the GCC's syntax
llvm-svn: 261182
2016-02-18 00:49:23 +00:00
Kostya Serebryany 8e3061b865 [sanitizer-coverage] add a deprecation warning for -fsanitize-coverage=[1234]
llvm-svn: 261178
2016-02-17 23:57:17 +00:00
Kostya Serebryany d4590c7304 [sanitizer-coverage] implement -fsanitize-coverage=trace-pc. This is similar to trace-bb, but has a different API. We already use the equivalent flag in GCC for Linux kernel fuzzing. We may be able to use this flag with AFL too
llvm-svn: 261159
2016-02-17 21:34:43 +00:00
Ed Schouten 51bfbe7f2c Enable SafeStack for CloudABI.
Summary:
I've got a patchset in my home directory to integrate support for
SafeStack into CloudABI's C library. All of the CloudABI unit tests
still seem to pass. Pretty sweet!

This change adds the necessary changes to Clang to make
-fsanitize=safe-stack work on CloudABI. Without it, passing this command
line flag throws an error.

Reviewers: eugenis, samsonov

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

llvm-svn: 261135
2016-02-17 18:56:20 +00:00
Artem Belevich 0a0e54c194 [CUDA] pass debug options to ptxas.
ptxas optimizations are disabled if we need to generate debug info
as ptxas does not accept '-g' otherwise.

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

llvm-svn: 261018
2016-02-16 22:03:20 +00:00
Tim Northover 3a098c1b9f Darwin: fix stdlib handling when CLANG_DEFAULT_STDLIB is set
I'd accidentally skipped the CMake check in a premature optimisation. I'd also
put the original test in completely the wrong place.

Thanks Jonas Hahnfeld!

llvm-svn: 260898
2016-02-15 16:38:10 +00:00
Dimitry Andric 6090739f8d As reported in https://llvm.org/bugs/show_bug.cgi?id=25496, on FreeBSD,
C++ programs compiled for profiling (using `-pg`) should be linked with
`-lc++_p` (or `-lstdc++_p`, depending on the `-stdlib=` setting), not
with the regular C++ libraries.

Add a `FreeBSD::AddCXXStdlibLibArgs()` override to handle this, and add
a test case for it.  While here, extend the test case for the proper
passing of -lm and -lm_p.

Reviewers: compnerd, davide, dws, emaste
Reviewed By: compnerd
Differential Revision: http://reviews.llvm.org/D16264

llvm-svn: 260851
2016-02-14 16:08:20 +00:00
Eugene Zelenko 1ced5095e4 Fix remaining Clang-tidy readability-redundant-control-flow warnings; other minor fixes.
Differential revision: http://reviews.llvm.org/D17218

llvm-svn: 260757
2016-02-12 22:53:10 +00:00
Tim Northover b534ce46bd Darwin: pass -stdlib=libc++ down to cc1 whenever we're targeting libc++
Recent refactoring meant it only got passed down when explicitly specified,
which breaks header search on Darwin.

llvm-svn: 260755
2016-02-12 22:30:42 +00:00
Jonas Hahnfeld aae8374004 [CMake] Add option to switch default C++ stdlib
With this option one can optionally override the architecture dependent
default library to use if no -stdlib= is provided on compiler invocation.

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

llvm-svn: 260662
2016-02-12 07:48:37 +00:00
Joerg Sonnenberger 21156e80ba Remove decision logic for old NetBSD development versions, the 7.0
release made this obsolete.

llvm-svn: 260617
2016-02-11 23:35:03 +00:00
Joerg Sonnenberger 059613cb68 Now that Sparc/Sparc64 backend is mostly usable, provide the same
linking defaults as other NetBSD targets, i.e. compiler_rt-in-libc and
libc++ as STL.

llvm-svn: 260616
2016-02-11 23:18:36 +00:00
Chad Rosier b0ce1952b7 [Driver] Add support for Qualcomm's Kryo CPU.
http://reviews.llvm.org/D17124

llvm-svn: 260555
2016-02-11 18:09:31 +00:00
Oliver Stannard 3086c04a93 [ARM] Add command-line options for ARMv8.2-A
This allows ARMv8.2-A to be targeted either by using "armv8.2a" in the
triple, or by using -march=armv8.2-a (or the alias -march=armv8.2a).

The FP16 extension can be enabled with the "+fp16" suffix to the -march
or -mcpu option. This is consistent with the AArch64 option, rather than
the usual ARM option of -mfpu. We have agreed with the team which will
be upstreaming this to GCC that we want to use this new option format
for new architecture extensions for both ARM and AArch64.

Most of the work for this was done by the TargetParser patch in llvm.

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

llvm-svn: 260533
2016-02-11 16:05:52 +00:00