Commit Graph

94 Commits

Author SHA1 Message Date
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
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
NAKAMURA Takumi ddb44b85f0 Tweak a couple of -fprofile tests in clang/test to accept backslash in path.
llvm-svn: 241903
2015-07-10 13:11:08 +00:00
Diego Novillo 578caf5da7 Add GCC-compatible flags -fprofile-generate and -fprofile-use.
This patch adds support for specifying where the profile is emitted in a
way similar to GCC. These flags are used to specify directories instead
of filenames. When -fprofile-generate=DIR is used, the compiler will
generate code to write to <DIR>/default.profraw.

The patch also adds a couple of extensions: LLVM_PROFILE_FILE can still be
used to override the directory and file name to use and -fprofile-use
accepts both directories and filenames.

To simplify the set of flags used in the backend, all the flags get
canonicalized to -fprofile-instr-{generate,use} when passed to the
backend. The decision to use a default name for the profile is done
in the driver.

llvm-svn: 241825
2015-07-09 17:23:53 +00:00
David Majnemer c3658d2f24 [Driver] Handle -fno-signed-char and -fno-unsigned-char
GCC maps -fno-unsigned-char to -fsigned-char and -fno-signed-char to
-funsigned-char.

llvm-svn: 238105
2015-05-23 18:48:37 +00:00
Filipe Cabecinhas d0c6468a2b Fix tests so they work when the linker is gcc
If the linker is gcc (the default for Generic_ELF toolchains), we end up
passing most of the arguments to the linker.

Some tests were failing to account for this in their usage of *-NOT: lines
and would fail if compiled with
-DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-unknown-unknown

llvm-svn: 228902
2015-02-12 03:37:55 +00:00
Dan Albert a7693d2c83 Alright, just XFAIL all these for Windows.
I'm going to fix up FileCheck to better handle things like this soon,
but for now let's just unblock the Windows people.

llvm-svn: 219513
2014-10-10 17:20:10 +00:00
Dan Albert e16b92db2d XFAIL coverage -no-integrated-as tests for msvc.
Windows can't use -no-integrated-as, so split these tests out into a
separate file and XFAIL them for win32,win64.

llvm-svn: 219472
2014-10-10 04:28:04 +00:00
Dan Albert a6a79bcf1b _Really_ fix these tests (probably).
llvm-svn: 219468
2014-10-10 03:51:59 +00:00
Dan Albert a4ec57c2c5 Hopefully fixes test failures for msvc.
Looks like llvm::sys::path::filename() was canonicalizing my paths
before emitting them for FileCheck to stumble over.

Fix a style nit with r219460 while I'm at it.

llvm-svn: 219464
2014-10-10 02:26:00 +00:00
Dan Albert b8e7eaedcb PR21195: Emit .gcno files to the proper location.
When building with coverage, -no-integrated-as, and -c, the driver was
emitting -cc1 -coverage-file pointing at a file in /tmp. Ensure the
coverage file is emitted in the same directory as the output file.

llvm-svn: 219460
2014-10-10 01:01:29 +00:00
Justin Bogner ce46adb4f8 Driver: Restore -fkeep-inline-functions as an ignored flag
Several options were moved to the clang_ignored_gcc_optimization group
in r213365, but -fkeep-inline-functions was accidentally dropped. This
restores the flag.

Patch by Steven Wu. Thanks!

llvm-svn: 216522
2014-08-27 05:12:35 +00:00
Reid Kleckner 64ecbe22aa Ignore -fdevirtualize and -fdevirtualize-speculatively for gcc compat
llvm-svn: 216477
2014-08-26 19:57:01 +00:00
Sylvestre Ledru b8198f0222 GCC compatibility: Ignore -fexec-charset=UTF-8 argument. It is the default in Clang. Reject other values.
Summary:
Just like with -finput-charset=UTF-8 in review http://reviews.llvm.org/D4347, I think we should just ignore it when UTF-8 is provided.


Reviewers: rnk, rafael

Reviewed By: rafael

Subscribers: rafael, cfe-commits

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

llvm-svn: 215368
2014-08-11 18:09:03 +00:00
Justin Bogner 4d10c23909 Driver: Add tests for -fprofile-arcs and -fno-profile-arcs
I tried to be lazy and get away with no test in r215051, but Chad
caught me :)

llvm-svn: 215053
2014-08-07 03:58:32 +00:00
Rui Ueyama cfea160681 Remove trailing whitespaces
llvm-svn: 214935
2014-08-05 23:43:21 +00:00
Arthur Marble 05b0798916 Added f and m flags to be ignored. These will not display a warning. The revision
for this patch is here: http://reviews.llvm.org/D4570. This will help with the
rebuild of Debian with clang. Here is a link to the errors that Debian is
experiencing: http://clang.debian.net/status.php?version=3.4.2&key=UNKNOWN_ARG

llvm-svn: 214907
2014-08-05 18:21:20 +00:00
Arthur Marble 731f6d380f Added flags that should be ignored for compatibility. These flags will display
a warning. Revision for this patch is here: http://reviews.llvm.org/D4565. This
patch will help with the rebuild of Debian with clang and many other projects
that wish to use clang. Here is a link to the errors that Debian is experiencing:
http://clang.debian.net/status.php?version=3.4.2&key=UNKNOWN_ARG

llvm-svn: 214906
2014-08-05 18:13:48 +00:00
Reid Kleckner 491e1acd62 Split -Winvalid-command-line-argument into -Wignored-optimization-argument
Reviewers: rsmith, nlewycky

Subscribers: cfe-commits

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

llvm-svn: 213817
2014-07-23 23:29:01 +00:00
Arthur Marble c0d0603999 Moved 25 flags to clang_ignored_gcc_optimization_f_Group. Will display a warning
to the user if they try to pass those optimizations. The revision for this patch
is here: http://reviews.llvm.org/D4474. This patch will fix many errors in the
rebuild of Debian with clang. Here is a link to the page for unknown arguments:
http://clang.debian.net/status.php?version=3.4.2&key=UNKNOWN_ARG

llvm-svn: 213365
2014-07-18 11:38:58 +00:00
Alp Toker cd3acb5604 Avoid non-attributive uses of 'unsupported' in diagnostics
We don't have a style guide for diagnostic messages, but convention strongly
favours the forms:

  'attribute is not supported', 'unsupported attribute'

We generally avoid:

  'attribute is unsupported', 'non-supported attribute'

llvm-svn: 212972
2014-07-14 19:16:22 +00:00
Alp Toker 86f6934e27 Change the diagnostic group for unsupported gcc optimizations added r212805
Use -Winvalid-command-line-argument here to align with existing gcc opt
diagnostics. Meanwhile -Wunused-command-line-argument is for flags that we
support but were, say, fed into the wrong invocation.

Also tweak wording to make sense with -Werror.

llvm-svn: 212964
2014-07-14 18:11:38 +00:00
Sylvestre Ledru 79e3da9653 Test for warning being silenced
Summary:
Added some tests to see if the new warning would be silenced with a flag.

Patch by Arthur Marble <arthur@info9.net> in the context of Debian Google Summer of code 2014.


Reviewers: sylvestre.ledru

Reviewed By: sylvestre.ledru

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

llvm-svn: 212833
2014-07-11 17:23:13 +00:00
Sylvestre Ledru 1028ae7441 Tiny improvement in a test (missing quote)
llvm-svn: 212806
2014-07-11 11:53:18 +00:00
Sylvestre Ledru 2fe501eef9 GCC compatibility: Create a Group to ignore unsupported optimization.
Returns a warning when using an unknown optimization flag.
This patch includes -finline-limit as one of those ignored flags.
More options will be moved in this group

Patch by Arthur Marble <arthur@info9.net> in the context of
Debian Google Summer of code 2014.

Reviewers: rnk, Sylvestre
llvm-svn: 212805
2014-07-11 11:43:57 +00:00
Sylvestre Ledru 0ccfb3a144 gcc comptability: silent -fdefer-pop & -fno-defer-pop
Reviewers: rafael, rnk

Reviewed By: rnk

Subscribers: rnk, cfe-commits

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

llvm-svn: 212327
2014-07-04 08:59:41 +00:00
Sylvestre Ledru 91f380a499 GCC compatibility: Ignore -finput_charset=UTF-8 argument. It is the default in Clang.
Currently, we fail with an error.

Reviewers: rafael

Reviewed By: rafael

Subscribers: rnk, cfe-commits

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

llvm-svn: 212110
2014-07-01 17:24:27 +00:00
Chad Rosier 3ba81bdb45 [driver] Enable the slp vectorizer at -Oz.
PR19568

llvm-svn: 207858
2014-05-02 18:41:57 +00:00
Chad Rosier 136d67dc64 [driver] Disable the slp vectorizer at -O0, -O1, and -Oz. This mirrors the
behavior of the loop vectorizer, which is enabled at -O2, -O3, -O4, -Ofast
and -Os.
PR19568

llvm-svn: 207433
2014-04-28 19:30:57 +00:00
NAKAMURA Takumi 051b40c1cb Suppress clang/test/Driver/clang_f_opts.c for targeting cygming since r202058 is incompatible to gcc driver.
llvm-svn: 202093
2014-02-25 00:30:04 +00:00
Richard Barton c9b5f35ec1 Implement -fno-short-wchar
llvm-svn: 202058
2014-02-24 18:43:28 +00:00
Nico Rieck e6a1582595 Fix broken CHECK lines
llvm-svn: 201477
2014-02-16 07:29:41 +00:00
Argyrios Kyrtzidis 25f2afdee0 Revert r194097: "With this patch -Wwrite-strings is still implemented with the terrible
hack of passing -fconst-strings to -cc1"

Passing or not a language option based on diagnostic settings is a bad idea, it breaks
using a PCH that was compiled with different diagnostic settings.

Also add a test case to make sure we don't regress.

llvm-svn: 200964
2014-02-07 08:33:28 +00:00
Diego Novillo 67fe87fc5e Add flag -fauto-profile as alias to -fprofile-sample-use.
Summary:
GCC uses -fauto-profile to enable sample-based PGO. This patch
adds it to Clang as an alias for -fprofile-sample-use.

Differential Revision: http://llvm-reviews.chandlerc.com/D2353

llvm-svn: 196589
2013-12-06 17:58:19 +00:00
Hans Wennborg ff6af8bc21 Remove period at end of "optimization level is unsupported" diagnostic
llvm-svn: 195048
2013-11-18 22:10:17 +00:00
Hans Wennborg be5df46f26 Make test/Driver/clang_f_opts.c not write to the test dir
After r195009, the test would write a .o file to the test dir. Send that to
/dev/null instead. Also fix the typo in test/Frontend/invalid-o-level.c.

llvm-svn: 195047
2013-11-18 21:58:33 +00:00
Sylvestre Ledru 5abf2ec12d Using an invalid -O falls back on -O3 instead of an error
Summary:
Currently with clang:
$ clang -O20 foo.c
error: invalid value '20' in '-O20'

With the patch:
$ clang -O20 foo.c
warning: optimization level '-O20' is unsupported; using '-O3' instead.
1 warning generated.

This matches the gcc behavior (with a warning added)

Pass all tests:
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
Testing Time: 94.14s
  Expected Passes    : 6721
  Expected Failures  : 20
  Unsupported Tests  : 17

(which was not the case of http://llvm-reviews.chandlerc.com/D2125)

Differential Revision: http://llvm-reviews.chandlerc.com/D2212

llvm-svn: 195009
2013-11-18 13:23:07 +00:00
Hal Finkel ce0697f475 Add -freroll-loops to enable loop rerolling
This adds -freroll-loops (and -fno-reroll-loops in the usual way) to enable
loop rerolling as part of the optimization pass manager. This transformation
can enable vectorization, reduce code size (or both).

Briefly, loop rerolling can transform a loop like this:

for (int i = 0; i < 3200; i += 5) {
  a[i]     += alpha * b[i];
  a[i + 1] += alpha * b[i + 1];
  a[i + 2] += alpha * b[i + 2];
  a[i + 3] += alpha * b[i + 3];
  a[i + 4] += alpha * b[i + 4];
}

into this:

for (int i = 0; i < 3200; ++i) {
  a[i] += alpha * b[i];
}

Loop rerolling is currently disabled by default at all optimization levels.

llvm-svn: 194967
2013-11-17 16:03:29 +00:00
Alp Toker 7874bdc6c1 Revert "Using an invalid -O falls back on -O3 instead of an error"
Trying to fix test failures since earlier today.

One of the tests added in this commit is outputting test/Driver/clang_f_opts.s
which the builders that build in-tree (eg. clang-native-arm-cortex-a9) are
trying to run as a test case, causing failures.

clang_f_opts.c:
  If -### doesn't emit the warning then this test probably shouldn't be in
  here in the first place. Frontend maybe?

invalid-o-level.c:
  Running %clang_cc1 in the Driver tests doesn't make sense because -cc1
  bypasses the driver. (I'm not reverting the commit that introduced this but
  please fix instead of keeping it this way.)

Reverting to fix the build failures and also so that the tests can be thought
out more thoroughly.

This reverts commit r194817.

llvm-svn: 194845
2013-11-15 20:40:58 +00:00
Sylvestre Ledru 6ae3980118 Using an invalid -O falls back on -O3 instead of an error
Summary:
Currently with clang:
$ clang -O20 foo.c
error: invalid value '20' in '-O20'

With the patch:
$ clang -O20 foo.c
warning: optimization level '-O20' is unsupported; using '-O3' instead.
1 warning generated.

This matches the gcc behavior (with a warning added)

Pass all tests:
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
Testing Time: 94.14s
  Expected Passes    : 6721
  Expected Failures  : 20
  Unsupported Tests  : 17

(which was not the case of http://llvm-reviews.chandlerc.com/D2125)

Reviewers: chandlerc, rafael, rengolin, hfinkel

Reviewed By: rengolin

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2152

llvm-svn: 194817
2013-11-15 15:39:14 +00:00
Diego Novillo 5c29705c13 Add -fprofile-sample-use to Clang's driver.
This adds a new option -fprofile-sample-use=filename to Clang. It
tells the driver to schedule the SampleProfileLoader pass and passes
on the name of the profile file to use.

llvm-svn: 194567
2013-11-13 12:22:39 +00:00
Sylvestre Ledru e293b1a8d8 Revert "Using an invalid -O falls back on -O3 instead of an error"
This reverts commit r194403.

Was breaking too many tests...

llvm-svn: 194420
2013-11-11 20:51:44 +00:00
Sylvestre Ledru cc645758c7 Revert "Remove -### from the -O20 test, it was failing the test (?)"
This reverts commit r194414.

Was breaking too many tests...

llvm-svn: 194419
2013-11-11 20:46:40 +00:00
Sylvestre Ledru 313e730eef Remove -### from the -O20 test, it was failing the test (?)
llvm-svn: 194414
2013-11-11 19:54:40 +00:00
Sylvestre Ledru 26386be183 Using an invalid -O falls back on -O3 instead of an error
Summary:
Currently with clang:
$ clang -O20 foo.c 
error: invalid value '20' in '-O20'

With the patch:
$ clang -O20 foo.c 
warning: invalid value '20' in '-O20'. Fall back on value '3'

Reviewers: rengolin, hfinkel

Reviewed By: rengolin

CC: cfe-commits, hfinkel, rengolin

Differential Revision: http://llvm-reviews.chandlerc.com/D2125

llvm-svn: 194403
2013-11-11 19:01:05 +00:00
Rafael Espindola 0df9e16cc7 With this patch -Wwrite-strings is still implemented with the terrible
hack of passing -fconst-strings to -cc1, but at least the driver uses
the regular warning checking code path.

Since we don't support a warning that is DefaultIgnore in one language
but not in another, this patch creates a dummy C only warning in the same
group as the existing one to get the desired effect.

llvm-svn: 194097
2013-11-05 21:43:54 +00:00
Chandler Carruth 5998ee6b3d Teach Clang to accept and ignore -f[no-]implicit-templates.
This GCC flag is useful when you want to control whether implicit
template instantiation occurs at the commandline level. Clang doesn't
currently support such controls, but technically *always* implicitly
instantiating (what Clang does, and what every other compiler still in
use does by default) is valid behavior even under
-fno-implicit-templates, it just may be slow and very wasteful. If
people really want this, we can try to implement it, but I don't have an
actual use.

This should help fix the build of libstdc++ with Clang, its build system
uses this flag.

llvm-svn: 193319
2013-10-24 09:21:37 +00:00
Chandler Carruth 685dca5b0a Teach Clang to recognize and ignore GCC's -fdiagnostics-show-location
flag. We should probably wire at least some variants of this up to our
actual diagnostics engine, but I'm leaving that for someone else. This
fixes the builds of packages which hard code something here, at least
including libstdc++ itself.

llvm-svn: 193318
2013-10-24 09:17:35 +00:00
Rafael Espindola 2a1c07a5fb Ignore -fstrength-reduce and -fno-strength-reduce.
GCC does the same.

llvm-svn: 193103
2013-10-21 18:49:56 +00:00