summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Eliminate "enumeration value not handled in switch" warningsDouglas Katzman2015-06-231-0/+2
| | | | | | (Caused by r240370) llvm-svn: 240376
* Change some if/else chains to 'switch' statements. NFCDouglas Katzman2015-06-231-24/+46
| | | | | | Differential Revision: http://reviews.llvm.org/D10612 llvm-svn: 240370
* Add comment about the importance of being adjacent. NFCDouglas Katzman2015-06-221-0/+3
| | | | llvm-svn: 240328
* [Sanitizers] Provide better diagnostic for sanitizers unsupported for target ↵Alexey Samsonov2015-06-191-20/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | triple. Introduce ToolChain::getSupportedSanitizers() that would return the set of sanitizers available on given toolchain. By default, these are sanitizers which don't necessarily require runtime support and are not toolchain- or architecture-dependent. Sanitizers (ASan, DFSan, TSan, MSan etc.) which cannot function without runtime library are marked as supported only on platforms for which we actually build these runtimes. This would allow more fine-grained checks in the future: for instance, we have to restrict availability of -fsanitize=vptr to Mac OS 10.9+ (PR23539). Update test cases accrodingly: add tests for certain unsupported configurations, remove test cases for -fsanitize=vptr + PS4 integration, as we don't build the runtime for PS4 at the moment. This change was first submitted as r239953 and reverted in r239958. The problem was and still is in Darwin toolchains, which get the knowledge about target platform too late after initializaition, while now we require this information when ToolChain::getSanitizerArgs() is called. r240170 works around this issue. llvm-svn: 240179
* Add nominal support for 'shave' target.Douglas Katzman2015-06-191-0/+43
| | | | | | | | | | | | | | This change passes through C and assembler jobs to Movidius tools by constructing commands which are the same as ones produces by the examples in the SDK. But rather than reference MV_TOOLS_DIR to find tools, we will assume that binaries are installed wherever the Driver would find its native tools. Similarly, this change assumes that -I options will "just work" based on where SDK headers get installed, rather than baking into the Driver some magic paths. Differential Revision: http://reviews.llvm.org/D10440 llvm-svn: 240134
* [Driver] Compute MacOS/iOS version from triple if/when we actually need it. NFC.Alexey Samsonov2015-06-181-24/+19
| | | | llvm-svn: 240065
* [Driver] Remove unused class member. NFC.Alexey Samsonov2015-06-181-6/+0
| | | | llvm-svn: 239981
* [Driver] Simplify code choosing between MacOS and iOS platforms. NFC.Alexey Samsonov2015-06-181-12/+10
| | | | llvm-svn: 239980
* Revert "[Sanitizers] Provide better diagnostic for sanitizers unsupported ↵Alexey Samsonov2015-06-171-55/+20
| | | | | | | | | for target triple." This reverts commit r239953, while I'm investigating assertion failure from http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_check/9994/ llvm-svn: 239958
* [Sanitizers] Provide better diagnostic for sanitizers unsupported for target ↵Alexey Samsonov2015-06-171-20/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | triple. Summary: Introduce ToolChain::getSupportedSanitizers() that would return the set of sanitizers available on given toolchain. By default, these are sanitizers which don't necessarily require runtime support (i.e. set from -fsanitize=undefined-trap). Sanitizers (ASan, DFSan, TSan, MSan etc.) which cannot function without runtime library are marked as supported only on platforms for which we actually build these runtimes. This would allow more fine-grained checks in the future: for instance, we have to restrict availability of -fsanitize=vptr to Mac OS 10.9+ (PR23539) Update test cases accrodingly: add tests for certain unsupported configurations, remove test cases for -fsanitize=vptr + PS4 integration, as we don't build the runtime for PS4 at the moment. Test Plan: regression test suite Reviewers: pcc Subscribers: cfe-commits, filcab, eugenis, thakis, kubabrecka, emaste, rsmith Differential Revision: http://reviews.llvm.org/D10467 llvm-svn: 239953
* Remove duplicated alteration to getProgramPaths().Douglas Katzman2015-06-161-4/+0
| | | | | | | | This appears to have been accidental. Differential Revision: http://reviews.llvm.org/D10444 llvm-svn: 239844
* [bpf] add support for BPF backendAlexei Starovoitov2015-06-101-0/+2
| | | | | | add support for bpfel/bpfeb targets llvm-svn: 239496
* range-for'ify Args->filtered_begin(...) loopsSean Silva2015-06-091-8/+3
| | | | | | | We already have Args->filtered(...) which is a drop-in range-for replacement. llvm-svn: 239381
* [SPARC] Add multiarch include paths.James Y Knight2015-06-051-0/+10
| | | | | | | | | | | Adds tests verifying the proper dirs are found in the Debian 8/GCC4.9 layout for sparc (32bit), sparc (32bit) with lib64 multilib, and sparc64. The test cases added here also cover r239047, which fixed the linker paths. llvm-svn: 239154
* [SPARC] Fix multiarch path detection for sparc and sparcv9.James Y Knight2015-06-041-0/+8
| | | | llvm-svn: 239047
* Remove extraneous qualifiers due to "using namespace". NFCDouglas Katzman2015-06-041-9/+9
| | | | llvm-svn: 239038
* Change big 'if' statement into a switch. NFCDouglas Katzman2015-06-031-15/+20
| | | | | | Differential Revision: http://reviews.llvm.org/D10223 llvm-svn: 238955
* [ARMTargetParser] FIXME MachO arch names. NFCRenato Golin2015-05-281-21/+26
| | | | llvm-svn: 238435
* Factor out SmallDataThresholdIkhlas Ajbar2015-05-141-0/+24
| | | | | | This patch factors out SmallDataThreshold code. llvm-svn: 237364
* Driver: Fix a -Wshadow issue from r237091Justin Bogner2015-05-121-1/+1
| | | | | | | | | | The MachO toolchain has an isTargetIOSBased method, but it isn't virtual so it isn't very meaningful to call it. After thinking about this, I guess that putting this logic in the MachO class is a bit of a layering violation anyway. Do this more like how we handle AddLinkRuntimeLibArgs instead. llvm-svn: 237095
* Re-apply "Driver: Make profiling flags work with -nostdlib on Darwin"Justin Bogner2015-05-121-14/+20
| | | | | | | | This time without a stray "true" in an argument list. This reverts r237077, restoring r237074. llvm-svn: 237091
* Revert "Driver: Make profiling flags work with -nostdlib on Darwin"Justin Bogner2015-05-121-20/+14
| | | | | | This revert r237074. These tests are failing all over the place. llvm-svn: 237077
* Driver: Make profiling flags work with -nostdlib on DarwinJustin Bogner2015-05-121-14/+20
| | | | | | | | | | | | | Compiler-rt's Profiling library isn't part of the stdlib, so -nostdlib shouldn't prevent it from being linked. This makes Darwin behave like other toolchains, and link in the profile runtime irrespective of -nostdlib, since the resulting program can't be run unless you link this. I've also added a test to show that other toolchains already behave like this. llvm-svn: 237074
* [Sparc] Add support for 'sparcel' to clang.Douglas Katzman2015-05-111-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D8784 llvm-svn: 237001
* Using ARMTargetParser in ClangRenato Golin2015-05-081-0/+2
| | | | | | | | | | | | | | | | This is a starting point for using the TargetParser in Clang, in a simple enough part of the code that can be used without disrupting the crazy platform support that we need to be compatible with other toolchains. Also adding a few FIXME on obvious places that need replacing, but those cases will indeed break a few of the platform assumptions, as arch/cpu names change multiple times in the driver. Finally, I'm changing the "neon-vfpv3" behaviour to match standard NEON, since -mfpu=neon implies vfpv3 by default in both Clang and LLVM. That option string is still supported as an alias to "neon". llvm-svn: 236901
* Revert "Allow case-insensitive values for -mcpu for ARM and AArch64"Renato Golin2015-05-081-1/+1
| | | | | | | This reverts commit r236859, as it broke multiple builds. I'll investigate and reapply when safe. llvm-svn: 236869
* Allow case-insensitive values for -mcpu for ARM and AArch64Renato Golin2015-05-081-1/+1
| | | | | | | | | GCC allows case-insensitive values for -mcpu, -march and -mtune options. This patch implements the same behaviour for the -mcpu option. Patch by Gabor Ballabas. llvm-svn: 236859
* InstrProf: Support for setting profile output from command lineJustin Bogner2015-04-301-0/+1
| | | | | | | | | | | | | | | | This change is the third of 3 patches to add support for specifying the profile output from the command line via -fprofile-instr-generate=<path>, where the specified output path/file will be overridden by the LLVM_PROFILE_FILE environment variable. This patch adds the necessary support to the clang frontend, and adds a new test. The compiler-rt and llvm parts are r236055 and r236288, respectively. Patch by Teresa Johnson. Thanks! llvm-svn: 236289
* [ASan] Don't link against libc++abi when not using libc++Hans Wennborg2015-04-091-3/+6
| | | | | | | This is a follow-up to r233860 which added -lc++abi when using ASan on Mac, and broke Chromium's ASan build which doesn't use libc++. llvm-svn: 234521
* [ARM] add support for Cortex-R4/R4FJaved Absar2015-04-091-1/+1
| | | | | | | | Adds ARM Cortex-R4 and R4F support and tests in Clang. Though Cortex-R4 support was present, the support for hwdiv in thumb-mode was not defined or tested properly. This has also been added. llvm-svn: 234488
* Update our list of distros a bit.Benjamin Kramer2015-04-061-6/+15
| | | | | | | | - Debian jessie will be released this month, add the next testing version to the list. - RHEL7 was released last june. - Ubuntu utopic was released last october, vivid will follow later this month. llvm-svn: 234149
* [UBSan] Embed UBSan into ASan runtime (Clang part).Alexey Samsonov2015-04-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Change the way we use ASan and UBSan together. Instead of keeping two separate runtimes (libclang_rt.asan and libclang_rt.ubsan), embed UBSan into ASan and get rid of libclang_rt.ubsan. If UBSan is not supported on a platform, all UBSan sources are just compiled into dummy empty object files. UBSan initialization code (e.g. flag parsing) is directly called from ASan initialization, so we are able to enforce correct initialization order. This mirrors the approach we already use for ASan+LSan. This change doesn't modify the way we use standalone UBSan. Test Plan: regression test suite Reviewers: kubabrecka, zaks.anna, kcc, rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8645 llvm-svn: 233860
* Add driver support for Native Client SDKDerek Schuff2015-03-301-1/+155
| | | | | | | | | | | | | | Add Tool and ToolChain support for clang to target the NaCl OS using the NaCl SDK for x86-32, x86-64 and ARM. Includes nacltools::Assemble and Link which are derived from gnutools. They are similar to Linux but different enought that they warrant their own class. Also includes a NaCl_TC in ToolChains derived from Generic_ELF with library and include paths suitable for an SDK and independent of the system tools. Differential Revision: http://reviews.llvm.org/D8590 llvm-svn: 233594
* Let Clang invoke CloudABI's linker.Ed Schouten2015-03-261-0/+30
| | | | | | | | | | | | | | | | | | | | | | Now that CloudABI's target information and header search logic for Clang has been submitted, the only thing that remains to be done is adding support for CloudABI's linker. CloudABI uses Binutils ld, although there is some work to use lld instead. This means that this code is largely based on what we use on FreeBSD. There are some exceptions, however: - Only static linking is performed. CloudABI does not support any dynamically linked executables. - CloudABI uses compiler-rt, libc++ and libc++abi unconditionally. Link in these libraries instead of using libgcc_s, libstdc++, etc. - We must ensure that the .eh_frame_hdr is present to make C++ exceptions work properly. Differential Revision: http://reviews.llvm.org/D8250 llvm-svn: 233269
* [UBSan] Use shared library for UBSan on OS X (Clang part).Alexey Samsonov2015-03-231-34/+29
| | | | | | | | | | | | | | | | | | Summary: UBSan is now used in the same way as ASan, and is supported on OSX and on iOS simulator. At the moment ASan and UBSan can't be used together due to PR21112, but I hope to resolve it soon by embedding UBSan into ASan. Test Plan: regression test suite. Reviewers: zaks.anna, kubabrecka Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8471 llvm-svn: 233035
* [multilib] Turn virtual functor into functin_refBenjamin Kramer2015-03-221-5/+6
| | | | | | And update code to use lambdas where possible, plus random cleanup. NFCI. llvm-svn: 232916
* Remove many superfluous SmallString::str() calls.Yaron Keren2015-03-181-10/+10
| | | | | | | | | | | | | | | Now that SmallString is a first-class citizen, most SmallString::str() calls are not required. This patch removes a whole bunch of them, yet there are lots more. There are two use cases where str() is really needed: 1) To use one of StringRef member functions which is not available in SmallString. 2) To convert to std::string, as StringRef implicitly converts while SmallString do not. We may wish to change this, but it may introduce ambiguity. llvm-svn: 232622
* [Mips] Handle -mips32r[3|5] / -mips64r[3|5] options while selecting ↵Simon Atanasyan2015-02-261-2/+5
| | | | | | | | | | | | lib/headers paths There is no supported toolchain which provides headers / libs / object files specific to the mips32r[3|5] and mips64r[3|5] ISA. So select "r2" specific folders when they are available. http://reviews.llvm.org/D7879 llvm-svn: 230611
* [Mips] Support mips-r6 path suffix for Adnroid MIPS toolchainSimon Atanasyan2015-02-251-0/+2
| | | | | | | This path suffix is used if user provides the -mips32r6 command line options. llvm-svn: 230469
* Driver: Fix use of dangling std::string temporaryBenjamin Kramer2015-02-181-1/+2
| | | | | | | | | | | What's going on here is that the ternary operator produces a std::string rvalue that the StringRef points to. I'd hoped bugs like this were a thing of the past with our asan testing but apparently this code path is only used when LLVM is configured with a custom --with-c-include-dirs setting. Unbreaks bootstrapping with GCC5 on Fedora (PR22625), patch by Jonathan Wakely! llvm-svn: 229719
* [ARM] Add missing M/R class CPUsBradley Smith2015-02-181-3/+3
| | | | | | | | | | | | Add some of the missing M and R class Cortex CPUs, namely: Cortex-M0+ (called Cortex-M0plus for GCC compatibility) Cortex-M1 SC000 SC300 Cortex-R5 llvm-svn: 229661
* Revert "More robust deployment target parsing on darwin"Steven Wu2015-01-141-20/+8
| | | | | | This breaks green-dragon. Revert it and investigate. llvm-svn: 226011
* More robust deployment target parsing on darwinSteven Wu2015-01-141-8/+20
| | | | | | | | | | | | | | | | Summary: This is a more robust way of figuring out implicit deployment target from isysroot. It also handles iphone simulator target. Reviewers: bob.wilson, t.p.northover Reviewed By: t.p.northover Subscribers: t.p.northover, cfe-commits Differential Revision: http://reviews.llvm.org/D6939 llvm-svn: 226005
* Use the integrated assembler by default on 32-bit PowerPC and SPARC.Brad Smith2015-01-141-0/+3
| | | | llvm-svn: 225958
* Revert "Use the integrated assembler by default on 32-bit PowerPC and SPARC"Duncan P. N. Exon Smith2015-01-051-3/+0
| | | | | | | | | This reverts commit r225212. It's failing on multiple buildbots [1][2]. [1]: http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/22032 [2]: http://lab.llvm.org:8080/green/view/Clang/job/clang-stage1-cmake-RA-incremental_check/2357/ llvm-svn: 225221
* Use the integrated assembler by default on 32-bit PowerPC and SPARCBrad Smith2015-01-051-0/+3
| | | | llvm-svn: 225212
* Remove special case for aarch64 static vs. PIC code in iOS kernel code.Bob Wilson2014-12-021-2/+1
| | | | | | | | | | I added this check a while back but then made a note to myself that it should be completely unnecessary since iOS always uses PIC code-gen for aarch64. Since I could never come up with any reason why it would be necessary, I'm just going to remove it and we'll see if anything breaks. rdar://problem/13627985 llvm-svn: 223097
* clang: do not add -pie for tsanDmitry Vyukov2014-11-211-2/+2
| | | | | | | | | Revision 220571 removes the requirement to use -pie for tsan binaries. So remove -pie from driver. Also s/hasZeroBaseShadow/requiresPIE/ because that is what it is used for. Msan does not have zero-based shadow, but requires pie. And in general the relation between zero-based shadow and pie is unclear. http://reviews.llvm.org/D6318 llvm-svn: 222526
* Fix clash of gcc toolchains in hexagon driver regression tests.Samuel Antao2014-11-071-7/+11
| | | | | | If clang was configured with a custom gcc toolchain (either by using GCC_INSTALL_PREFIX in cmake or the equivalent configure command), the path to the custom gcc toolchain path takes precedence to the one specified by -ccc-install-dir. This causes several regression tests to fail as they will be using an unexpected path. Adding the switch --gcc-toolchain="" in each test command is not enough as the hexagon toolchain implementation in the driver is not evaluating this argument. This commit modifies the hexagon toolchain to take the --gcc-toolchain="" argument into account when deciding the toolchain path, similarly to what is already done for other targets toolchains. Additionally, the faulty regression tests are modified in order to --gcc-toolchain="" be passed to the commands. llvm-svn: 221535
* Remove references to the cortex-a9-mp CPU.Charlie Turner2014-11-061-1/+1
| | | | | | | | | | This CPU definition is redundant. The Cortex-A9 is defined as supporting multiprocessing extensions. Remove references to this CPU. This CPU was recently removed from LLVM. See http://reviews.llvm.org/D6057 Change-Id: I62ae7cc656fcae54fbaefc4b6976e77e694a8678 llvm-svn: 221458
OpenPOWER on IntegriCloud