Commit Graph

1152 Commits

Author SHA1 Message Date
Richard Smith 79c927bfe9 Add a limit to the length of a sequence of 'operator->' functions we will
follow when building a class member access expression. Based on a patch by
Rahul Jain!

llvm-svn: 194161
2013-11-06 19:31:51 +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
Rafael Espindola a6775b622f clang-format this if.
llvm-svn: 193997
2013-11-04 17:13:51 +00:00
Peter Collingbourne 3270164f39 SanitizerArgs: add ability to filter/diagnose unsupported sanitizers.
The thread, memory, dataflow and function sanitizers are now diagnosed if
enabled explicitly on an unsupported platform.  Unsupported sanitizers which
are enabled implicitly (as part of a larger group) are silently disabled.  As a
side effect, this makes SanitizerArgs parsing toolchain-dependent (and thus
essentially reverts r188058), and moves SanitizerArgs ownership to ToolChain.

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

llvm-svn: 193875
2013-11-01 18:16:25 +00:00
Amara Emerson 703da2ea98 [AArch64] Add some CPU targets for "generic", A-53 and A-57.
Enables the clang driver to begin targeting specific CPUs. Introduced a
"generic" CPU which will ensure that the optional FP feature is enabled
by default when it gets to LLVM, without needing any extra arguments.
Cortex-A53 and A-57 are also introduced with tests, although backend
handling of them does not yet exist.

llvm-svn: 193740
2013-10-31 09:32:33 +00:00
Evgeniy Stepanov 4ae68468cd Add -lm to sanitizer link arguments.
We'll need to intercept a few function in libm.

llvm-svn: 193644
2013-10-29 19:48:47 +00:00
Bernard Ogden 18b5701a68 ARM: Add -m[no-]crc to dis/enable CRC subtargetfeature from clang
Allow users to disable or enable CRC subtarget feature.

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

llvm-svn: 193600
2013-10-29 09:47:51 +00:00
Bernard Ogden da13af380a Add driver support for FP, SIMD and crypto defaults.
Although we wire up a bit for v8fp for macro setting
purposes, we don't set a macro yet. Need to ask list
about that.

Change-Id: Ic9819593ce00882fbec72757ffccc6f0b18160a0
llvm-svn: 193367
2013-10-24 18:32:51 +00:00
Bernard Ogden a58ef057b9 Set appropriate FPU default for Linux on v8
Change-Id: If9b649c92e7196e3e791948545dc80901a0761eb
llvm-svn: 193365
2013-10-24 18:32:41 +00:00
Bernard Ogden 021d7dacd0 Teach clang driver about Cortex-A53 and Cortex-A57.
Adds some Cortex-A53 strings where they were missing before.
Cortex-A57 is entirely new to clang.

Doesn't touch code only used by Darwin, in consequence of which
one of the A53 lines has been removed.

Change-Id: I5edb58f6eae93947334787e26a8772c736de6483
llvm-svn: 193364
2013-10-24 18:32:36 +00:00
Benjamin Kramer b2ccade343 Driver: Various string-related cleanups.
Also fixes some funky formatting.

llvm-svn: 193079
2013-10-21 12:33:55 +00:00
Silviu Baranga f9671dd09d Add the __ARM_ARCH_EXT_IDIV__ predefine. It is set to 1 if we have hardware divide in the mode that we are compiling in (depending on the target features), not defined if we don't. Should be compatible with the GCC conterpart. Also adding a -hwdiv option to overide the default behavior.
llvm-svn: 193074
2013-10-21 10:54:53 +00:00
Daniel Jasper ac42b75195 Expose -fmodule-name and -fmodule-map-file as driver options.
Review: http://llvm-reviews.chandlerc.com/D1974
llvm-svn: 193069
2013-10-21 06:34:34 +00:00
Peter Collingbourne f7ef3fd810 Revert r193022 and r193048. They broke the ubsan test suite.
llvm-svn: 193057
2013-10-20 21:29:13 +00:00
Benjamin Kramer 80b5a9d2d0 Driver: libubsan_cxx depends on libubsan. Preserve the topological ordering, some linkers depend on it.
llvm-svn: 193048
2013-10-20 12:34:18 +00:00
Nick Lewycky 2492169aee When building ubsan, link in ubsan parts first and sanitizer-common second, to
pick up the common bits ubsan actually needs. Also remove whole-archive when we
aren't trying to re-export the symbols.

llvm-svn: 193022
2013-10-19 00:27:23 +00:00
Daniel Sanders 9469417064 [mips] Added -mfp64 and -mfp32 options.
These options specify 64-bit FP registers and 32-bit FP registers respectively.

When using -mfp32, the FPU has 16x double-precision registers overlapping with
the 32x single-precision registers (each double-precision register overlaps
two single-precision registers).

When using -mfp64, the FPU has 32x double-precision registers overlapping with
the 32x single-precision registers (each double-precision register overlaps
with one single-precision register and has an additional 32-bits).

MSA requires -mfp64.

llvm-svn: 192899
2013-10-17 14:55:58 +00:00
Eric Christopher 643bb6a176 Rework ppc options handling into a features group.
This should have no functional behavior.

llvm-svn: 192838
2013-10-16 20:40:08 +00:00
Benjamin Kramer 34cb04393a Driver: Factor duplicated code.
llvm-svn: 192817
2013-10-16 17:42:39 +00:00
Akira Hatanaka 3764e6c112 [mips] Enable frame-pointer elimination for -O1 and above.
llvm-svn: 192815
2013-10-16 17:13:08 +00:00
Fariborz Jahanian daf4831868 ObjectiveC driver. Scrap -fno-objc-legacy-dispatch for NeXT
runtime. It will be silently ignored and regardless
of deployment target. // rdar://14803286

llvm-svn: 192719
2013-10-15 17:16:30 +00:00
Joerg Sonnenberger a443563ff0 For NetBSD/current on X86 do not use libgcc and default to libc++.
Adjust linkage to make more sense for older releases.

llvm-svn: 192615
2013-10-14 20:13:05 +00:00
Manman Ren f5d9d348f7 Turn struct-path aware TBAA on by default.
Use -no-struct-path-tbaa to turn it off.
This is the same as r191695, which was reverted because it depends on a
commit that has issues.

llvm-svn: 192497
2013-10-11 20:48:38 +00:00
Robert Lytton cf1dd692ae XCore target: add an xcore toolchain implementation
llvm-svn: 192437
2013-10-11 10:29:40 +00:00
Nick Lewycky 609dd6671d Fix typo in comment. No functionality change.
llvm-svn: 192412
2013-10-11 03:33:53 +00:00
Simon Atanasyan e0cc7c72be [Mips] Do not check for options from the OPT_mips_CPUs_Group. All these
options are aliases now.

llvm-svn: 192290
2013-10-09 12:12:24 +00:00
Simon Atanasyan eeb6f27fd5 Revert r191947. The problem is not MIPS-specific and requires more
general solution.

llvm-svn: 191951
2013-10-04 11:46:54 +00:00
Simon Atanasyan 777669be1e [Mips] For MIPS '-fPIC -static' means to compile as -fPIC but link with
-static. So do not turn off the PIC flag if -static passed to the
driver in case of MIPS target.

http://llvm.org/bugs/show_bug.cgi?id=14693

llvm-svn: 191947
2013-10-04 10:36:42 +00:00
Tim Northover e66c946ee4 ARM: *-*-darwin-eabi triples should use AAPCS.
llvm-svn: 191900
2013-10-03 14:23:28 +00:00
Amara Emerson 4cdb87b2d5 [ARM] Add -mfpu=none option to the driver.
llvm-svn: 191736
2013-10-01 10:20:54 +00:00
Richard Smith e4aaac506c Revert r191586 and r191695. They cause crashes when building with
-relaxed-aliasing.

llvm-svn: 191725
2013-10-01 02:20:23 +00:00
Manman Ren e5c2d919b6 Turn struct-path aware TBAA on by default.
Use -no-struct-path-tbaa to turn it off.

llvm-svn: 191695
2013-09-30 19:35:19 +00:00
Daniel Jasper 6e16d54266 Fix misspelling of -fmodules-decluse.
llvm-svn: 191640
2013-09-29 12:40:54 +00:00
Rafael Espindola ea1ba0adfc Replace -fobjc-default-synthesize-properties with disable-objc-default-synthesize-properties.
We want the modern behavior most of the time, so inverting the option simplifies
the driver and the tests.

llvm-svn: 191551
2013-09-27 20:21:48 +00:00
Hans Wennborg 260ff405a7 clang-cl: pass /FI options to fallback
We started parsing /FI in r191442, and now we can pass it on to the
fallback too.

llvm-svn: 191537
2013-09-27 17:54:18 +00:00
Rafael Espindola 339d875cc1 Remove method that always returns true.
llvm-svn: 191533
2013-09-27 16:58:26 +00:00
Hans Wennborg b6331dcb51 clang-cl: fix passing optimization level to cl.exe in /fallback mode
We were previously mostly passing it through, but -O0 and -O3 are not valid
options to cl.exe.

We should translate -O0 to /Od and -O3 to /Ox. -O{1,2,s} get passed through.

llvm-svn: 191323
2013-09-24 18:17:21 +00:00
Hans Wennborg 263c213061 clang-cl: pass /nologo when falling back to cl.exe
llvm-svn: 191316
2013-09-24 17:36:21 +00:00
Daniel Jasper ba7f2f7110 Module use declarations (II)
Review: http://llvm-reviews.chandlerc.com/D1546.

I have picked up this patch form Lawrence
(http://llvm-reviews.chandlerc.com/D1063) and did a few changes.

From the original change description (updated as appropriate):
This patch adds a check that ensures that modules only use modules they
have so declared. To this end, it adds a statement on intended module
use to the module.map grammar:

  use module-id

A module can then only use headers from other modules if it 'uses' them.
This enforcement is off by default, but may be turned on with the new
option -fmodules-decluse.

When enforcing the module semantics, we also need to consider a source
file part of a module. This is achieved with a compiler option

-fmodule-name=<module-id>.

The compiler at present only applies restrictions to the module directly
being built.

llvm-svn: 191283
2013-09-24 09:14:14 +00:00
Simon Atanasyan 22127cee34 [Mips] Support -mnan=2008 option. Define "__mips_nan2008" macros and pass
this option to the assembler.

llvm-svn: 191282
2013-09-24 09:09:16 +00:00
Rafael Espindola 25f007f054 Remove unused option.
gcc doesn't support "gcc -m sse" and this was not tested in clang and only
used for link argument on darwin, so this was very likely just a bug.

llvm-svn: 191251
2013-09-24 00:10:56 +00:00
Hans Wennborg f4aee18086 clang-cl: print diagnostics as "error(clang): foo" in /fallback mode
This solves two problems:

1) MSBuild will not flag the build as unsuccessful just because we print
   an error in the output, since "error(clang):" doesn't seem to match
   the regex it's using.

2) It becomes more clear that the diagnostic is coming from clang as
   supposed to cl.exe.

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

llvm-svn: 191250
2013-09-24 00:08:55 +00:00
Hans Wennborg 188382eba5 clang-cl: implement custom search for cl.exe in /fallback mode
This solves the problem of fallback onto ourselves if clang-cl
has been renamed to cl.exe and put on the PATH, as happens with
the VS integration.

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

llvm-svn: 191099
2013-09-20 18:16:35 +00:00
Alexander Potapenko ce87633ff9 [ASan] Do not imply -undefined dynamic_lookup when linking dylibs with -fsanitize=address.
Instead add the ASan runtime to the linker command line so that only the ASan API functions can be undefined in the target library.

Fixes http://llvm.org/bugs/show_bug.cgi?id=17275

llvm-svn: 191076
2013-09-20 08:09:51 +00:00
Hans Wennborg 87cfa71071 clang-cl: implement /fallback mode
When this flag is enabled, clang-cl falls back to cl.exe if it
cannot compile the code itself for some reason.

The idea is to use this to help build projects that almost compile
with clang-cl, except for some files that can then be built with
the fallback mechanism.

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

llvm-svn: 191034
2013-09-19 20:32:16 +00:00
Amara Emerson fc362c62bf [ARMv8] Add crypto-neon-fp-armv8 -mfpu option in driver.
llvm-svn: 191001
2013-09-19 13:54:03 +00:00
Hans Wennborg 9cb7d9ba94 clang-cl: Don't warn about overriding /MD with /MT, /Fo with another /Fo, etc.
I put in the warnings because MSVC has them, but I don't think they're very
useful.

Clang does not warn about overriding flags in general, e.g. it's perfectly
fine to have -fomit-frame-pointer followed by -fno-omit-frame-pointer.

We should focus on warning where things get confusing, such as with the
/TP and /TC options. In "clang-cl /TC a.c /TP b.cc", the user might not
realize that the /TP flag will apply to both files, and we warn about that.

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

llvm-svn: 190964
2013-09-18 22:26:39 +00:00
Reid Kleckner c106fdafdd Claim compatibility with VS 2012 by default
This will define _MSC_VER to 1700 by default and avoid linker errors
from /failifmismatch linker directives in the C++ standard headers.

Most people trying out the Visual Studio integration are using 2012,
since that's the only version that clang-format works with.  This way
they don't have to pass funky -Xclang -fmsc-version=1700 flags just to
link against the standard C++ runtime.

llvm-svn: 190908
2013-09-18 00:33:59 +00:00
Argyrios Kyrtzidis 85230d50f2 [arcmt] Don't try to handle files that are already ARC'ified, this is not possible currently.
rdar://14461559

llvm-svn: 190880
2013-09-17 19:14:29 +00:00
Hans Wennborg a8ef14f3f4 clang-cl: ignore compile-only options in link-only invocations.
Previously we would warn about unused arguments such as /MD when linking.
Clang already has logic to ignore compile-only options, e.g. for -D and -U.
This patch extends that to include clang-cl's compile-only options too.

Also, some clang-cl options should always be ignored. Doing this earlier
means they get ignored both for compilation and link-only invocations.

llvm-svn: 190825
2013-09-17 00:03:41 +00:00