Commit Graph

2016 Commits

Author SHA1 Message Date
Jacob Baungard Hansen f7791ad7cd [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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@270538 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-24 08:30:08 +00:00
Jacob Baungard Hansen fc8ef5004a Test commit
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@270435 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-23 13:12:29 +00:00
Saleem Abdulrasool c56431235e 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@270352 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-22 03:12:19 +00:00
Saleem Abdulrasool 809f5c72b6 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@270351 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-22 01:37:36 +00:00
Rafael Espindola fa5a9b14f4 Update for llvm change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269989 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 22:04:57 +00:00
Petar Jovanovic b5c7e1c9c8 [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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269914 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 12:46:06 +00:00
Alexey Bataev e14f516c98 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269891 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18 09:06:38 +00:00
Petar Jovanovic c5e5ba39f4 [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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269754 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 10:46:10 +00:00
Paul Robinson e57f2755bb [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.)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269671 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 17:22:25 +00:00
Adrian McCarthy d62f27e8a4 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269515 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-13 23:20:11 +00:00
Vasileios Kalintiris 24ed0a5f5e Simplify getLinuxDynamicLinker() by using a common variable for the triple. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269412 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-13 12:34:14 +00:00
Vasileios Kalintiris 43985f60e9 [mips] Consult triple's vendor field before using musl's interpreter.
This should affect only the mips-mti-linux toolchain.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269411 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-13 12:13:13 +00:00
Filipe Cabecinhas 889fcf316b [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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269309 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 16:51:36 +00:00
Marcin Koscielnicki 4f66942f44 [Driver] Squash misleading indentation warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269279 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 10:27:59 +00:00
Steven Wu 22dbcfe84e 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269202 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-11 16:26:03 +00:00
Nemanja Ivanovic 371da9b127 [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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268951 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09 18:58:02 +00:00
Tom Stellard 5388501da4 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268648 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 17:03:41 +00:00
Marcin Koscielnicki 49edd29c34 [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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268575 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 23:37:40 +00:00
Bruno Cardoso Lopes c1e7ade641 Revert "[Driver] Quote clang full version in dwarf producer when invoking cc1as"
This reverts commit r264813 / 6484b95d63.

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 ...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268297 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 20:20:49 +00:00
Peter Collingbourne 5b0d0a6495 Re-apply r267784, r267824 and r267830.
I have updated the compiler-rt tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267903 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 17:09:37 +00:00
Benjamin Kramer ce850d4bf5 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."

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267871 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 12:14:47 +00:00
Peter Collingbourne 47213cf975 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267784 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 20:39:53 +00:00
Derek Bruening a3e7a4fe79 [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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267059 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 21:32:04 +00:00
Andrey Turetskiy 2163377a72 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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266972 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 10:16:48 +00:00
Douglas Katzman 5ffb3d9ac6 Fix PR26999 better- RenderDebugEnablingArgs() once only
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266797 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 18:55:53 +00:00
Douglas Katzman 799e4cf2b3 Pass dwarf-version to cc1as.
Fix PR26999 - crashing in cc1as with any '*bsd' target.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266775 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 17:43:54 +00:00
Andrey Turetskiy 8f100b91f5 Revert r266747 (Compilation for Intel MCU (Part 1/3)) since it breaks a few buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266753 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 16:25:30 +00:00
Andrey Turetskiy 268cc8e48c 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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266747 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 15:50:57 +00:00
Justin Lebar 52a9fbe3d8 [CUDA] Add --no-cuda-noopt-debug, which disables --cuda-noopt-debug.
Reviewers: tra

Subscribers: cfe-commits, jhen

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266708 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 02:27:11 +00:00
Tim Northover 11b940607f 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266211 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-13 17:08:51 +00:00
Konstantin Zhuravlyov 07dd821048 [AMDGPU] Add debugger related target options
Differential Revision: http://reviews.llvm.org/D18748


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266133 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-12 21:42:15 +00:00
Ed Maste 246482bb9e 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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266123 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-12 21:11:46 +00:00
Evgeniy Stepanov e12f026f7c 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266005 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-11 22:27:55 +00:00
Ed Schouten 6944c5a9cc 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265546 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-06 15:37:06 +00:00
Nirav Dave 7ddf169fd4 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265425 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 17:50:43 +00:00
Nico Weber 1243a80d05 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265238 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 19:10:07 +00:00
Bruno Cardoso Lopes d157ba2e23 [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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264987 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-31 02:45:46 +00:00
Bruno Cardoso Lopes 6484b95d63 [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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264813 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-30 00:25:57 +00:00
Justin Lebar b713fab2f5 [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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264739 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-29 16:24:16 +00:00
Konstantin Zhuravlyov 45fd5f5f45 [AMDGPU] Switch linker to amdphdrs + update test
Differential Revision: http://reviews.llvm.org/D18253


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264737 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-29 15:54:09 +00:00
Jacques Pienaar 015626ce7c [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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264655 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-28 21:02:54 +00:00
Eric Christopher 39a220574c 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264227 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 00:34:02 +00:00
Nico Weber 34f26111f8 clang-cl: Add a FIXME for bumping the default msc version.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264216 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 23:26:59 +00:00
Nico Weber dbb97986fb 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.)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264178 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 18:17:02 +00:00
NAKAMURA Takumi 709d368974 Revert r263974, "clang-cl: With -fmsc-version=1900, use MSVS2015 diag formatting."
It seems the test wouldn't expect if default target is *-win32.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264007 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 23:51:50 +00:00
Pete Cooper 2a988fcf43 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263984 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 20:50:03 +00:00
Nico Weber 2ce38073fd clang-cl: With -fmsc-version=1900, use MSVS2015 diag formatting.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263974 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 19:44:18 +00:00
Richard Smith 87bca11529 [modules] Don't invent a module cache path unless implicit module builds are enabled.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263970 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-21 19:06:06 +00:00
Junmo Park 32fcd42fc5 Minor code cleanups. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263694 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 06:41:27 +00:00
Pete Cooper 65556141a6 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263607 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-16 00:33:21 +00:00