aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Driver/Tools.cpp
AgeCommit message (Collapse)AuthorFilesLines
2015-07-25[AArch64] Pass subtarget feature "+reserve-x18" instead of passing backendAkira Hatanaka1-5/+3
option "-aarch64-reserve-x18". 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/D11462 llvm-svn: 243185
2015-07-24[clang-cl] Implement support for the /Zl flagDavid Majnemer1-8/+15
The flag allows users to specify that they do not want the object file to have any implicit /defaultlib directives. This fixes PR24236. llvm-svn: 243097
2015-07-23[Compiler-RT] Remove dependency on libgcc_s/ehRenato Golin1-7/+0
Currently, for --rtlib=compiler-rt on GNU systems, we're assuming that one has libgcc_s and libgcc_eh as low-level libraries, which when used in conjunction with -lunwind or -lc++abi, breaks that assumption. My original fix was wrong, and this patch reverts it to prepare for a new flag to choose the unwinder/C++ libraries. For the time being, people can use "-lgcc_s -lgcc_eh" or "-lunwind -lc++abi" or any combination they need explicitly. llvm-svn: 243025
2015-07-22[mingw] Add support for -rtlib option and -stdlib option to the mingw driverReid Kleckner1-15/+12
Now clang should be able to use compiler-rt and libc++ on mingw. Based on a patch by Martell Malone. Differential Revision: http://reviews.llvm.org/D11237 llvm-svn: 242905
2015-07-22Pass -I options to integrates and external assemblersRenato Golin1-0/+4
Fixes PR21000. Patch by Artem Belevich. llvm-svn: 242904
2015-07-21[ARM] Pass subtarget feature "+reserve-r9" instead of passing backendAkira Hatanaka1-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
2015-07-20Revert r242736.Akira Hatanaka1-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
2015-07-20[ARM] Pass subtarget feature "+reserve-r9" instead of passing backendAkira Hatanaka1-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
2015-07-20Fixed style issues pointed out by Justin Bogner.Artem Belevich1-4/+2
Differential Revision: http://reviews.llvm.org/D11273 llvm-svn: 242698
2015-07-20Allow case-insensitive values for -mtune for AArch64 target in line with GCC.Gabor Ballabas1-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
2015-07-18Driver/ToolChain/AMDGPU: Attempt to fix buildbots after r242601Tom Stellard1-1/+1
llvm-svn: 242602
2015-07-18Driver: Add AMDGPU toolchainTom Stellard1-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
2015-07-17Fix -save-temp when using objc-arc, sanitizer and profilingSteven Wu1-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
2015-07-17[Mips] Set mips64r6 as default CPU for MIPS64 AndroidPetar Jovanovic1-0/+4
Change default CPU for MIPS64 Android. Now it is mips64r6. Differential Revision: http://reviews.llvm.org/D11294 llvm-svn: 242522
2015-07-17Driver: Determine file names for crash reports more reliablyJustin Bogner1-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
2015-07-16[ARM] Pass subtarget feature "+no-movt" instead of passing backend optionAkira Hatanaka1-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
2015-07-14[clang-cl] Disable C++ exceptions a different wayReid Kleckner1-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
2015-07-14Add support for -fuse-ld= in the mingw toolchain driver.Yaron Keren1-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
2015-07-13[cuda] Driver changes to compile and stitch together host and device-side ↵Artem Belevich1-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
2015-07-13[OpenMP] Add TLS-based implementation for threadprivate directive.Samuel Antao1-0/+10
llvm-svn: 242080
2015-07-13This reverts commit r242058, r242065, r242067.Rafael Espindola1-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
2015-07-13[cuda] Driver changes to compile and stitch together host and device-side ↵Artem Belevich1-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
2015-07-10Disable C++ EH by default for clang-cl and MSVC environmentsReid Kleckner1-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
2015-07-10Refactor PPC ABI handling to accept and silently ignore -mabi=altivec.Eric Christopher1-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
2015-07-10Factor PGO and coverage flag processing out of Clang::ConstructJobDiego Novillo1-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
2015-07-10Re-use a single SmallString instance to reduce the stack frame sizeDaniel Jasper1-19/+18
In certain builds (msan), this can otherwise exceed the stack frame limit set for certain environments. llvm-svn: 241894
2015-07-09Add GCC-compatible flags -fprofile-generate and -fprofile-use.Diego Novillo1-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
2015-07-08[MIPS] Add support for direct-to-nacl in ClangPetar Jovanovic1-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
2015-07-07Add a comment to explain how the decision to pass feature "+long-calls" is made.Akira Hatanaka1-0/+3
llvm-svn: 241568
2015-07-07[ARM] Pass subtarget feature "+long-calls" instead of passing backend optionAkira Hatanaka1-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
2015-07-06Support -pthread in mingw toolchain.Yaron Keren1-4/+2
"-pthread" appends -lpthread after the object files list passed to the linker. llvm-svn: 241485
2015-07-06Resubmit "Pass down the -flto option to the -cc1 job" (r239481)Teresa Johnson1-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
2015-07-02Support mingw-w64 and mingw.org toolchains at any install location.Yaron Keren1-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
2015-07-02Make getArchNameForCompilerRTLib return the right thing on 32-bit Windows. ↵Peter Collingbourne1-0/+4
Fixes the tests there. llvm-svn: 241228
2015-07-02Driver: add support for linking the UBSan runtime library on Windows.Peter Collingbourne1-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
2015-06-30[clang-cl] Use /arch: to set the base target CPUReid Kleckner1-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
2015-06-29More range-based for loops. NFCDouglas Katzman1-7/+5
llvm-svn: 240984
2015-06-29Comment fixes. NFC.Douglas Katzman1-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
2015-06-26clang-format some of the files in lib/Driver. NFCDouglas Katzman1-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
2015-06-25Use more range-based for loopsDouglas Katzman1-6/+5
Differential Revision: http://reviews.llvm.org/D10738 llvm-svn: 240674
2015-06-23Pedantically rename all Tool subclasses to be nouns, not verbs. NFCDouglas Katzman1-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
2015-06-23Driver: Pass -I options to cc1as for .include search paths.Jim Grosbach1-0/+3
llvm-svn: 240432
2015-06-22Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko1-1/+1
llvm-svn: 240353
2015-06-22Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko1-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
2015-06-19[CFI] Require -flto instead of implying it.Alexey Samsonov1-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
2015-06-19Add nominal support for 'shave' target.Douglas Katzman1-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
2015-06-18Allow case-insensitive values for -march for AArch64 target in line with GCC.Gabor Ballabas1-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
2015-06-16[mips] Don't propagate -mfpxx by default if soft/single float were also set.Toma Tabacu1-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
2015-06-16[modules] Rename -fmodule-maps to -fimplicit-module-maps (and likewise forRichard Smith1-2/+2
-fno-module-maps). The old names are preserved for compatibility. llvm-svn: 239792
2015-06-16[modules] Simplify -cc1 interface for enabling implicit module maps.Richard Smith1-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