Commit Graph

2415 Commits

Author SHA1 Message Date
Hans Wennborg 625fba8840 clang-cl: Make /Fo apply also when using -flto
llvm-svn: 283258
2016-10-04 21:01:04 +00:00
Hans Wennborg 26228e3010 clang-cl: Use the .obj file extension also in LTO mode
llvm-svn: 283257
2016-10-04 21:01:02 +00:00
Hans Wennborg 2b0eea4a3b clang-cl: expose the -fuse-ld option
llvm-svn: 283256
2016-10-04 21:01:00 +00:00
Hans Wennborg 02d03befb9 clang-cl: Expose the -flto option
We could hook up /GL as an alias for -flto, but that might be
confusing, as clang-cl in that mode would not be drop-in compatible
with cl.exe /GL, as it requires the linker to be lld.

Exposing -flto seems like a less confusing way to expose this
functionality.

llvm-svn: 283255
2016-10-04 21:00:57 +00:00
Dean Michael Berris 4541bb7fd0 Revert "[XRay] Check in Clang whether XRay supports the target when -fxray-instrument is passed"
This reverts 283193 -- broke the build.

llvm-svn: 283199
2016-10-04 08:54:51 +00:00
Dean Michael Berris 5db9121b31 [XRay] Check in Clang whether XRay supports the target when -fxray-instrument is passed
Added the code which explicitly emits an error in Clang in case
`-fxray-instrument` is passed, but XRay is not supported for the
selected target.

Author: rSerge

Reviewers: dberris, rsmith, aaron.ballman, rnk

Subscribers: cfe-commits, iid_iunknown

Differential Revision: https://reviews.llvm.org/D24799

llvm-svn: 283193
2016-10-04 08:22:47 +00:00
Sjoerd Meijer d98493414b This adds a separate file for the fp denormal regression tests. NFC.
I forgot to svn add the new file in my previous commit.

llvm-svn: 283110
2016-10-03 13:13:50 +00:00
Sjoerd Meijer a5d3fd4780 This adds a separate file for the fp denormal regression tests. NFC.
Differential Revision: https://reviews.llvm.org/D24907

llvm-svn: 283109
2016-10-03 13:12:20 +00:00
Gor Nishanov 4ffb434ca8 [coroutines] Rename driver flag -fcoroutines to -fcoroutines-ts
Summary:
Also makes -fcoroutines_ts to be both a Driver and CC1 flag.

Patch mostly by EricWF.

Reviewers: rnk, cfe-commits, rsmith, EricWF

Subscribers: mehdi_amini

Differential Revision: https://reviews.llvm.org/D25130

llvm-svn: 283064
2016-10-02 03:31:58 +00:00
Hal Finkel 415c2a38f2 [PowerPC] Enable soft-float for PPC64, and +soft-float -> -hard-float
Enable soft-float support on PPC64, as the backend now supports it. Also, the
backend now uses -hard-float instead of +soft-float, so set the target features
accordingly.

Fixes PR26970.

llvm-svn: 283061
2016-10-02 02:10:45 +00:00
Samuel Antao 64e965e4ee [CUDA][OpenMP] Add a generic offload action builder
Summary:
This patch proposes a new class to generate and record action dependences related with offloading. The builder provides three main functionalities:
- Add device dependences to host actions.
- Add host dependence to device actions.
- Register device top-level actions.

The constructor of the builder detect the programming models that should be supported, and generates a specialized builder for each. If a new programming model is to be added in the future, only a new specialized builder has to be implemented. 

When the specialized builder is generated, it produces programming-model-specific diagnostics.

A CUDA specialized builder is proposed in the patch that mostly consists of the partition of the current  `buildCudaAction` by the three different functionalities.

Reviewers: tra, echristo, ABataev, jlebar, hfinkel

Subscribers: Hahnfeld, whchung, guansong, jlebar, mehdi_amini, andreybokhanko, tcramer, mkuron, cfe-commits, arpith-jacob, carlo.bertolli, caomhin

Differential Revision: https://reviews.llvm.org/D18172

llvm-svn: 282865
2016-09-30 15:34:19 +00:00
Douglas Katzman 97833cf5ee [Myriad] Silently ignore -fno-split-dwarf-inlining
llvm-svn: 282757
2016-09-29 19:59:12 +00:00
Jonas Hahnfeld fdaaca8ade XFAIL Driver/darwin-stdlib.cpp if CLANG_DEFAULT_CXX_STDLIB is set
Until someone rewrites the stdlib logic for Darwin so that we don't need
to pass down the -stdlib argument to cc1.
(see https://llvm.org/bugs/show_bug.cgi?id=30548)

Differential Revision: https://reviews.llvm.org/D24601

llvm-svn: 282701
2016-09-29 07:43:08 +00:00
Artem Belevich d4d9dc8252 [CUDA] Added support for CUDA-8
Differential Revision: https://reviews.llvm.org/D24946

llvm-svn: 282610
2016-09-28 17:47:40 +00:00
Nemanja Ivanovic 10e2b5dcaa [Power9] Builtins for ELF v.2 ABI conformance - front end portion
This patch corresponds to review:
https://reviews.llvm.org/D24397

It adds the __POWER9_VECTOR__ macro and the -mpower9-vector option along with
a number of altivec.h functions (refer to the code review for a list).

llvm-svn: 282481
2016-09-27 10:45:22 +00:00
Matthias Braun fedd367d70 Fix test on windows
llvm-svn: 282438
2016-09-26 20:48:34 +00:00
Matthias Braun abb6eea19c CC1: Add -save-stats option
This option behaves in a similar spirit as -save-temps and writes
internal llvm statistics in json format to a file.

Differential Revision: https://reviews.llvm.org/D24820

llvm-svn: 282426
2016-09-26 18:53:34 +00:00
Saleem Abdulrasool c094131557 Driver: avoid failing in the backend
Avoid failing in the backend when the rewrite map does not exist.  Rather check
that the map exists in the frontend before handing it off to the backend.  Add
the missing rewrite maps that the tests were referencing.

llvm-svn: 282379
2016-09-26 04:48:22 +00:00
Teresa Johnson 12286d22b7 [LTO] Add -flto-jobs=N to control backend parallelism
Summary:
Currently, a linker option must be used to control the backend
parallelism of ThinLTO. The linker option varies depending on the
linker (e.g. gold vs ld64). Add a new clang option -flto-jobs=N
to control this.

I've added in the wiring to pass this to the gold plugin. I also
added in the logic to pass this down in the form I understand that
ld64 uses on MacOS, for the darwin target.

Reviewers: mehdi_amini, dexonsmith

Subscribers: mehdi_amini, cfe-commits

Differential Revision: https://reviews.llvm.org/D24826

llvm-svn: 282291
2016-09-23 20:38:09 +00:00
Renato Golin fa007aeef4 Revert "set the underlying value of “#pragma STDC FP_CONTRACT” on by default"
This reverts commit r282259, as it broke the AArch64 test-suite bots.

llvm-svn: 282289
2016-09-23 20:32:52 +00:00
Sebastian Pop 6919ae5abc set the underlying value of “#pragma STDC FP_CONTRACT” on by default
Clang has the default FP contraction setting of “-ffp-contract=on”, which
doesn't really mean “on” in the conventional sense of the word, but rather
really means “according to the per-statement effective value of the relevant
pragma”.

Before this patch, Clang has that pragma defaulting to “off”. Since the
“-ffp-contract=on” mode is really an AND of two booleans and the second of them
defaults to “off”, the whole thing effectively defaults to “off”. This patch
changes the default value of the pragma to “on”, thus making the default pair of
booleans (on, on) rather than (on, off). This makes FP optimization slightly
more aggressive than before when not using either “-Ofast”, “-ffast-math”, or
“-ffp-contract=fast”. Even with this patch the compiler still respects
“-ffp-contract=off”.

As per a suggestion by Steve Canon, the added code does _not_ require “-O3” or
higher. This is so as to try our best to preserve identical floating-point
results for unchanged source code compiling for an unchanged target when only
changing from any optimization level in the set (“-O0”, “-O1”, “-O2”, “-O3”) to
any other optimization level in that set. “-Os” and “-Oz” seem to be behaving
identically, i.e. should probably be considered a part of the aforementioned
set, but I have not reviewed this rigorously. “-Ofast” is explicitly _not_ a
member of that set.

Patch authored by Abe Skolnik [a.skolnik@samsung.com] and Stephen Canon [scanon@apple.com].

Differential Revision: https://reviews.llvm.org/D24481

llvm-svn: 282259
2016-09-23 16:16:25 +00:00
Zachary Turner c4815d4f42 Fix a regex error breaking tests.
llvm-svn: 282004
2016-09-20 19:10:56 +00:00
Zachary Turner e848a7363f Add some entropy to the folder name in Driver/warning-options.cpp.
It was trying to check that things behave correctly when a
non-existant folder was specified for -isysroot.  Incidentally,
I have a folder named FOO in the root of my drive, so this test
was failing.  Make this impossible by using %T to refer to a
definitely non-existant folder.:

llvm-svn: 281998
2016-09-20 18:41:19 +00:00
Justin Lebar 6efbc73c25 [CUDA] Don't try to run sanitizers on NVPTX.
Summary:
Sanitizers aren't supported on NVPTX -- don't try to run them.

This lets you e.g. pass -fsanitize=address and get asan on your host
code.

Reviewers: kcc

Subscribers: cfe-commits, tra, jhen

Differential Revision: https://reviews.llvm.org/D24640

llvm-svn: 281680
2016-09-15 23:44:13 +00:00
Reid Kleckner a98496e6b0 [clang-cl] Accept the joined equals version of -resource-dir=
lib/Tooling injects this argument without regard for what driver syntax
is in use.

llvm-svn: 281550
2016-09-14 22:31:24 +00:00
Kostya Serebryany 60cdd6113f [sanitizer-coverage] add yet another flavour of coverage instrumentation: trace-pc-guard. The intent is to eventually replace all of {bool coverage, 8bit-counters, trace-pc} with just this one. Clang part
llvm-svn: 281432
2016-09-14 01:39:49 +00:00
Peter Collingbourne eeb56abe64 Update Clang for D20147 ("DebugInfo: New metadata representation for global variables.")
Differential Revision: http://reviews.llvm.org/D20415

llvm-svn: 281285
2016-09-13 01:13:19 +00:00
Adrian Prantl 432d3d2619 Debug info: Bump the default DWARF version on Darwin to 4.
This is a spiritual re-commit of r201375 with only a brief delay
for upgrading the green dragon builders.

llvm-svn: 281094
2016-09-09 21:10:35 +00:00
Douglas Katzman 3972f9e6df Myriad: nominally "support" ASAN.
Doesn't work, but needs to be enabled in order to get there.

llvm-svn: 281071
2016-09-09 18:20:49 +00:00
Reid Kleckner b6bee5164d Make -fstandalone-debug and -flimit-debug-info available in clang-cl
Our limited debug info optimizations are breaking down at DLL
boundaries, so we're going to evaluate the size impact of these
settings, and possibly change the default.

Users should be able to override our settings, though.

llvm-svn: 281056
2016-09-09 16:42:50 +00:00
Vedant Kumar 10037b93e9 [Driver] Report invalid -mtune/-mcpu parameters when -arch=arm64
Differential Revision: https://reviews.llvm.org/D23643

llvm-svn: 280998
2016-09-08 22:53:19 +00:00
Sagar Thakur c9113e4863 [EfficiencySanitizer] [MIPS64] Enables esan clang driver options for MIPS64
Reviewed by bruening
Differential: D23800

llvm-svn: 280806
2016-09-07 12:23:15 +00:00
Pierre Gousseau 209b6e2e78 [clang-cl] Check that we are in clang cl mode before enabling support for the CL environment variable.
Checking for the type of the command line tokenizer should not be the criteria to enable support for the CL environment variable, this change checks that we are in clang-cl mode instead.

Differential Revision: https://reviews.llvm.org/D23503

llvm-svn: 280702
2016-09-06 10:48:27 +00:00
Nick Lewycky 97e49ac59e Add -fprofile-dir= to clang.
-fprofile-dir=path allows the user to specify where .gcda files should be
emitted when the program is run. In particular, this is the first flag that
causes the .gcno and .o files to have different paths, LLVM is extended to
support this. -fprofile-dir= does not change the file name in the .gcno (and
thus where lcov looks for the source) but it does change the name in the .gcda
(and thus where the runtime library writes the .gcda file). It's different from
a GCOV_PREFIX because a user can observe that the GCOV_PREFIX_STRIP will strip
paths off of -fprofile-dir= but not off of a supplied GCOV_PREFIX.

To implement this we split -coverage-file into -coverage-data-file and
-coverage-notes-file to specify the two different names. The !llvm.gcov
metadata node grows from a 2-element form {string coverage-file, node dbg.cu}
to 3-elements, {string coverage-notes-file, string coverage-data-file, node
dbg.cu}. In the 3-element form, the file name is already "mangled" with
.gcno/.gcda suffixes, while the 2-element form left that to the middle end
pass.

llvm-svn: 280306
2016-08-31 23:04:32 +00:00
David Blaikie 37dcf6bf97 DebugInfo: Fix -gsplit-dwarf + -fno-split-dwarf-inlining
I tested the cases involving split-dwarf + gmlt +
no-split-dwarf-inlining, but didn't verify the simpler case without
gmlt.

The logic is, admittedly, a little hairy, but seems about as simple as I
could wrangle it.

llvm-svn: 280290
2016-08-31 20:54:35 +00:00
Saleem Abdulrasool 667d630b05 Revert "Driver: use the canonical static library naming"
This breaks chromium and its unclear if this is actually a modern convention.

This reverts SVN r280169.

llvm-svn: 280281
2016-08-31 19:27:07 +00:00
Sjoerd Meijer f2392f69d5 Revision r280064 adds new options -fdenormal-fp-math and passes through option
-ffast-math to CC1, but it included a wrong llvm regression tests which was
removed in r280065.  Although regression test noexceptionsfpmath.c makes sure
-fno-trapping-math ends up as a function attribute, this adds a test that
explicitly checks the driver output for -fno-trapping-math.

llvm-svn: 280227
2016-08-31 12:31:03 +00:00
Richard Trieu 5ed6fe739f Concatenate two FileCheck lines in a test.
'cc1' is a valid sequence of hexadecimal and sometimes can occur in the path
when testing.  This can lead to FileCheck matching the incorrect occurance
of the 'cc1' string and causing a test failure.  Join two adjacent flags
together into one check to prevent this.

llvm-svn: 280189
2016-08-31 01:57:12 +00:00
Richard Smith fdb32d566a Don't try to run a test that generates code for x86 if it's not a registered target.
llvm-svn: 280178
2016-08-30 23:53:34 +00:00
Saleem Abdulrasool d01704b149 Driver: use the canonical static library naming
On Windows, static libraries are named lib<name>.lib while import libraries are
named <name>.lib.  Use the appropriate naming on itanium and msvc environments.
This is setup properly so that if a dynamic builtins is used on Windows, it
would do the right thing, although this is not currently wired through the
driver (i.e. there is no equivalent to -{shared,static}-gcc).

llvm-svn: 280169
2016-08-30 22:10:27 +00:00
Vedant Kumar b7df1e2148 [test] Pass a fake libLTO.dylib to a driver test which depends on it
This makes it possible to run 'check-clang' on Darwin without building
libLTO.dylib. See r280142 for more context.

llvm-svn: 280150
2016-08-30 20:36:50 +00:00
Richard Smith dd4ad3d2ad Unrevert r280035 now that the clang-cl bug it exposed has been fixed by
r280133. Original commit message:

C++ Modules TS: driver support for building modules.

This works as follows: we add --precompile to the existing gamut of options for
specifying how far to go when compiling an input (-E, -c, -S, etc.). This flag
specifies that an input is taken to the precompilation step and no further, and
this can be specified when building a .pcm from a module interface or when
building a .pch from a header file.

The .cppm extension (and some related extensions) are implicitly recognized as
C++ module interface files. If --precompile is /not/ specified, the file is
compiled (via a .pcm) to a .o file containing the code for the module (and then
potentially also assembled and linked, if -S, -c, etc. are not specified). We
do not yet suppress the emission of object code for other users of the module
interface, so for now this will only work if everything in the .cppm file has
vague linkage.

As with the existing support for module-map modules, prebuilt modules can be
provided as compiler inputs either via the -fmodule-file= command-line argument
or via files named ModuleName.pcm in one of the directories specified via
-fprebuilt-module-path=.

This also exposes the -fmodules-ts cc1 flag in the driver. This is still
experimental, and in particular, the concrete syntax is subject to change as
the Modules TS evolves in the C++ committee. Unlike -fmodules, this flag does
not enable support for implicitly loading module maps nor building modules via
the module cache, but those features can be turned on separately and used in
conjunction with the Modules TS support.

llvm-svn: 280134
2016-08-30 19:06:26 +00:00
Richard Smith 8cd452d471 PR30195: Fix clang-cl attempting to precompile bogus (non-precompilable) input types.
llvm-svn: 280133
2016-08-30 18:55:16 +00:00
Nico Weber 39dc744f19 Fix typo in comment
llvm-svn: 280094
2016-08-30 14:24:28 +00:00
Nico Weber e36ab4a0a4 Revert r280035 (and followups r280057, r280085), it caused PR30195
llvm-svn: 280091
2016-08-30 14:12:06 +00:00
Krzysztof Parzyszek 1f26912e4c Handle -mlong-calls on Hexagon
Differential Revision:://reviews.llvm.org/D22766 

llvm-svn: 280089
2016-08-30 13:57:50 +00:00
NAKAMURA Takumi e992269199 clang/test/Driver/modules-ts.cpp: Satisfy quoted filename.
On win32, backslashed filename is emitted like;

  -o "C:\\bb-win\\ninja-clang-i686-msc19-R\\build\\tools\\clang\\test\\Driver\\Output\\modules-ts.cpp.tmp.o"

llvm-svn: 280085
2016-08-30 13:07:53 +00:00
Sjoerd Meijer e9e988e163 Fix for commit 280064 that break the build.
llvm-svn: 280065
2016-08-30 08:56:00 +00:00
Sjoerd Meijer 0a8d4216ad This adds new options -fdenormal-fp-math and passes through option -ffast-math
to CC1, which are translated to function attributes and can e.g. be mapped on
build attributes FP_exceptions and FP_denormal. Setting these build attributes
allows better selection of floating point libraries.

Differential Revision: https://reviews.llvm.org/D23840

llvm-svn: 280064
2016-08-30 08:09:45 +00:00
Richard Smith 4bcf6b6de2 Combine two FileCheck patterns to prevent overzealous matching of .*
llvm-svn: 280057
2016-08-30 05:14:38 +00:00