Commit Graph

1459 Commits

Author SHA1 Message Date
Duncan P. N. Exon Smith 97140c9270 InstrProf: Emit runtime hook directly in IRGen
-u behaviour is apparently not portable between linkers (see cfe-commits
discussions for r204379 and r205012).  I've moved the logic to IRGen,
where it should have been in the first place.

I don't have a Linux system to test this on, so it's possible this logic
*still* doesn't pull in the instrumented profiling runtime on Linux.

I'm in the process of getting tests going on the compiler-rt side
(llvm-commits "[PATCH] InstrProf: Add initial compiler-rt test").  Once
we have tests for the full flow there, the runtime logic should get a
whole lot less brittle.

<rdar://problem/16458307>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205023 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-28 17:53:22 +00:00
Duncan P. N. Exon Smith d12127df41 Revert "Link in profile library on Linux using --whole-archive"
This reverts commit r205012.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205022 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-28 17:53:17 +00:00
Alexey Samsonov 8d29648d80 Link in profile library on Linux using --whole-archive
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205012 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-28 15:39:08 +00:00
Christian Pirker 37a9afe9eb Add ARM big endian Target (armeb, thumbeb)
Reviewed at http://llvm-reviews.chandlerc.com/D3096



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205008 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-28 14:40:46 +00:00
Saleem Abdulrasool 1e57f17deb Use the new Windows environment for target detection
This follows the LLVM change to canonicalise the Windows target triple
spellings.  Rather than treating each Windows environment as a single entity,
the environments are now modelled properly as an environment.  This is a
mechanical change to convert the triple use to reflect that change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204978 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-27 22:50:18 +00:00
David Blaikie d87684dddb Support for -Wa,-compress-debug-sections.
Also, while I'm here, support -nocompress-debug-sections too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204959 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-27 20:47:30 +00:00
Duncan P. N. Exon Smith 67b42c1649 InstrProf: Pull in runtime on non-Darwin
r204379 changed the way the profile runtime gets pulled in, but missed
updating non-Darwin targets.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204939 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-27 16:20:02 +00:00
David Blaikie a31456a646 Use an option alias to implement -gmlt
Review feedback from Reid Kleckner on r203603.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204755 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-25 20:42:27 +00:00
Benjamin Kramer d53585be8f Fix an logic error in the clang driver preventing crtfastmath.o from linking when -Ofast is used without -ffast-math
In gcc using -Ofast forces linking of crtfastmath.o.
In the current clang crtfastmath.o is only linked when -ffast-math/-funsafe-math-optimizations passed. It can lead to performance issues, when using only -Ofast without explicit -ffast-math (I faced with it).
My patch fixes inconsistency with gcc behaviour and also introduces few tests on it.

Patch by Zinovy Nis!

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204742 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-25 18:02:07 +00:00
Hans Wennborg b5893c8b7b clang-cl: make /Gy imply -fdata-sections in addition to -ffunction-sections
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204736 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-25 17:50:25 +00:00
Hans Wennborg d13c37832f clang-cl: Forward /Gy or /Gy- when falling back to cl.exe
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204723 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-25 14:48:54 +00:00
Will Schmidt ba6e4af2e5 Update the parameters passed to the assembler and linker for
the PPC64LE target.  Specifically:
(assembler) adds/uses  -mppc64 -mlittle-endian
(linker) adds/uses  elf64lppc

Testcase included.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204626 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-24 17:10:37 +00:00
Alexey Samsonov 2b7cab0c2e Kill -faddress-sanitizer, -fthread-sanitizer and -fcatch-undefined-behavior flags.
These flags are deprecated since at least Clang 3.3. Users should instead
use -fsanitize= with appropriate values.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204330 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-20 10:48:29 +00:00
Viktor Kutuzov 6aa757590a Add support for sanitizers arguments on FreeBSD
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204129 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 09:36:50 +00:00
Christian Pirker a5ee2ebbdf AArch64_be specific clang target settings
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203918 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-14 12:15:45 +00:00
Argyrios Kyrtzidis b18df473d3 [Modules] Emit the module file paths as dependencies of the PCH when we are building one.
This is because the PCH is tied to the module files, if one of the module files changes or gets removed
the build system should re-build the PCH file.

rdar://16321245

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203885 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-14 03:07:38 +00:00
Joerg Sonnenberger 5f44722c26 Always use --eh-frame-hdr on NetBSD, even for -static.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203742 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13 00:42:01 +00:00
Ben Langmuir 310c3dc9ef Add an option -fmodules-validate-system-headers
When enabled, always validate the system headers when loading a module.
The end result of this is that when these headers change, we will notice
and rebuild the module.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203630 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-12 00:06:17 +00:00
David Blaikie 640884e00a Driver: Support -gmlt as an alias for -gline-tables-only
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203603 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-11 21:05:26 +00:00
Alexey Bataev fec65ff9a6 [OPENMP] Fixed linked libraries for libiomp5 on Linux
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203212 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-07 07:43:52 +00:00
Saleem Abdulrasool b12c514753 Update for LLVM API change
Use the new getObjectFormat/setObjectFormat instead of Environment now that the
file format is a separate field.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203161 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-06 20:47:19 +00:00
Alexey Bataev 67fafb973c [OPENMP] Added option -fopenmp=libiomp5|libgomp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203081 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-06 05:43:53 +00:00
Benjamin Kramer 6fd5cdde30 Pass llvm::Triple objects by const reference.
Copying isn't cheap as it contains a std::string.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202880 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 19:31:42 +00:00
Argyrios Kyrtzidis 977d67c59b Introduce '-fmodules-user-build-path' which accepts the "canonical" path to a user workspace build.
This is used to avoid conflicts with user modules with the same name from different workspaces.

rdar://16042513

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202683 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-03 08:12:05 +00:00
Rafael Espindola 42303467cd Add support for OpenBSD SPARC assembler.
Patch by Brad Smith.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202462 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-28 01:55:21 +00:00
Roman Divacky 8181ff0ece Pass the sparc architecture variant to the assembler.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202179 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-25 18:45:49 +00:00
Hans Wennborg df760270f9 clang-cl: use -fno-rtti by default
Generating RTTI in the MS ABI is currently not supported, and the failures
are confusing to users, so let's disable it by default for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202178 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-25 18:36:22 +00:00
Roman Divacky 016c30178d Give sparcv9 the ability to set the target cpu. Change it from accepting
-march which doesnt exist on sparc gcc to -mcpu. While here adjust a
few tests to not write an unused temporary file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202177 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-25 18:35:30 +00:00
Christian Pirker ee2e36b515 Add AArch64 big endian Target (aarch64_be)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202151 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-25 13:51:00 +00:00
Alexey Samsonov 40a81ef14e Respect ToolChain::isPIEDefault() in constructing link job on Linux and FreeBSD.
Partially based on http://llvm-reviews.chandlerc.com/D2644 by Viktor Kutuzov.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202150 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-25 13:26:03 +00:00
Alexey Samsonov 2d24dc3d64 Factor adding sanitizer linker flags into a separate function and make it less OS-specific
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202148 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-25 12:43:43 +00:00
Richard Barton 7615ef6fe7 Implement -fno-short-wchar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202058 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-24 18:43:28 +00:00
Saleem Abdulrasool 8c702d1f44 clang: add -f{no-,}integrate-as as consistent parameters
The integrated assembler is a feature.  This makes the new flags the default
option, and the previous versions aliases.  Ideally, at some point the aliases
would be entirely removed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201963 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-23 00:40:30 +00:00
Saleem Abdulrasool 9c1883ccfc clang: forward -no-integrated-as from the driver
Forward the -no-integrated-as option to -cc1 rather than simply invoking the
appropriate tool.  This is useful since this option has been overloaded to
permit disabling of parsing inline assembly at the MC layer.

This re-applies the previous version of the patch with a renaming of the driver
option to the public name rather than the internal name (-target vs -triple).
The actual failure is fixed separately of an overly aggressive negative pattern
match in the MIPS driver tests.  It also fixes the incorrect test for targets
that have the integrated assembler disabled by default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201960 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-22 23:37:58 +00:00
Saleem Abdulrasool e1ee32c1a7 Revert "clang: forward -no-integrated-as from the driver"
This seems to break a MIPS test.  Revert until I figure out the root cause.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201954 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-22 22:24:00 +00:00
Saleem Abdulrasool 5f6a23df29 clang: forward -no-integrated-as from the driver
Forward the -no-integrated-as option to -cc1 rather than simply invoking the
appropriate tool.  This is useful since this option has been overloaded to
permit disabling of parsing inline assembly at the MC layer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201952 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-22 21:50:09 +00:00
Joerg Sonnenberger 4590e1108f Default to ARMv5e for NetBSD/EABI, ARMv4 for APCS.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201894 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-21 21:53:33 +00:00
Oliver Stannard 1400d5b9da Add support for FPv4-SP to the clang driver
Added two new options for -mfpu when targetting ARM:
* fpv4-sp-d16
* fp4-sp-d16

The first is the same spelling as gcc.

The lack of a leading `v' is correct, this is consistent with ARM's
documentation and gcc's spelling of the option.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201846 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-21 10:39:15 +00:00
Alexey Samsonov 43ad7ade30 Get rid of obsolete addProfileRT(), generalize the relevant addProfileRTLinux() to all OS
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201789 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-20 13:57:37 +00:00
Joerg Sonnenberger 8fd4888fe2 Hook up NetBSD/sparc and NetBSD/sparc64 as and ld invocations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201730 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-19 22:40:18 +00:00
Joerg Sonnenberger 41da9695b1 GC now unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201728 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-19 22:17:01 +00:00
Joerg Sonnenberger 791ab30643 Use a switch for the architecture specific logic in
netbsd::Assemble::ConstructJob.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201725 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-19 22:16:19 +00:00
Reid Kleckner 0fcf59c5a5 clang-cl: Pass /Z7 when we fallback to cl with debug info enabled
Clang itself only emits CodeView line tables, so it seems more
consistent to ask cl.exe for the same format.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201721 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-19 22:05:59 +00:00
Joerg Sonnenberger eaed9a427e Refactor -KPIC handling for as invocation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201719 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-19 21:58:52 +00:00
Renato Golin f2e6535198 Add FreeBSD ARM EABI hard-float support
Patch by Andrew Turner.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201662 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-19 10:44:07 +00:00
Adrian Prantl c0e27313d2 Revert "Debug info: Make DWARF4 the default for Darwin, too."
I'm holding this change to give maintainers of Darwin buildbots more time
to update their toolchains.

This reverts commit r201375.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201520 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-17 17:40:52 +00:00
Evgeniy Stepanov a9352713ff Enable generation of unwind tables when building with sanitizers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201391 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-14 08:56:25 +00:00
Jiangning Liu 03f294995f Enable AArch64 NEON by default.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201384 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-14 04:37:46 +00:00
Eric Christopher 9330356642 Add a command line option -gdwarf-aranges that will turn on emitting
the dwarf .debug_aranges section.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201379 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-14 01:27:03 +00:00
Adrian Prantl 6df4eb9cf3 Debug info: Make DWARF4 the default for Darwin, too.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201375 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-14 00:29:33 +00:00
Robert Lytton 1beb994338 XCore target pass -v flag to assembler & linker
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201312 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-13 10:40:12 +00:00
Robert Lytton a7a73f747d add comment explaining previous commit
see 'XCore target -fexceptions flag handling'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201311 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-13 10:38:56 +00:00
Robert Lytton 80eb669f00 XCore target -fexceptions flag handling
XCore target has -fno-exception as the default option
Pass on "-fexceptions" flag to xcc (linker)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201310 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-13 10:34:44 +00:00
Renato Golin 0f242938ea Remove spurious default case to silent sanitizer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201309 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-13 10:26:33 +00:00
Renato Golin 98964dff1d Add EXPERIMENTAL --rtlib=compiler-rt to GNU Clang
This commit is not strictly correct nor accounts for all uses (shared
objects, for example), but it allows one to test the compiler-rt library
on GNU targets.

Using this patch to run the test-suite has already shown me problems
on ARM. Since this is a Darwin-only flag, nobody is using it, so it
shouldn't be a problem.

I will need extension to deal with the shared cases, but since we're
not compiling libclang_rt.so, that's not yet applicable. Many other
problems will have to be fixed first in compiler-rt (such as removing
the 'arch' name from it and making it trully multi-arch, moving it to
the default lib directory, make both .a and .so variants, etc).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201307 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-13 10:01:16 +00:00
Reid Kleckner dd6709eec1 MS ABI: Implement #pragma vtordisp() and clang-cl /vdN
These features are new in VS 2013 and are necessary in order to layout
std::ostream correctly.  Currently we have an ABI incompatibility when
self-hosting with the 2013 stdlib in our convertible_fwd_ostream wrapper
in gtest.

This change adds another implicit attribute, MSVtorDispAttr, because
implicit attributes are currently the best way to make sure the
information stays on class templates through instantiation.

Reviewers: majnemer

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201274 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-12 23:50:26 +00:00
Dmitri Gribenko 337c8c682f Add an option to allow Clang verify source files for a module only once during
the build

When Clang loads the module, it verifies the user source files that the module
was built from.  If any file was changed, the module is rebuilt.  There are two
problems with this:
1. correctness: we don't verify system files (there are too many of them, and
   stat'ing all of them would take a lot of time);
2. performance: the same module file is verified again and again during a
   single build.

This change allows the build system to optimize source file verification.  The
idea is based on the fact that while the project is being built, the source
files don't change.  This allows us to verify the module only once during a
single build session.  The build system passes a flag,
-fbuild-session-timestamp=, to inform Clang of the time when the build started.
The build system also requests to enable this feature by passing
-fmodules-validate-once-per-build-session.  If these flags are not passed, the
behavior is not changed.  When Clang verifies the module the first time, it
writes out a timestamp file.  Then, when Clang loads the module the second
time, it finds a timestamp file, so it can compare the verification timestamp
of the module with the time when the build started.  If the verification
timestamp is too old, the module is verified again, and the timestamp file is
updated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201224 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-12 10:33:14 +00:00
Amara Emerson a5c3f063db [ARM] Fix NEON wrongly being enabled with soft-float when targeting armv8/Cortex-A53/A57.
This was caused by r200708 which enabled the crypto feature for these cores.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201223 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-12 10:22:35 +00:00
Jonathan Roelofs ddccd4eca1 Add Multilib selection machinery
This patch improves the support for picking Multilibs from gcc installations.
It also provides a better approximation for the flags '-print-multi-directory'
and '-print-multi-lib'.

This reverts r201203 (i.e. re-applying r201202 with small fixes in
unittests/CMakeLists.txtto make the build bots happy).

review: http://llvm-reviews.chandlerc.com/D2538


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201205 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-12 03:21:20 +00:00
Jonathan Roelofs 56c7cf67c6 Revert 201202
Breaks cmake configure of new unit tests directory


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201203 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-12 01:36:51 +00:00
Jonathan Roelofs 1b6afd89e6 Add Multilib selection machinery
This patch improves the support for picking Multilibs from gcc installations.
It also provides a better approximation for the flags '-print-multi-directory'
and '-print-multi-lib'.

review: http://llvm-reviews.chandlerc.com/D2538


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201202 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-12 01:29:25 +00:00
David Majnemer 69d6b398b6 MS ABI: Add support for the -vm{b,g,s,m,v} flags
These flags control the inheritance model initially used by the
translation unit.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201175 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-11 21:05:00 +00:00
Robert Lytton 330676481e XCore target: Pass through "-fverbose-asm" flag to xcc assembler.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201141 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-11 10:34:45 +00:00
Josh Magee 3ab3daec81 [stackprotector] Add command line option -fstack-protector-strong
This option has the following effects:
 * It adds the sspstrong IR attribute to each function within the CU.
 * It defines the macro __SSP_STRONG__ with the value of 2.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201120 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-11 01:35:14 +00:00
Argyrios Kyrtzidis 229253a443 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200964 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-07 08:33:28 +00:00
Joerg Sonnenberger 8bc7719d6b Use correct ld emulation for EABI hardware float triple on NetBSD.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200946 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-06 21:04:32 +00:00
Ben Langmuir 847330dafd Move -verify-pch to use VerifyJobAction
Use the verify hook rather than the compile hook to represent the
-verify-pch action, and move the exising --verify-debug-info action
into its own subclass of VerifyJobAction.  Incidentally change the name
printed by -ccc-print-phases for --verify-debug-info.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200938 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-06 18:53:25 +00:00
Ben Langmuir e9e34e28c5 Add a CC1 option -verify-pch
This option will:
- load the given pch file
- verify it is not out of date by stat'ing dependencies, and
- return 0 on success and non-zero on error

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200884 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-05 22:21:15 +00:00
Evgeniy Stepanov d60b3cecb4 Fix handling of -fno-function-sections, -fno-data-sections in clang driver.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200685 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-03 11:11:37 +00:00
Joerg Sonnenberger bb8ec69f1c Handle O32/N64 ABIs for NetBSD/MIPS64. From Matt Thomas.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200668 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-02 22:59:16 +00:00
Joerg Sonnenberger a5b33da343 Use a switch for the emulation handling.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200666 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-02 22:50:34 +00:00
Joerg Sonnenberger 2b063246ac Handle compat support for EABI/old APCS compatibility on NetBSD/ARM.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200665 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-02 22:47:37 +00:00
Joerg Sonnenberger 55d60b69b5 Replace hasMipsN32ABIArg by hasMipsABIArg to make it easier to add
support for o32 and n64.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200662 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-02 22:40:33 +00:00
Joerg Sonnenberger 4cb2dd7403 Pass down -mcpu for external assembler in thumb mode, too. From Matt Thomas.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200661 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-02 22:37:14 +00:00
Joerg Sonnenberger ae1b7c222c Minor formatting improvement.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200659 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-02 22:36:13 +00:00
Evgeniy Stepanov 930a25a7be Revert r200555, r200545.
These changes make it impossible to use ARM EHABI for stack unwinding without
enabling exceptions and break AddressSanitizer on ARM.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200627 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-02 10:39:45 +00:00
Renato Golin 5595d21466 Last option on -fexception for arm-disable-ehabi
Previous commit would have a following flag overriding the behaviour
and not taken care of.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200555 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-31 16:19:26 +00:00
Renato Golin 49d840629a Connect -fno-exceptions to -arm-disable-ehabi
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200545 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-31 14:13:20 +00:00
Renato Golin 9b80314d79 ARM RT libs with generic name
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200538 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-31 11:47:28 +00:00
Alexey Bataev 011b53f9b5 Make x86 Android default target CPUs compatible with GCC (http://llvm-reviews.chandlerc.com/D2655)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200510 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-31 04:07:13 +00:00
Alexey Bataev 03d5952c3c Turn on PIC by default on Android (http://llvm-reviews.chandlerc.com/D2603)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200290 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-28 06:30:35 +00:00
David Blaikie 19771c74b5 Driver: support -fno-debug-types-section to override -fdebug-types-section
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200236 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-27 18:52:43 +00:00
Simon Atanasyan ad62472289 [Mips] Change default CPU for MIPS 32/64 targets. Now they are mips32r2/mips64r2 respectively.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200222 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-27 13:59:04 +00:00
Amara Emerson fecf5dcc4e [AArch64] Add -mgeneral_regs_only option.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199904 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-23 15:48:30 +00:00
Tim Northover efa0a98d0d MachO embedded: default to soft float without issuing warning
This is a simpler rule, broadly in line with previous Darwin (which chose
between "soft" and "softfp") but probably safer. In practice the only real
reason for "softfp" is ABI compatibility, not usually an issue on limited chips
like these, so anyone who wanted hard-float should already be saying so.

That's my story and I'm sticking to it.

rdar://problem/15887493

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199896 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-23 15:00:01 +00:00
Alexey Bataev 5da286428f Improve x86 android support, add x86_64 android target
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199875 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-23 09:08:32 +00:00
David Blaikie 63f99c4317 Driver: Suppression support for -Wa,--compress-debug-sections
(to go with existing suppression of -Wa,-compress-debug-sections)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199822 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-22 19:22:21 +00:00
Fariborz Jahanian 015f92d365 ObjectiveC driver. reinstate -fno-objc-legacy-dispatch behavior
when the deployment target is 10.5. // rdar://15852259


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199682 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-20 19:32:33 +00:00
David Blaikie 3bd957c7bd Driver support for -fdebug-types-sections
Using backend-option like a few other debug codegen flags. I believe
Eric Christopher's working at porting those over to something nicer
such as an API level CodeGenOptions or the like, so this can be
improved along with that work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199535 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-18 02:02:06 +00:00
Joerg Sonnenberger c511df6336 Use switch statements in preparation for adding more architectures.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199529 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-18 00:50:49 +00:00
David Blaikie 64037a9c6b Driver: Stub -Wa,-compress-debug-sections support for integrated-as with a suppressable warning
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199454 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-17 03:17:40 +00:00
Tim Northover 6bd37ee37a MachO: use *-*-*-macho for MachO embedded targets.
Previously we had bodged together some hacks mapping MachO embedded
targets (i.e. mainly ARM v6M and v7M) to the "*-*-darwin-eabi" triple.
This is incorrect in both details (they don't run Darwin and they're
not EABI in any real sense).

This commit appropriates the existing "MachO" environment for the
purpose instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199367 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-16 08:48:16 +00:00
Bob Wilson f8c5e995cf Remove support for armv7f slice. <rdar://problem/12478440>
This was never used for anything so we should just get rid of it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199336 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-15 21:43:40 +00:00
Hans Wennborg 11b1b8ab36 Remove the -cxx-abi command-line flag.
This makes the C++ ABI depend entirely on the target: MS ABI for -win32 triples,
Itanium otherwise. It's no longer possible to do weird combinations.

To be able to run a test with a specific ABI without constraining it to a
specific triple, new substitutions are added to lit: %itanium_abi_triple and
%ms_abi_triple can be used to get the current target triple adjusted to the
desired ABI. For example, if the test suite is running with the i686-pc-win32
target, %itanium_abi_triple will expand to i686-pc-mingw32.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199250 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-14 19:35:09 +00:00
Bob Wilson dc25150d90 Remove a temporary workaround that is no longer relevant.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199176 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-14 01:56:31 +00:00
Hans Wennborg b44435d22f clang-cl: Ignore /fallback when not actually compiling (PR18456)
For example, don't fall back in /P (preprocess) mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199153 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-13 22:24:42 +00:00
Jakob Stoklund Olesen 23039ad811 MIPS and SPARC assemblers both take the -KPIC flag.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199034 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-12 04:53:36 +00:00
Jakob Stoklund Olesen b5ba2e8d1a Select the UltraSPARC instruction set when invoking the assembler.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199012 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-11 18:25:01 +00:00
Jakob Stoklund Olesen 609e20d0de Use the right dynamic linker for SPARC Linux executables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198923 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-10 08:18:34 +00:00
Jakob Stoklund Olesen fa6b968902 Give the linker the right ELF type for SPARC targets.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198912 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-10 03:51:33 +00:00
Jakob Stoklund Olesen d8d1a19750 Pass -32/-64 to the assembler when building for sparc/sparc64.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198911 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-10 03:51:29 +00:00
Chandler Carruth 4b9be6e25f Sort all the #include lines with LLVM's utils/sort_includes.py which
encodes the canonical rules for LLVM's style. I noticed this had drifted
quite a bit when cleaning up LLVM, so wanted to clean up Clang as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198686 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-07 11:51:46 +00:00
Adrian Prantl c447571050 Implement a new -fstandalone-debug option. rdar://problem/15685848
It controls everything that -flimit-debug-info used to, plus the
vtable type optimization. The old -fno-limit-debug-info option is now an
alias to -fstandalone-debug and vice versa.

Standalone is the default on Darwin until dtrace is updated to work with
non-standalone debug info (rdar://problem/15758808).

Note: I kept the LimitedDebugInfo name in CodeGenOptions::DebugInfoKind
because NoStandaloneDebugInfo sounded even more confusing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198655 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-07 01:19:08 +00:00
Justin Bogner f4c386bdd1 Driver: Accept -fprofile-instr-use and -fprofile-instr-generate
These flags will be used for instrumentation based PGO.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198639 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-06 22:27:36 +00:00
Roman Divacky ed930358cc Remove a tab that snuck in.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198312 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-02 15:34:59 +00:00
Roman Divacky b073bdfb5f In the FreeBSD assembler driver, inform the sparc assembler that we're producing
PIC code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198311 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-02 15:13:18 +00:00
Richard Barton ffbfc0782f LIBRARY_PATH environment variable should only be supported on a native compiler.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197490 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-17 11:11:25 +00:00
Joerg Sonnenberger e13e3bbf3d Support EABIHF environment on ARM.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197406 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-16 19:16:04 +00:00
Rafael Espindola c22be5d6ab Avoid temporary std::string.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197160 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 15:48:19 +00:00
Rafael Espindola 9797354641 Don't return a pointer to a temporary std::string's c_str.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197157 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 15:39:05 +00:00
Bernard Ogden bc5e63bc22 Simple refactoring to eliminate single-use local variable
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197154 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 13:27:15 +00:00
Bernard Ogden 5316b7514b Refactor duplicate functions
getARMCPU and getLLVMArchSuffixForARM existed as very similar functions
in both ToolChain.cpp and Tools.cpp. Create a single implementation of
each in Tools.cpp, eliminate the duplicate and share via Tools.h.

Creates an 'arm' namespace in Tools.h to be used by any ARM-targetting tools.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197153 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 13:27:11 +00:00
Bernard Ogden 8e7d2ed124 Fix -mthumb resetting of target cpu
Passing -mthumb with no explicit CPU on the command line
resulted in target CPU changing from the architecture
default to arm7tdmi. Now it does not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197151 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 13:26:59 +00:00
Tim Northover 7b4615075c Darwin-embedded: find correct libclang_rt for embedded targets.
This refactors some of the Darwin toolchain classification to give a more solid
distinction between the three primary Darwin platforms (OS X, IOS and IOS
simulator) so that a 4th choice can be added temporarily: embedded MachO
targets.

Longer term, this support will be factored out into a separate class and no
longer classified as "darwin-eabi", but the refactoring should still be useful.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197148 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 11:55:52 +00:00
Argyrios Kyrtzidis 56b610e36e [objcmt] Transfer '-objcmt-migrate-designated-init' from the driver to cc1 invocation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196993 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-11 01:29:48 +00:00
David Fang 77225ac38c style fix
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196982 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-10 23:13:11 +00:00
David Fang 601f9c5a27 darwin asm driver: suppress -Q for -no-integrated-as on darwin<11
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196981 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-10 22:51:25 +00:00
Argyrios Kyrtzidis a95d27b4ec [Driver] Rename '-objcmt-white-list-dir-path' option to '-objcmt-whitelist-dir-path' and add an alias for now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196944 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-10 18:36:53 +00:00
Joerg Sonnenberger fb29d25012 Extend assembler handling for NetBSD/MIPS to pass down the correct ABI,
architecture and PIC flag.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196720 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-08 13:54:58 +00:00
Joerg Sonnenberger f2ed95c1da Pass correct flags to assembler and linker for OpenBSD on AMD64, PowerPC
and MIPS64. From Brad Smith.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196630 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-07 00:57:46 +00:00
Ana Pazos 69a9e166e0 Added support for mcpu krait
- krait processor currently modeled with the same features as A9.
- Krait processor additionally has VFP4 (fused multiply add/sub)
and hardware division features enabled.
- krait has currently the same Schedule model as A9
- krait cpu flag is not recognized by the GNU assembler yet,
it is replaced with march=armv7-a to avoid a lower march
from being used.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196618 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-06 22:43:17 +00:00
Joerg Sonnenberger c688322f98 For NetBSD, use arm1176jzf-s as default CPU for ARMv6.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196538 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 21:27:58 +00:00
Joerg Sonnenberger 2e47624c3f Pass down the target CPU to the system assembler for NetBSD/ARM.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196532 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 21:07:29 +00:00
Bob Wilson 6da1f17bea Fix assertion failure left over from changes to move away from "darwin" triples.
I happened to notice this while trying to write a test for an iOS simulator
target. I suspect we just missed this when we added separate "macosx" and "ios"
triples instead of the generic "darwin" OS.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196527 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 19:38:42 +00:00
Alp Toker 0fb7888788 Fix a tranche of comment, test and doc typos
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196510 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 16:25:25 +00:00
Alp Toker cabb9869ae Driver: Factor gold support out into a function
AddGoldPlugin() is the same on gnutools and freebsd so avoid the
copy-and-paste duplicate code.

No change in functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196096 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-02 12:43:03 +00:00
Simon Atanasyan 42aef45c2b [Mips] Pass -mmsa option to the assembler.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195756 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-26 11:58:04 +00:00
Simon Atanasyan 557a847ea8 [Mips] Replace explicit argument handling by the single ArgList::AddLastArg() call.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195755 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-26 11:57:58 +00:00
Rafael Espindola e57f1b192a remove gcc::Precompile
Clang still has support for running gcc for performing various stages
of a build. Right now it looks like this is used for

* Supporting Fortran in the clang driver
* Running an assembler or linker in systems we don't yet know how to
run them directly.

It looks like the gcc::Precompile is a vestige from the days when we
supported using clang for C and running gcc for c++. This patch removes it
(yes, we have no tests for it).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195586 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-24 23:40:06 +00:00
Rafael Espindola 32982662b4 Don't use the gcc driver for assembling.
Clang knows how to use the gnu assembler directly from doing so on linux and
hurd. The existing support worked out of the box on cygwin and mingw and I was
able to bootstrap clang with it in both systems (with pending patches for the
new mingw abi, but that is independent of the assembler).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195554 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-23 16:40:57 +00:00
Rafael Espindola a454961c66 Don't pass +soft-float, +soft-float-abi to the arm assembler.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195551 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-23 14:36:40 +00:00
Artyom Skrobov ddc8047cd5 [ARM] add basic support for Cortex-A7 and VFPv4 to Clang
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195359 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-21 14:04:38 +00:00
Manman Ren 6086ec9dec Set default Dwarf Version for -gline-tables-only on Darwin to 2.
We are still using Dwarf Version 2 for Darwin systems, make it consistent
with -gline-tables-only.

This should fix an internal buildbot.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195267 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-20 20:22:14 +00:00
Simon Atanasyan 2deec9715b [Mips] Take in account the -mfp64 command line option when build paths
to the crt*.o files, libraries and headers for the MIPS FSFS toolchain.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195249 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-20 13:53:20 +00:00
Simon Atanasyan c591025a25 [Mips] Do not adjust float-abi flags in case of MIPS16 mode. This code
should be isolated in the backend (r195123). From the frontend point
of view in case of "-mhard-float -mips16" combination of flags the float
ABI mode should remain unchanged.

The patch reviewed by Reed Kotler.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195124 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-19 12:22:38 +00:00
Kevin Enderby 6efcf6f97a Change the clang driver with the use of -no-integrated-as for darwin to use
the -Q flag to the as(1) assembler driver.

We will soon be switching the darwin as(1) assembler driver to call clang(1)
and use the intergated assembler by default.  To do this and still support
clang(1)'s -no-integrated-as flag, when clang(1) runs the as(1) assembler
driver and -no-integrated-as is used it needs to pass the -Q flag to as(1)
so it uses its GNU based assembler, and not turn around and call clag(1)'s
integrated assembler. 

rdar://15495921


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195054 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-18 23:30:29 +00:00
Rafael Espindola 07ac846d50 Remove method that always returns true.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194984 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17 22:42:24 +00:00
Hal Finkel ce5b5f13a6 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194967 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17 16:03:29 +00:00
Jim Grosbach 32ca73e33f X86: Make specifying avx2 simpler on Darwin with '-arch'
Teach the '-arch' command line option to enable the compiler-friendly
features of core-avx2 CPUs on Darwin. Pass the information along in the
target triple like Darwin+ARM does.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194907 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-16 00:53:35 +00:00
Alp Toker e22017e0b6 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194845 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15 20:40:58 +00:00
Sylvestre Ledru eb4d7c3fce 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194817 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15 15:39:14 +00:00
David Peixotto 2317f7b702 Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194744 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-14 22:58:17 +00:00
David Peixotto 4ca9eaebfb Pass -Wa,-I and -Xassembler -I args to integrated assembler
This patch adds -I to the arguments that are passed to the
integrated assembler from -Wa, and -Xassembler args.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194743 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-14 22:52:58 +00:00
Argyrios Kyrtzidis 2c050f6a68 [objcmt] Introduce "objcmt-white-list-dir-path=" option.
This options accepts a path to a directory, collects the filenames of the files
it contains, and the migrator will only modify files with the same filename.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194710 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-14 16:33:29 +00:00
Argyrios Kyrtzidis 17c384c741 [objcmt] Transfer the objcmt flags from the driver to cc1 invocation and
instantiate ObjCMigrateASTConsumer with the specific options that were enabled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194628 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-13 23:38:20 +00:00
Weiming Zhao 7792fde854 Adds ARM backend options: -mrestrict-it and -mno-restrict-it
To support the generation of IT block in Thumbv7 way or
Thumbv8 way


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194593 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-13 18:31:23 +00:00
Diego Novillo b85a9ec6df 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194567 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-13 12:22:39 +00:00
Fariborz Jahanian 08d86e9c4b ObjectiveC. availability of Array/Dictionary subscripting
is further restricted in legacy runtime to deployment target
of 10.7 and later. // rdar://15363492


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194507 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-12 20:50:26 +00:00
Fariborz Jahanian 5d5058c08e ObjectiveC driver change. re-apply patch reverted in
r194450 with a modified test. // rdar://15363492


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194489 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-12 17:08:46 +00:00
Robert Lytton 0e325bef80 XCore target has -fno-use-cxa-atexit as default.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194460 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-12 10:09:22 +00:00
Rafael Espindola 669496ba9f This reverts commit r194435 and r194434.
Trying to get the bots green.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194450 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-12 04:33:56 +00:00
Fariborz Jahanian 3e627f76c7 ObjectiveC. By default allow array/dictionary subscripting in
ObjectiveC legacy runtime too. // rdar://15363492


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194434 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-11 23:44:52 +00:00
Sylvestre Ledru 849f3ecece Revert "Using an invalid -O falls back on -O3 instead of an error"
This reverts commit r194403.

Was breaking too many tests...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194420 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-11 20:51:44 +00:00
Sylvestre Ledru 1cd76b1a44 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194403 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-11 19:01:05 +00:00
Roman Divacky db33419ecf Add gold plugin support to the FreeBSD link driver.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194350 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-10 09:31:43 +00:00
Rafael Espindola bd3952758c This reverts commit r194330, r194329 and r194328.
The test was still failing on OS X and mingw.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194334 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-09 20:07:19 +00:00
David Chisnall a799d7db95 Add support for -fuse-ld=.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194328 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-09 14:16:52 +00:00
Richard Smith 195dd7c844 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!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194161 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-06 19:31:51 +00:00
Rafael Espindola 1d5cce4f28 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194097 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-05 21:43:54 +00:00
Rafael Espindola f632a0c29d clang-format this if.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193997 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-04 17:13:51 +00:00
Peter Collingbourne c6911a2b1f 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193875 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-01 18:16:25 +00:00
Amara Emerson 3bb1b5c953 [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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193740 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-31 09:32:33 +00:00
Evgeniy Stepanov 6d0943fc2d Add -lm to sanitizer link arguments.
We'll need to intercept a few function in libm.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193644 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-29 19:48:47 +00:00
Bernard Ogden 909f35a884 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193600 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-29 09:47:51 +00:00
Bernard Ogden f779e65390 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193367 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-24 18:32:51 +00:00
Bernard Ogden 80e90c2631 Set appropriate FPU default for Linux on v8
Change-Id: If9b649c92e7196e3e791948545dc80901a0761eb

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193365 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-24 18:32:41 +00:00
Bernard Ogden c427249cb7 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193364 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-24 18:32:36 +00:00
Benjamin Kramer 39e4b0fb30 Driver: Various string-related cleanups.
Also fixes some funky formatting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193079 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-21 12:33:55 +00:00
Silviu Baranga 1db2e27911 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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193074 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-21 10:54:53 +00:00
Daniel Jasper 9541141f4f Expose -fmodule-name and -fmodule-map-file as driver options.
Review: http://llvm-reviews.chandlerc.com/D1974

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193069 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-21 06:34:34 +00:00
Peter Collingbourne bf54855ac4 Revert r193022 and r193048. They broke the ubsan test suite.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193057 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-20 21:29:13 +00:00
Benjamin Kramer acca8bcbe7 Driver: libubsan_cxx depends on libubsan. Preserve the topological ordering, some linkers depend on it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193048 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-20 12:34:18 +00:00
Nick Lewycky 63d29e2452 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193022 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-19 00:27:23 +00:00
Daniel Sanders af7ed9e890 [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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192899 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-17 14:55:58 +00:00
Eric Christopher d5e59fc9df Rework ppc options handling into a features group.
This should have no functional behavior.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192838 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-16 20:40:08 +00:00
Benjamin Kramer 5322a55691 Driver: Factor duplicated code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192817 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-16 17:42:39 +00:00
Akira Hatanaka 9e6af9ddd5 [mips] Enable frame-pointer elimination for -O1 and above.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192815 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-16 17:13:08 +00:00
Fariborz Jahanian a6f5cc368b ObjectiveC driver. Scrap -fno-objc-legacy-dispatch for NeXT
runtime. It will be silently ignored and regardless
of deployment target. // rdar://14803286


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192719 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-15 17:16:30 +00:00
Joerg Sonnenberger e69cca4850 For NetBSD/current on X86 do not use libgcc and default to libc++.
Adjust linkage to make more sense for older releases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192615 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-14 20:13:05 +00:00
Manman Ren 96d6c45965 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192497 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-11 20:48:38 +00:00
Robert Lytton 4e490e271c XCore target: add an xcore toolchain implementation
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192437 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-11 10:29:40 +00:00
Nick Lewycky d4705688fe Fix typo in comment. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192412 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-11 03:33:53 +00:00
Simon Atanasyan 66751bc99c [Mips] Do not check for options from the OPT_mips_CPUs_Group. All these
options are aliases now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192290 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-09 12:12:24 +00:00
Simon Atanasyan c0e83640ae Revert r191947. The problem is not MIPS-specific and requires more
general solution.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191951 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-04 11:46:54 +00:00
Simon Atanasyan bd55e97f44 [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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191947 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-04 10:36:42 +00:00
Tim Northover fc1a75b77c ARM: *-*-darwin-eabi triples should use AAPCS.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191900 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-03 14:23:28 +00:00
Amara Emerson fe7ed04204 [ARM] Add -mfpu=none option to the driver.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191736 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-01 10:20:54 +00:00
Richard Smith 1596e5b368 Revert r191586 and r191695. They cause crashes when building with
-relaxed-aliasing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191725 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-01 02:20:23 +00:00
Manman Ren 03928403af Turn struct-path aware TBAA on by default.
Use -no-struct-path-tbaa to turn it off.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191695 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-30 19:35:19 +00:00
Daniel Jasper 097595a5ee Fix misspelling of -fmodules-decluse.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191640 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-29 12:40:54 +00:00
Rafael Espindola 14f9889b9b 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191551 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-27 20:21:48 +00:00
Hans Wennborg 4fe475a1a1 clang-cl: pass /FI options to fallback
We started parsing /FI in r191442, and now we can pass it on to the
fallback too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191537 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-27 17:54:18 +00:00
Rafael Espindola dea69a1149 Remove method that always returns true.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191533 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-27 16:58:26 +00:00
Hans Wennborg a8ffc16dc1 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191323 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 18:17:21 +00:00
Hans Wennborg 1413d62995 clang-cl: pass /nologo when falling back to cl.exe
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191316 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 17:36:21 +00:00
Daniel Jasper ddd2dfc1d3 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191283 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 09:14:14 +00:00
Simon Atanasyan fc12c4aa20 [Mips] Support -mnan=2008 option. Define "__mips_nan2008" macros and pass
this option to the assembler.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191282 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 09:09:16 +00:00
Rafael Espindola c3c66879c3 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191251 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 00:10:56 +00:00
Hans Wennborg 89e3274512 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191250 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 00:08:55 +00:00
Hans Wennborg dc40bf9ed0 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191099 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-20 18:16:35 +00:00