summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Tools.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [CUDA] added include paths for both sides of CUDA compilation.Artem Belevich2015-11-171-4/+20
| | | | | | | | | | | | | | | | | | | | | In order to compile a CUDA file clang must be able to find include files for both both host and device. This patch passes AuxToolchain to AddPreprocessingOptions and uses it to add include paths for the opposite side of compilation. We also must be able to find CUDA include files. If the driver found CUDA installation, it adds appropriate include path to CUDA headers. This can be disabled with '-nocudainc'. - Added include paths for the opposite side of compilation. - Added include paths to detected CUDA installation. - Added -nocudainc to prevent adding CUDA include path. - Added test cases to verify new functionality. Differential Revision: http://reviews.llvm.org/D13170 llvm-svn: 253386
* [CUDA] use -aux-triple to pass target triple of opposite side of compilationArtem Belevich2015-11-171-0/+17
| | | | | | | | | | | | | | | | Clang needs to know target triple for both sides of compilation so that preprocessor macros and target builtins from both sides are available. This change augments Compilation class to carry information about toolchains used during different CUDA compilation passes and refactors BuildActions to use it when it constructs CUDA jobs. Removed DeviceTriple from CudaHostAction/CudaDeviceAction as it's no longer needed. Differential Revision: http://reviews.llvm.org/D13144 llvm-svn: 253385
* Use !hasArg with two options instead of !hasArg && !hasArg.Douglas Katzman2015-11-171-92/+52
| | | | | | Thereby fixing a warning about failure to claim all args. llvm-svn: 253372
* Add trivial utility to append -L arguments to linker step. NFCDouglas Katzman2015-11-171-35/+9
| | | | llvm-svn: 253350
* [Myriad]: pass the 'std=' option to moviCompileDouglas Katzman2015-11-161-1/+1
| | | | llvm-svn: 253213
* Update for the gnu flavor being renamed to old-gnu.Rafael Espindola2015-11-161-3/+3
| | | | llvm-svn: 253191
* Make the mingw toolchain accept 'ld' and 'lld' only as values to -fuse-ld.Yaron Keren2015-11-151-0/+2
| | | | | | Post-commit suggestion by Filipe Cabecinhas. llvm-svn: 253161
* Revert "[AArch64] Unconditionally pass subtarget feature reserve-x18 on Darwin."Justin Bogner2015-11-131-5/+3
| | | | | | | | | This reverts r243310, which is redundant as of r253102. Conflicts: lib/Driver/Tools.cpp llvm-svn: 253104
* Add support for driver option -mno-ms-bitfields.Akira Hatanaka2015-11-121-1/+2
| | | | | | | | This option is used to cancel -mms-bitfields on the command line. rdar://problem/15898553 llvm-svn: 252912
* Re-recommit: Add support for the new mips-mti-linux toolchain.Vasileios Kalintiris2015-11-121-20/+44
| | | | | | | | Last time, this caused two Windows buildbots and a single ARM buildbot to fail. I XFAIL'd the failing test on win32,win64 machines in order to see if the ARM buildbot complains again. llvm-svn: 252901
* Use the generic Sparc CPU handling for Linux, FreeBSD and OpenBSD, too.Joerg Sonnenberger2015-11-101-29/+26
| | | | | | | | This currently changes the default toward the more historic -Av8/-Av9, but as discussed with James Y Knight, consistency is for now more important than figuring out which default CPU each OS should be using. llvm-svn: 252571
* Use the normal switch over getArch() approach and not a long if chain.Joerg Sonnenberger2015-11-101-13/+23
| | | | llvm-svn: 252562
* Reorganise CPU handling for Sparc. When using -mcpu=v9 and co, __sparcv8Joerg Sonnenberger2015-11-091-3/+38
| | | | | | | | | is not defined for 32bit mode, but __sparcv9 is. Pass down the correct -target-cpu flags to the backend, so that instruction restrictions are applied correctly. Pass down the correct -A flag when not using IAS. The latter is limited to NetBSD targets in this commit. llvm-svn: 252545
* [EABI] Add Clang support for -meabi flagRenato Golin2015-11-091-0/+5
| | | | | | | | | | | | | | The -meabi flag to control LLVM EABI version. Without '-meabi' or with '-meabi default' imply LLVM triple default. With '-meabi gnu' sets EABI GNU. With '-meabi 4' or '-meabi 5' set EABI version 4 and 5 respectively. A similar patch was introduced in LLVM. Patch by Vinicius Tinti. llvm-svn: 252463
* After some discussion, promote -fobjc-weak to a driver option.John McCall2015-11-051-0/+17
| | | | | | rdar://problem/23415863 llvm-svn: 252187
* Fix some Clang-tidy modernize warnings, other minor fixes.Eugene Zelenko2015-11-041-3/+3
| | | | | | Differential revision: http://reviews.llvm.org/D14311 llvm-svn: 252081
* Silence "enumeral and non-enumeral type in conditional expression" warning; NFC.Aaron Ballman2015-11-041-1/+1
| | | | llvm-svn: 252047
* Clang format a few prior patches (NFC)Teresa Johnson2015-11-021-1/+2
| | | | | | | I had clang formatted my earlier patches using the wrong style. Reformatted with the LLVM style. llvm-svn: 251813
* Disable SjLj exceptions for watchOSTim Northover2015-10-301-1/+1
| | | | llvm-svn: 251709
* Watch and TV OS: wire up basic ABI choicesTim Northover2015-10-301-2/+9
| | | | | | | This sets the mostly expected Darwin default ABI options for these two platforms. Active changes from these defaults for watchOS are in a later patch. llvm-svn: 251708
* Support watchOS and tvOS driver optionsTim Northover2015-10-301-2/+7
| | | | | | | | This patch should add support for almost all command-line options and driver tinkering necessary to produce a correct "clang -cc1" invocation for watchOS and tvOS. llvm-svn: 251706
* Revert "[mips] Add support for the new mips-mti-linux toolchain."Vasileios Kalintiris2015-10-301-44/+20
| | | | | | | This reverts commits r251633. I'll investigate the test failure off trunk in order to keep the buildbots clean. llvm-svn: 251698
* Revert "Try to run and investigate the mips-mti-linux.c test failure on ARM ↵Renato Golin2015-10-301-13/+0
| | | | | | | | | buildbots." This reverts commit r251695. Debug is meant to be done off tree, not use the buildbots experiments. I'll help investigate this problem off trunk. llvm-svn: 251696
* Try to run and investigate the mips-mti-linux.c test failure on ARM buildbots.Vasileios Kalintiris2015-10-301-0/+13
| | | | | | | | This should be a NFC for every toolchain other than mips-mti-linux (where we print the list of directories searched for crt files). It will soon be reverted once we hit the clang-cmake-armv7-a15-selfhost-neon buildbot. llvm-svn: 251695
* [mips] Add support for the new mips-mti-linux toolchain.Vasileios Kalintiris2015-10-291-20/+44
| | | | | | | | | | The original commit in r249137 added the mips-mti-linux toolchain. However, the newly added tests of that commit failed in few buildbots. This commit re-applies the original changes but XFAILs the test file which caused the buildbot failures. This will allow us to examine what's going wrong without having to commit/revert large changes. llvm-svn: 251633
* Driver: CrossWindows sanitizers link supportSaleem Abdulrasool2015-10-291-0/+16
| | | | | | | Add the required libraries to the linker invocation when building with sanitizers. llvm-svn: 251600
* Driver: inline some small arraysSaleem Abdulrasool2015-10-291-10/+4
| | | | | | Use an initializer list to remove a couple of small static arrays. NFC. llvm-svn: 251599
* Put global classes into the appropriate namespace.Benjamin Kramer2015-10-281-0/+2
| | | | | | | Most of the cases belong into an anonymous namespace. No functionality change intended. llvm-svn: 251514
* Driver: support -fuse-ld= on cross windowsSaleem Abdulrasool2015-10-281-2/+1
| | | | | | | Update the linker selection to support the `-fuse-ld=` option for selecting a linker. llvm-svn: 251493
* [mips] Separated mips specific -Wa options, so that they are not checked on ↵Daniel Sanders2015-10-271-12/+30
| | | | | | | | | | | | | | | | other platforms. Summary: This is a follow on to post review comments on revision r248276. Patch by Scott Egerton. Reviewers: vkalintiris, dsanders Subscribers: joerg, rengolin, cfe-commits Differential Revision: http://reviews.llvm.org/D13100 llvm-svn: 251430
* Define weak and __weak to mean ARC-style weak references, even in MRC.John McCall2015-10-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, __weak was silently accepted and ignored in MRC mode. That makes this a potentially source-breaking change that we have to roll out cautiously. Accordingly, for the time being, actual support for __weak references in MRC is experimental, and the compiler will reject attempts to actually form such references. The intent is to eventually enable the feature by default in all non-GC modes. (It is, of course, incompatible with ObjC GC's interpretation of __weak.) If you like, you can enable this feature with -Xclang -fobjc-weak but like any -Xclang option, this option may be removed at any point, e.g. if/when it is eventually enabled by default. This patch also enables the use of the ARC __unsafe_unretained qualifier in MRC. Unlike __weak, this is being enabled immediately. Since variables are essentially __unsafe_unretained by default in MRC, the only practical uses are (1) communication and (2) changing the default behavior of by-value block capture. As an implementation matter, this means that the ObjC ownership qualifiers may appear in any ObjC language mode, and so this patch removes a number of checks for getLangOpts().ObjCAutoRefCount that were guarding the processing of these qualifiers. I don't expect this to be a significant drain on performance; it may even be faster to just check for these qualifiers directly on a type (since it's probably in a register anyway) than to do N dependent loads to grab the LangOptions. rdar://9674298 llvm-svn: 251041
* clang driver toolchain refactoringXinliang David Li2015-10-221-40/+13
| | | | | | | | | | | | | | In this patch, the file static method addProfileRT is moved to be a virtual member function of base ToolChain class. This allows derived toolchain to override the default behavior easily and make it consistent with Darwin toolchain (a TODO was added for this refactoring - now removed). A new helper method is also introduced to test if instrumentation profile option is turned on or not. Differential Revision: http://reviews.llvm.org/D13326 llvm-svn: 250994
* [Myriad]: Always add -L paths even if -nostdlib is set.Douglas Katzman2015-10-211-7/+5
| | | | llvm-svn: 250932
* Support linking against OpenMP runtime on FreeBSD.Dimitry Andric2015-10-181-0/+1
| | | | | | | | | | | | | | | Summary: Similar to rL248426 (which was a followup to rL248379 and rL248424), add the required libraries for OpenMP on the linker command line, and update the test case. Reviewers: emaste, theraven, joerg Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D13822 llvm-svn: 250657
* Make a bunch of static arrays const.Craig Topper2015-10-181-2/+2
| | | | llvm-svn: 250647
* PS4: Make sure to add the sanitizer runtime before any linker inputFilipe Cabecinhas2015-10-161-2/+4
| | | | llvm-svn: 250514
* Recommit "Clang support for -flto=thin."Teresa Johnson2015-10-151-12/+14
| | | | | | | | | This recommits r250398 with fixes to the tests for bot failures. Add "-target x86_64-unknown-linux" to the clang invocations that check for the gold plugin. llvm-svn: 250455
* Revert "Clang support for -flto=thin." (bot failures)Teresa Johnson2015-10-151-14/+12
| | | | | | | | | | | Rolling this back for now since there are a couple of bot failures on the new tests I added, and I won't have a chance to look at them in detail until later this afternoon. I think the new tests need some restrictions on having the gold plugin available. This reverts commit r250398. llvm-svn: 250402
* Clang support for -flto=thin.Teresa Johnson2015-10-151-12/+14
| | | | | | | | | | | | | | | | | | | Summary: Add clang support for -flto=thin option, which is used to set the EmitFunctionSummary code gen option on compiles. Add -flto=full as an alias to the existing -flto. Add tests to check for proper overriding of -flto variants on the command line, and convert grep tests to FileCheck. Reviewers: dexonsmith, joker.eph Subscribers: davidxl, cfe-commits Differential Revision: http://reviews.llvm.org/D11908 llvm-svn: 250398
* Remove unnecessary braces in single-line 'if'.Douglas Katzman2015-10-151-2/+1
| | | | llvm-svn: 250363
* Bring back r250262: PS4 toolchainFilipe Cabecinhas2015-10-141-7/+341
| | | | | | | | | | | | | | There was a minor problem with a test. Sorry for the noise yesterday. This patch adds missing pieces to clang, including the PS4 toolchain definition, added warnings, PS4 defaults, and Driver changes needed for our compiler. A patch by Filipe Cabecinhas, Pierre Gousseau and Katya Romanova! Differential Revision: http://reviews.llvm.org/D13482 llvm-svn: 250293
* Revert-to-green r250262 (PS4 toolchain patch)Sean Silva2015-10-141-341/+7
| | | | | | | It is breaking llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast e.g. http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/1362 llvm-svn: 250273
* I took care of the build problem in the commit 250252.Ekaterina Romanova2015-10-141-7/+341
| | | | | | | | | | | | | | Resubmitting the patch. This patch adds missing pieces to clang, including the PS4 toolchain definition, added warnings, PS4 defaults, and Driver changes needed for our compiler. A patch by Filipe Cabecinhas, Pierre Gousseau and Katya Romanova! Differential Revision: http://reviews.llvm.org/D13482 llvm-svn: 250262
* reverting my patch, cause build problemsEkaterina Romanova2015-10-141-341/+7
| | | | llvm-svn: 250257
* This patch adds missing pieces to clang, including the PS4 toolchainEkaterina Romanova2015-10-131-7/+341
| | | | | | | | | | | definition, added warnings, PS4 defaults, and Driver changes needed for our compiler. A patch by Filipe Cabecinhas, Pierre Gousseau and Katya Romanova! Differential Revision: http://reviews.llvm.org/D13482 llvm-svn: 250252
* Always pass a -dwarf-version argument to integrated as.Douglas Katzman2015-10-131-2/+3
| | | | | | | | This removes the default of 3 hidden in the assembler previously. Fixes breakage caused by r249655, reported by vsukharev. llvm-svn: 250173
* Support Debug Info path remappingSaleem Abdulrasool2015-10-121-0/+9
| | | | | | | | | | | | | | | | Add support for the `-fdebug-prefix-map=` option as in GCC. The syntax is `-fdebug-prefix-map=OLD=NEW`. When compiling files from a path beginning with OLD, change the debug info to indicate the path as start with NEW. This is particularly helpful if you are preprocessing in one path and compiling in another (e.g. for a build cluster with distcc). Note that the linearity of the implementation is not as terrible as it may seem. This is normally done once per file with an expectation that the map will be small (1-2) entries, making this roughly linear in the number of input paths. Addresses PR24619. llvm-svn: 250094
* [Myriad]: put libstdc++ and libc in the right orderDouglas Katzman2015-10-091-2/+2
| | | | llvm-svn: 249893
* Use Triple.isAndroid() where possible.Evgeniy Stepanov2015-10-081-12/+10
| | | | llvm-svn: 249751
* [clang-cl] Make /EHs turn on C++ EH once againReid Kleckner2015-10-081-4/+0
| | | | | | | | | | | C++ exceptions are still off by default, which is similar to how C++ cleanups are off by default in MSVC. If you use clang instead of clang-cl, exceptions are also still off by default. In the future, when C++ EH is proven to be stable, we may flip the default for that driver to be consistent with other platforms. llvm-svn: 249704
OpenPOWER on IntegriCloud