summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Tools.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [ARM] Pass subtarget feature "+reserve-r9" instead of passing backendAkira Hatanaka2015-07-211-7/+6
| | | | | | | | | | | | | | | | | | option "-arm-reserve-r9". This recommits r242736, which had to be reverted because the llvm-side change that was committed in r242737 caused the number of subtarget features to go over the limit of 64. This change is needed since backend options do not make it to the backend when doing LTO and are not capable of changing the behavior of code-gen passes on a per-function basis. rdar://problem/21529937 Differential Revision: http://reviews.llvm.org/D11319 llvm-svn: 242755
* Revert r242736.Akira Hatanaka2015-07-201-6/+7
| | | | | | | | | r242737 caused builds to fail with the following error message, so I'm reverting the clang side change too: error:Too many subtarget features! Bump MAX_SUBTARGET_FEATURES. llvm-svn: 242741
* [ARM] Pass subtarget feature "+reserve-r9" instead of passing backendAkira Hatanaka2015-07-201-7/+6
| | | | | | | | | | | | | | option "-arm-reserve-r9". This change is needed since backend options do not make it to the backend when doing LTO and are not capable of changing the behavior of code-gen passes on a per-function basis. rdar://problem/21529937 Differential Revision: http://reviews.llvm.org/D11319 llvm-svn: 242736
* Fixed style issues pointed out by Justin Bogner.Artem Belevich2015-07-201-4/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D11273 llvm-svn: 242698
* Allow case-insensitive values for -mtune for AArch64 target in line with GCC.Gabor Ballabas2015-07-201-4/+5
| | | | | | | | | GCC allows case-insensitive values for -mcpu, -march and -mtune options. This patch implements the same behaviour for the -mtune option for the AArch64 target. Differential Revision: http://reviews.llvm.org/D10563 llvm-svn: 242663
* Driver/ToolChain/AMDGPU: Attempt to fix buildbots after r242601Tom Stellard2015-07-181-1/+1
| | | | llvm-svn: 242602
* Driver: Add AMDGPU toolchainTom Stellard2015-07-181-0/+20
| | | | | | | | | | | | | | Summary: This is a minimal toolchain, which sets the integrated assembler as default, and uses lld for linking. Reviewers: arsenm, mcrosier Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D10700 llvm-svn: 242601
* Fix -save-temp when using objc-arc, sanitizer and profilingSteven Wu2015-07-171-7/+4
| | | | | | | | | | | | Currently, -save-temp will cause ObjCARC optimization to be dropped, sanitizer pass to run early in the pipeline, and profiling instrumentation to run twice. Fix the issue by properly disable all passes in the optimization pipeline when generating bitcode output and parse some of the Language Options even when the input is bitcode so the passes can be setup correctly. llvm-svn: 242565
* [Mips] Set mips64r6 as default CPU for MIPS64 AndroidPetar Jovanovic2015-07-171-0/+4
| | | | | | | | Change default CPU for MIPS64 Android. Now it is mips64r6. Differential Revision: http://reviews.llvm.org/D11294 llvm-svn: 242522
* Driver: Determine file names for crash reports more reliablyJustin Bogner2015-07-171-47/+48
| | | | | | | | Guessing which file name to replace based on the -main-file-name argument to -cc1 is flawed. Instead, keep track of which arguments are inputs to each command. llvm-svn: 242504
* [ARM] Pass subtarget feature "+no-movt" instead of passing backend optionAkira Hatanaka2015-07-161-4/+4
| | | | | | | | | | | | | | "-arm-use-movt=0". This change is needed since backend options do not make it to the backend when doing LTO and are not capable of changing the behavior of code-gen passes on a per-function basis. rdar://problem/21529937 Differential Revision: http://reviews.llvm.org/D11025 llvm-svn: 242368
* [clang-cl] Disable C++ exceptions a different wayReid Kleckner2015-07-141-7/+3
| | | | | | | | | | Rather than making -fexceptions a core option that enables C++ EH in clang-cl, users can use the '-Xclang -fexceptions -Xclang -fcxx-exceptions' flag set. We weren't going to expose -fexceptions in clang-cl in the long run, so this way we don't add and then remove a flag. llvm-svn: 242176
* Add support for -fuse-ld= in the mingw toolchain driver.Yaron Keren2015-07-141-2/+10
| | | | | | | | | | | | We will still default to ld until such a time lld become a stable release. lld supports arm NT under the machine name "thumb2pe". http://reviews.llvm.org/D11088 Patch by Martell Malone Reviewed by Reid Kleckner llvm-svn: 242121
* [cuda] Driver changes to compile and stitch together host and device-side ↵Artem Belevich2015-07-131-8/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | CUDA code. NOTE: reverts r242077 to reinstate r242058, r242065, 242067 and includes fix for OS X test failures. - Changed driver pipeline to compile host and device side of CUDA files and incorporate results of device-side compilation into host object file. - Added a test for cuda pipeline creation in clang driver. New clang options: --cuda-host-only - Do host-side compilation only. --cuda-device-only - Do device-side compilation only. --cuda-gpu-arch=<ARCH> - specify GPU architecture for device-side compilation. E.g. sm_35, sm_30. Default is sm_20. May be used more than once in which case one device-compilation will be done per unique specified GPU architecture. Differential Revision: http://reviews.llvm.org/D9509 llvm-svn: 242085
* [OpenMP] Add TLS-based implementation for threadprivate directive.Samuel Antao2015-07-131-0/+10
| | | | llvm-svn: 242080
* This reverts commit r242058, r242065, r242067.Rafael Espindola2015-07-131-28/+8
| | | | | | | | | | The tests were failing on OS X. Revert "[cuda] Driver changes to compile and stitch together host and device-side CUDA code." Revert "Fixed regex to properly match '64' in the test case." Revert "clang/test/Driver/cuda-options.cu REQUIRES clang-driver, at least." llvm-svn: 242077
* [cuda] Driver changes to compile and stitch together host and device-side ↵Artem Belevich2015-07-131-8/+28
| | | | | | | | | | | | | | | | | | | | | | | CUDA code. - Changed driver pipeline to compile host and device side of CUDA files and incorporate results of device-side compilation into host object file. - Added a test for cuda pipeline creation in clang driver. New clang options: --cuda-host-only - Do host-side compilation only. --cuda-device-only - Do device-side compilation only. --cuda-gpu-arch=<ARCH> - specify GPU architecture for device-side compilation. E.g. sm_35, sm_30. Default is sm_20. May be used more than once in which case one device-compilation will be done per unique specified GPU architecture. Differential Revision: http://reviews.llvm.org/D9509 llvm-svn: 242058
* Disable C++ EH by default for clang-cl and MSVC environmentsReid Kleckner2015-07-101-16/+21
| | | | | | | | | We don't need any more bug reports from users telling us that MSVC-style C++ exceptions are broken. Developers and adventurous users can still test the existing functionality by passing along -fexceptions to either clang or clang-cl. llvm-svn: 241952
* Refactor PPC ABI handling to accept and silently ignore -mabi=altivec.Eric Christopher2015-07-101-3/+8
| | | | | | | | | All of the ABIs we support are altivec style anyhow and so the option doesn't make much sense with the modern ABIs. We could make this a more noisy ignore, but it would break builds for projects that just pass it along by default because of historical reasons. llvm-svn: 241925
* Factor PGO and coverage flag processing out of Clang::ConstructJobDiego Novillo2015-07-101-78/+85
| | | | | | | | | | The function is massively large and GCC is emitting stack overflow errors when building it (stack, as counted by the compiler, grows to more than 16Kb). The new flag processing logic added in r241825 took it over the limit. llvm-svn: 241918
* Re-use a single SmallString instance to reduce the stack frame sizeDaniel Jasper2015-07-101-19/+18
| | | | | | | In certain builds (msan), this can otherwise exceed the stack frame limit set for certain environments. llvm-svn: 241894
* Add GCC-compatible flags -fprofile-generate and -fprofile-use.Diego Novillo2015-07-091-17/+40
| | | | | | | | | | | | | | | | | | This patch adds support for specifying where the profile is emitted in a way similar to GCC. These flags are used to specify directories instead of filenames. When -fprofile-generate=DIR is used, the compiler will generate code to write to <DIR>/default.profraw. The patch also adds a couple of extensions: LLVM_PROFILE_FILE can still be used to override the directory and file name to use and -fprofile-use accepts both directories and filenames. To simplify the set of flags used in the backend, all the flags get canonicalized to -fprofile-instr-{generate,use} when passed to the backend. The decision to use a default name for the profile is done in the driver. llvm-svn: 241825
* [MIPS] Add support for direct-to-nacl in ClangPetar Jovanovic2015-07-081-0/+16
| | | | | | | | | | | For Mips direct-to-nacl, the goal is to be close to le32 front-end and use Mips32EL backend. This patch defines new NaClMips32ELTargetInfo and modifies it slightly to be close to le32. It also adds necessary parts, inline with ARM and X86. Differential Revision: http://reviews.llvm.org/D10739 llvm-svn: 241678
* Add a comment to explain how the decision to pass feature "+long-calls" is made.Akira Hatanaka2015-07-071-0/+3
| | | | llvm-svn: 241568
* [ARM] Pass subtarget feature "+long-calls" instead of passing backend optionAkira Hatanaka2015-07-071-16/+10
| | | | | | | | | | | | | "-arm-long-calls". This change allows using -mlong-calls/-mno-long-calls for LTO and enabling or disabling long call on a per-function basis. rdar://problem/21529937 Differential Revision: http://reviews.llvm.org/D9414 llvm-svn: 241565
* Support -pthread in mingw toolchain.Yaron Keren2015-07-061-4/+2
| | | | | | "-pthread" appends -lpthread after the object files list passed to the linker. llvm-svn: 241485
* Resubmit "Pass down the -flto option to the -cc1 job" (r239481)Teresa Johnson2015-07-061-0/+4
| | | | | | | | | | | | | | | | | | The patch is the same except for the addition of a new test for the issue that required reverting the dependent llvm commit. --Original Commit Message-- Pass down the -flto option to the -cc1 job, and from there into the CodeGenOptions and onto the PassManagerBuilder. This enables gating the new EliminateAvailableExternally module pass on whether we are preparing for LTO. If we are preparing for LTO (e.g. a -flto -c compile), the new pass is not included as we want to preserve available externally functions for possible link time inlining. llvm-svn: 241467
* Support mingw-w64 and mingw.org toolchains at any install location.Yaron Keren2015-07-021-0/+206
| | | | | | | | | | | | | No more hardcoded paths: clang will use -sysroot as gcc root location if provided. Otherwise, it will search for gcc on the path. If not found it will use the driver installed location. http://reviews.llvm.org/D5268 Patch by Ruben Van Boxem, Martell Malone, Yaron Keren. Reviewed by Reid Kleckner. llvm-svn: 241241
* Make getArchNameForCompilerRTLib return the right thing on 32-bit Windows. ↵Peter Collingbourne2015-07-021-0/+4
| | | | | | Fixes the tests there. llvm-svn: 241228
* Driver: add support for linking the UBSan runtime library on Windows.Peter Collingbourne2015-07-021-7/+3
| | | | | | | | | | | | | | On Windows the user may invoke the linker directly, so we might not have an opportunity to add runtime library flags to the linker command line. Instead, instruct the code generator to embed linker directive in the object file that cause the required runtime libraries to be linked. We might also want to do something similar for ASan, but it seems to have its own special complexities which may make this infeasible. Differential Revision: http://reviews.llvm.org/D10862 llvm-svn: 241225
* [clang-cl] Use /arch: to set the base target CPUReid Kleckner2015-06-301-0/+22
| | | | | | | | | | | | The main effect of this change is that /arch:IA32 will use i386 as the CPU, while clang-cl will continue to default to pentium4 (aka SSE2 plus the usual other features). /arch:AVX and /arch:AVX2 will also now enable the other features available in sandybridge and haswell respectively, which is consistent with MSDN. llvm-svn: 241077
* More range-based for loops. NFCDouglas Katzman2015-06-291-7/+5
| | | | llvm-svn: 240984
* Comment fixes. NFC.Douglas Katzman2015-06-291-2/+2
| | | | | | | | | - Hexagon options were physically next to to ones that had a preceding comment saying "Double dash options", which they aren't. - The 'ld' tool classes are named Linker, not Link. llvm-svn: 240980
* clang-format some of the files in lib/Driver. NFCDouglas Katzman2015-06-261-715/+638
| | | | | | | | | Nothing was hand edited afterward except a few literal strings and comments that were poorly broken. Differential Revision: http://reviews.llvm.org/D10689 llvm-svn: 240791
* Use more range-based for loopsDouglas Katzman2015-06-251-6/+5
| | | | | | Differential Revision: http://reviews.llvm.org/D10738 llvm-svn: 240674
* Pedantically rename all Tool subclasses to be nouns, not verbs. NFCDouglas Katzman2015-06-231-173/+166
| | | | | | | | | | | | | | | | | | Classes in Tools.h inherit ultimately from Tool, which is a noun, but subclasses of Tool were named for their operation, such as "Compile", wherein the constructor call "Compile(args...)" could be misconstrued as actually causing a compile to happen. Likewise various other methods were not harmonious with their effect, in that "BuildLinker()" returned a "new namespace::Link(...)" instead of a "new namespace::Linker(...)" which it now does. Exceptions: Clang and ClangAs are un-renamed. Those are their rightful names. And there is no particulary great way to name the "Lipo-er" and a few others. Differential Revision: http://reviews.llvm.org/D10595 llvm-svn: 240455
* Driver: Pass -I options to cc1as for .include search paths.Jim Grosbach2015-06-231-0/+3
| | | | llvm-svn: 240432
* Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko2015-06-221-1/+1
| | | | llvm-svn: 240353
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-221-1/+1
| | | | | | | | | | | | The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. llvm-svn: 240270
* [CFI] Require -flto instead of implying it.Alexey Samsonov2015-06-191-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is unfortunate, but would let us land http://reviews.llvm.org/D10467, that makes ToolChains responsible for computing the set of sanitizers they support. Unfortunately, Darwin ToolChains doesn't know about actual OS they target until ToolChain::TranslateArgs() is called. In particular, it means we won't be able to construct SanitizerArgs for these ToolChains before that. This change removes SanitizerArgs::needsLTO() method, so that now ToolChain::IsUsingLTO(), which is called very early, doesn't need SanitizerArgs to implement this method. Docs and test cases are updated accordingly. See https://llvm.org/bugs/show_bug.cgi?id=23539, which describes why we start all these. Test Plan: regression test suite Reviewers: pcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D10560 llvm-svn: 240170
* Add nominal support for 'shave' target.Douglas Katzman2015-06-191-0/+78
| | | | | | | | | | | | | | 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
* Allow case-insensitive values for -march for AArch64 target in line with GCC.Gabor Ballabas2015-06-181-1/+2
| | | | | | | GCC allows case-insensitive values for -mcpu, -march and -mtune options. This patch implements the same behaviour for the -march option for the AArch64 target. llvm-svn: 240019
* [mips] Don't propagate -mfpxx by default if soft/single float were also set.Toma Tabacu2015-06-161-4/+24
| | | | | | | | | | | | | | | | | Summary: If the driver is only given -msoft-float/-mfloat-abi=soft or -msingle-float, we should refrain from propagating -mfpxx, unless it was explicitly given on the command line. Reviewers: atanasyan, dsanders Reviewed By: atanasyan, dsanders Subscribers: cfe-commits, mpf Differential Revision: http://reviews.llvm.org/D10387 llvm-svn: 239818
* [modules] Rename -fmodule-maps to -fimplicit-module-maps (and likewise forRichard Smith2015-06-161-2/+2
| | | | | | -fno-module-maps). The old names are preserved for compatibility. llvm-svn: 239792
* [modules] Simplify -cc1 interface for enabling implicit module maps.Richard Smith2015-06-161-6/+6
| | | | | | | | | | | | | We used to have a flag to enable module maps, and two more flags to enable implicit module maps. This is all redundant; we don't need any flag for enabling module maps in the abstract, and we don't usually have -fno- flags for -cc1. We now have just a single flag, -fimplicit-module-maps, that enables implicitly searching the file system for module map files and loading them. The driver interface is unchanged for now. We should probably rename -fmodule-maps to -fimplicit-module-maps at some point. llvm-svn: 239789
* Protection against stack-based memory corruption errors using SafeStack: ↵Peter Collingbourne2015-06-151-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | Clang command line option and function attribute This patch adds the -fsanitize=safe-stack command line argument for clang, which enables the Safe Stack protection (see http://reviews.llvm.org/D6094 for the detailed description of the Safe Stack). This patch is our implementation of the safe stack on top of Clang. The patches make the following changes: - Add -fsanitize=safe-stack and -fno-sanitize=safe-stack options to clang to control safe stack usage (the safe stack is disabled by default). - Add __attribute__((no_sanitize("safe-stack"))) attribute to clang that can be used to disable the safe stack for individual functions even when enabled globally. Original patch by Volodymyr Kuznetsov and others at the Dependable Systems Lab at EPFL; updates and upstreaming by myself. Differential Revision: http://reviews.llvm.org/D6095 llvm-svn: 239762
* [Sparc] Make soft-float emit an error.James Y Knight2015-06-151-39/+13
| | | | | | | | | | | | LLVM does not and has not ever supported a soft-float ABI mode on Sparc, so don't pretend that it does. Also switch the default from "soft-float" -- which was actually hard-float because soft-float is unimplemented -- to hard-float. Differential Revision: http://reviews.llvm.org/D10457 llvm-svn: 239755
* Allow case-insensitive values for -mcpu for AArch64 target in line with GCC.Gabor Ballabas2015-06-121-3/+5
| | | | | | | GCC allows case-insensitive values for -mcpu, -march and -mtune options. This patch implements the same behaviour for the -mcpu option for the AArch64 target. llvm-svn: 239619
* Revert commit r239481 as it is dependent on reverted llvm commit r239480.Teresa Johnson2015-06-121-4/+0
| | | | llvm-svn: 239588
* add the -mrecip driver flag and process its options (3rd try)Sanjay Patel2015-06-111-0/+133
| | | | | | | | | | | | | | | | | | | The 1st and 2nd tries to land this (r238055, r238851) were reverted due to bot failures caused by the LLVM part of the patch. That was hopefully fixed after r239001. This is the front-end counterpart to D8982. The -mrecip option interface is based on maintaining compatibility with gcc: https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/i386-and-x86-64-Options.html#index-mrecip_003dopt-1627 https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/RS_002f6000-and-PowerPC-Options.html#index-mrecip-2289 ...while adding more functionality (allowing users to specify the number of refinement steps for each estimate type). Differential Revision: http://reviews.llvm.org/D8989 llvm-svn: 239536
OpenPOWER on IntegriCloud