Commit Graph

3169 Commits

Author SHA1 Message Date
James Y Knight 2db38f33f3 Tiny cleanup: move some Triple variables up to the top of the
function, and remove a duplicate var.

llvm-svn: 245154
2015-08-15 03:45:25 +00:00
Douglas Katzman cb07d15b4c Represent 2 parallel string arrays as one string[][2] array.
Differential Revision: http://reviews.llvm.org/D11991

llvm-svn: 245063
2015-08-14 15:52:12 +00:00
Martell Malone 1bc12bbea6 Driver: Fix include directories when not using libgcc under mingw
Summary:
When we want to use mingw-w64 and clang with compiler-rt we should not
need to have libgcc installed. This fixes finding includes when libgcc
is not installed

Reviewers: yaron.keren

Subscribers: cfe-commits

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

llvm-svn: 244902
2015-08-13 15:41:04 +00:00
Douglas Katzman 15a63ed26e Don't compare getArchName() to "tce" as a string. NFC.
llvm-svn: 244791
2015-08-12 18:36:12 +00:00
John Brawn a7b4ec0a9c [Driver] Fix handling of -fbuiltin/-fcommon when combined with -mkernel
-mkernel enables -fno-builtin and -fno-common by default, but allows -fbuiltin
and -fcommon to override that. However "-fbuiltin -fno-builtin" is treated the
same as "-fbuiltin" which is wrong, so fix that. Also fixes similar behaviour
when -fno-common is default.

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

llvm-svn: 244437
2015-08-10 11:11:28 +00:00
Yaron Keren aa2813325f Teach mingw toolchain driver to properly emit static or dynamic linking of ligcc.
Implemented in MinGW::Linker::AddLibGCC since AddLibgcc is a logic puzzle even
before adding one more boolean. A first step towards simplification of AddLibgcc
would be to factor out the Android AddLibgcc code into its own routine.

llvm-svn: 244407
2015-08-09 00:24:07 +00:00
Douglas Katzman 96ad05ec5e Range-forify a loop, delete trailing whitespace. NFC
llvm-svn: 244290
2015-08-06 22:36:24 +00:00
Justin Bogner e03437c756 Driver: Strip -header-include-file and -diagnostic-log-file from crash repro scripts
These two arguments tend to refer to a local path that won't exist
when we try to reproduce a bug. Strip them.

llvm-svn: 244179
2015-08-05 23:49:44 +00:00
Diego Novillo c4b94da00e Add -fno-coverage-mapping flag.
This new flag allows the user to disable a previous instance of
-fcoverage-mapping, if needed.

llvm-svn: 244170
2015-08-05 23:27:40 +00:00
Diego Novillo 758f3f542a Add flags to disable profile generation.
This patch adds flags -fno-profile-instr-generate and
-fno-profile-instr-use, and the GCC aliases -fno-profile-generate and
-fno-profile-use.

These flags are used in situations where users need to disable profile
generation or use for specific files in a build, without affecting other
files.

llvm-svn: 244153
2015-08-05 21:49:51 +00:00
Reid Kleckner 124955aade Add -gcodeview and -gdwarf to control which type Clang emits
Summary:
By default, 'clang' emits dwarf and 'clang-cl' emits codeview.  You can
force emission of one or both by passing -gcodeview and -gdwarf to
either driver.

Reviewers: dblaikie, hans

Subscribers: cfe-commits

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

llvm-svn: 244097
2015-08-05 18:51:13 +00:00
Renato Golin d45c2df4ab [AArch64] Enable thread sanitizer on clang
With this option, clang can use -fsanitize=thread on AArch64.

Patch by Adhemerval Zanella.

llvm-svn: 244091
2015-08-05 18:42:41 +00:00
Douglas Katzman 8b50e0175f Claim arguments that belong to 'clang_ignored_gcc_optimization_f_Group'
This seems preferable to printing two warnings per unsupported option-
one warning about not supporting it, and one about not using it.
It also makes the '-Wno-' option do what you mean.

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

llvm-svn: 244079
2015-08-05 18:03:47 +00:00
Chandler Carruth 9ade6a9a74 Fix a tiny bug in -no-canonical-prefixes that somehow we have never
noticed until now.

The code for setting up the driver's InstalledDir didn't respect
-no-canonical-prefixes. Because of this, there are a few places in the
driver where we would unexpectedly form absolute paths, notably when
searching for and finding GCC installations to use, etc. The fix is
straightforward, and I've added this path to '-v' both so we can test it
sanely and so that it will be substantially more obvious the next time
someone has to debug something here.

Note that there is another bug that we don't actually *canonicalize* the
installed directory! I don't really want to fix that because I don't
have a realistic way to test the usage of this mode. I suspect that
folks using the shared module cache would care about getting this right
though, and so they might want to address it. I've left the appropriate
FIXMEs so that it is clear what to change, and I've updated the test
code to make it clear what is happening here.

llvm-svn: 244065
2015-08-05 17:07:33 +00:00
Douglas Katzman f607111d95 [SHAVE] Pass all -f, -g, -O, -W options through directly to moviCompile.
Differential Revision: http://reviews.llvm.org/D11581

llvm-svn: 243878
2015-08-03 14:34:22 +00:00
David Blaikie ce3e7a614a Split DWARF: Allow -gmlt/-gsplit-dwarf to override rather than complement each other
It doesn't make any sense to enable -gmlt with -gsplit-dwarf, since
-gmlt is designed for on-line symbolication (and -gsplit-dwarf normally
emits all the -gmlt data into the .o anyway - so there's nothing to
split out except redundant/duplicate info).

With this change they override each other, -gmlt -gsplit-dwarf is the
same as -gsplit-dwarf and -gsplit-dwarf -gmlt is the same as -gmlt.

llvm-svn: 243694
2015-07-30 21:42:22 +00:00
Adhemerval Zanella 76aee67150 [sanitizers] Enable dfsan for aarch64
This patch enables DFSan for aarch64/linux.

llvm-svn: 243685
2015-07-30 20:50:39 +00:00
Renato Golin 23459c61cb [ARM] Allow setting the generic features for native cpus
Copying the already existing code for x86 to ARM to set the correct CPU
features when using -mcpu=native. We can already detect the CPU name
but we were not setting the correct feature bits.

Moving fpu/hwdiv down to make sure they override whatever we set the
default to be.

No tests because this is native detection, and not all ARM-enabled builds
will hapen at a specific CPU, or even ARM. I have tested locally and it
works as expected.

Fixes PR12794.

llvm-svn: 243656
2015-07-30 16:40:17 +00:00
Ulrich Weigand 3c5038a535 Add support for System z vector language extensions
The z13 vector facility has an associated language extension,
closely modeled on AltiVec/VSX.  The main differences are:

- vector long, vector float and vector pixel are not supported

- vector long long and vector double are supported (like VSX)

- comparison operators return a vector rather than a scalar integer

- shift operators behave like the OpenCL shift operators

- vector bool is only supported as argument to certain operators;
  some operators allow mixing a bool with a non-bool vector 

This patch adds clang support for the extension.  It is closely modelled
on the AltiVec support.  Similarly to the -faltivec option, there's a
new -fzvector option to enable the extensions (as well as an -mzvector
alias for compatibility with GCC).  There's also a separate LangOpt.

The extension as implemented here is intended to be compatible with
the -mzvector extension recently implemented by GCC.

Based on a patch by Richard Sandiford.

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

llvm-svn: 243642
2015-07-30 14:08:36 +00:00
Douglas Katzman 57a9c7eba5 Use the AddAllArgs overload which accepts an ArrayRef of OptSpecifier.
Differential Revision: http://reviews.llvm.org/D11599

llvm-svn: 243552
2015-07-29 18:39:14 +00:00
Akira Hatanaka 085da7ecae [AArch64] Pass subtarget feature "+strict-align".
This commit changes the driver to save subtarget feature "+strict-align"
to the IR instead of using backend option "aarch64-strict-align". This is
needed for LTO.

rdar://problem/21529937

llvm-svn: 243518
2015-07-29 14:25:58 +00:00
Akira Hatanaka 7651dd8359 [ARM] Pass subtarget feature "+strict-align".
This commit changes the driver to save subtarget feature "+strict-align" to the
IR instead of using backend option "arm-strict-align". This is needed for LTO.

Also, move the logic in ARM backend that was deciding whether strict alignment
should be forced to the front-end.

rdar://problem/21529937

http://reviews.llvm.org/D11472

llvm-svn: 243489
2015-07-28 22:26:45 +00:00
Artem Belevich baae093e49 Silence unused argument warning for --cuda-host-only.
Differential Revision: http://reviews.llvm.org/D11575

llvm-svn: 243479
2015-07-28 21:01:30 +00:00
Artem Belevich 4242f41d8a --cuda-host-only should not disable linking phase.
Host-only cuda compilation does produce valid host object
file and in some cases users do want to proceed on to the linking phase.
The change removes special case that stopped compilation pipeline at
the Assembly phase. Device-side compilation is still stopped early
by the types::getCompilationPhases().

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

llvm-svn: 243478
2015-07-28 21:01:21 +00:00
Chih-Hung Hsieh 2c656c9417 Add -femulated-tls flag to select the emulated TLS model.
This will be used for old targets like Android that do not
support ELF TLS models.

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

llvm-svn: 243441
2015-07-28 16:27:56 +00:00
Alexandros Lamprineas e5b47640ee Use TargetParser to parse -mhwdiv command line option in Driver.
Change-Id: I2ebc40f77af75ec6b43ce8364d6d5a1d29988bd6
Phabricator: http://reviews.llvm.org/D11501
llvm-svn: 243398
2015-07-28 09:08:03 +00:00
Renato Golin 7c542b4569 [ARM] Implement -Wa,-mfpu and friends for assemblers
This patch allows Clang to pass on -Wa,-mfpu, -Wa,-mhwdiv and
-Wa,-mcpu to the integrated assembler (via target-features), but
-march is still not being passed, but validated.

In case the command line has both -mxxx and -Wa,-mxxx, we warn
that the naked one will not be used in assembler mode.

llvm-svn: 243353
2015-07-27 23:44:45 +00:00
Renato Golin e17c580034 [ARM] Changes to Arch/CPU handling to help with -Wa,-mfpu etc. (nfc)
To be able to handle -Wa, options in the assembler (ClangAs), we need to
make the handling of options based on the value of the options, not direct
Arguments from the list, since the list is immutable.

No functional change in this patch, but this allows validating of -Wa,-mfpu
and friends in the same way we validate -mfpu and friends, *just* for the
assembler.

llvm-svn: 243352
2015-07-27 23:44:42 +00:00
Akira Hatanaka 9250047032 [AArch64] Unconditionally pass subtarget feature reserve-x18 on Darwin.
After r243308, the front-end is responsible for checking the target OS and
passing reserve-x18 if the target is Darwin.

llvm-svn: 243310
2015-07-27 19:29:04 +00:00
Douglas Katzman 5436607cf6 Rename {Hexagon,NaCl}_TC to {Hexagon,NaCl}ToolChain respectively. NFC
Also rename XCore (the toolchain) to XCoreToolChain since XCore is
also a namespace for its tools.

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

llvm-svn: 243279
2015-07-27 16:53:08 +00:00
Renato Golin 24ba3e9852 Setting ARM dynamic linker name from commandline
Currently trigger to select hard-float linker is only based of -gnueabihf
appearing in target triplet, but we should also select it when hardfloat
is requested via cmdline.

Patch by Khem Raj.

llvm-svn: 243262
2015-07-27 09:56:37 +00:00
David Majnemer 015ce0f68f [clang-cl] Handle -O correctly
We had multiple bugs here:
- We didn't support multiple optimization options in one argument.
  e.g. -O2y-
- We didn't correctly expand -O[12dx] to their respective options.
- We treated -O1 as clang -O1 instead of clang -Os.
- We treated -Ox as clang -O3 instead of clang -O2.  In fact, cl's -Ox
  option is *less* powerful than cl's -O2 option despite -Ox described
  as "Full Optimization".

This fixes PR24003.

llvm-svn: 243261
2015-07-27 07:32:11 +00:00
David Majnemer bac941c4b1 [clang-cl] Add fallback support for /Zl
llvm-svn: 243207
2015-07-25 06:07:59 +00:00
Akira Hatanaka 4e3c86fe99 [AArch64] Pass subtarget feature "+reserve-x18" instead of passing backend
option "-aarch64-reserve-x18".

This change is needed since backend options do not make it to the backend
when doing LTO and are not capable of changing the behavior of code-gen
passes on a per-function basis.

rdar://problem/21529937

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

llvm-svn: 243185
2015-07-25 00:18:00 +00:00
Yaron Keren e896939e54 Select the highest version of the mingw toolchain found using Generic_GCC::GCCVersion
similar to the way Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple works.

llvm-svn: 243153
2015-07-24 20:18:27 +00:00
Yaron Keren a749b1b2bd Base the sys-root/mingw/include path on sysroot and not on /usr.
Thanks to Richard Smith for pointing this out!

llvm-svn: 243144
2015-07-24 19:18:17 +00:00
Yaron Keren 8cb250ad9d Apparently some of the bots add .svn dirs inside the test/Driver/Inputs
directory structure. Try to make mingw toolchain resilient to such surprises.

llvm-svn: 243105
2015-07-24 11:01:45 +00:00
Yaron Keren 327675baa9 Add extensive tests for the mingw toolchain and remove trailing slash from Arch.
Address Richard Smith comments: remove the trailing seperator from the Arch
variable, implement six mingw_* trees under tools/clangtest/Driver/Inputs
and merge linux and Windows tests into a universal test that uses these trees.

llvm-svn: 243098
2015-07-24 08:50:15 +00:00
David Majnemer e2afb47d1e [clang-cl] Implement support for the /Zl flag
The flag allows users to specify that they do not want the object file
to have any implicit /defaultlib directives.

This fixes PR24236.

llvm-svn: 243097
2015-07-24 06:49:13 +00:00
Renato Golin 830f0c4c46 [Compiler-RT] Remove dependency on libgcc_s/eh
Currently, for --rtlib=compiler-rt on GNU systems, we're assuming
that one has libgcc_s and libgcc_eh as low-level libraries, which
when used in conjunction with -lunwind or -lc++abi, breaks that
assumption.

My original fix was wrong, and this patch reverts it to prepare for
a new flag to choose the unwinder/C++ libraries. For the time being,
people can use "-lgcc_s -lgcc_eh" or "-lunwind -lc++abi" or any
combination they need explicitly.

llvm-svn: 243025
2015-07-23 17:24:41 +00:00
Reid Kleckner 0213a4756e [mingw] Add support for -rtlib option and -stdlib option to the mingw driver
Now clang should be able to use compiler-rt and libc++ on mingw.

Based on a patch by Martell Malone.

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

llvm-svn: 242905
2015-07-22 16:01:38 +00:00
Renato Golin a74bbc7b36 Pass -I options to integrates and external assemblers
Fixes PR21000.

Patch by Artem Belevich.

llvm-svn: 242904
2015-07-22 15:32:36 +00:00
Yaron Keren 2859653d51 Fix mingw toolchain to honor sysroot on Linux and add tests.
It should now support three mingw distributions running on Windows
and three Linux distributions. The include directories for each are
listed in the comments.

llvm-svn: 242766
2015-07-21 11:01:00 +00:00
Akira Hatanaka 0a23fac13c [ARM] Pass subtarget feature "+reserve-r9" instead of passing backend
option "-arm-reserve-r9".

This recommits r242736, which had to be reverted because the llvm-side
change that was committed in r242737 caused the number of subtarget
features to go over the limit of 64.

This change is needed since backend options do not make it to the backend
when doing LTO and are not capable of changing the behavior of code-gen
passes on a per-function basis.

rdar://problem/21529937

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

llvm-svn: 242755
2015-07-21 01:41:08 +00:00
Akira Hatanaka 6a543b6754 Revert r242736.
r242737 caused builds to fail with the following error message, so I'm
reverting the clang side change too:

error:Too many subtarget features! Bump MAX_SUBTARGET_FEATURES.

llvm-svn: 242741
2015-07-20 23:53:02 +00:00
Akira Hatanaka 6b7fff9ce5 [ARM] Pass subtarget feature "+reserve-r9" instead of passing backend
option "-arm-reserve-r9".
        
This change is needed since backend options do not make it to the backend
when doing LTO and are not capable of changing the behavior of code-gen
passes on a per-function basis.

rdar://problem/21529937

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

llvm-svn: 242736
2015-07-20 23:20:53 +00:00
Artem Belevich db35a3ee43 [CUDA] Moved device-side triple calculation to buildCudaActions().
Differential Revision: http://reviews.llvm.org/D11310

llvm-svn: 242718
2015-07-20 21:59:31 +00:00
Artem Belevich 5bde4e051e Fixed style issues pointed out by Justin Bogner.
Differential Revision: http://reviews.llvm.org/D11273

llvm-svn: 242698
2015-07-20 20:02:54 +00:00
Yaron Keren 0050b48f6c Remove erroneous space in "lib64" string constant.
llvm-svn: 242667
2015-07-20 12:40:25 +00:00
Gabor Ballabas a24a1a411d Allow case-insensitive values for -mtune for AArch64 target in line with GCC.
GCC allows case-insensitive values for -mcpu, -march and -mtune options.
This patch implements the same behaviour for the -mtune option for the AArch64 target.

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

llvm-svn: 242663
2015-07-20 11:28:20 +00:00