summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
...
* Myriad: Pass -mcpu to movi{Compile,Asm}Douglas Katzman2016-03-151-3/+6
| | | | | | Differential Revision: http://reviews.llvm.org/D18186 llvm-svn: 263556
* Make FreeBSD and NetBSD use CLANG_DEFAULT_CXX_STDLIBJonas Hahnfeld2016-03-143-26/+14
| | | | | | | | | Also introduce -stdlib=platform to override the configured value and use it to make the tests always pass. Differential Revision: http://reviews.llvm.org/D17286 llvm-svn: 263434
* [Driver] Enable --rtlib option for MSVC targetAndrey Turetskiy2016-03-141-1/+16
| | | | | | | | | | This enables "--rtlib compiler-rt" option under MSVC environment. Patch by Roman Shirokiy. Differential Revision: http://reviews.llvm.org/D17453 llvm-svn: 263422
* Remove compile time PreserveName in favor of a runtime cc1 ↵Mehdi Amini2016-03-131-0/+2
| | | | | | | | | | | | | | | | | | | | -discard-value-names option Summary: This flag is enabled by default in the driver when NDEBUG is set. It is forwarded on the LLVMContext to discard all value names (but GlobalValue) for performance purpose. This an improved version of D18024 Reviewers: echristo, chandlerc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18127 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 263394
* Accept absolute paths in the -fuse-ld option.Peter Zotov2016-03-091-13/+20
| | | | | | | | | | | | | | | | | | | | | | | | This patch extends the -fuse-ld option to accept a full path to an executable and use it verbatim to invoke the linker. There are generally two reasons to desire this. The first reason relates to the sad truth is that Clang is retargetable, Binutils are not. While any Clang from a binary distribution is sufficient to compile code for a wide range of architectures and prefixed BFD linkers (e.g. installed as /usr/bin/arm-none-linux-gnueabi-ld) as well as cross-compiled libc's (for non-bare-metal targets) are widely available, including on all Debian derivatives, it is impossible to use them together because the -fuse-ld= option allows to specify neither a linker prefix nor a full path to one. The second reason is linker development, both when porting existing linkers to new architectures and when working on a new linker such as LLD. Differential Revision: http://reviews.llvm.org/D17952 llvm-svn: 262996
* clang-cl: Enable PCH flags by default.Nico Weber2016-03-041-8/+0
| | | | | | | | | | | | | Now that pragma comment and pragma detect_mismatch are implemented, this might just work. Some pragmas aren't serialized yet (from the top of my head: code_seg, bss_seg, data_seg, const_seg, init_seg, section, vtordisp), but these are as far as I know usually pushed and popped within the header and usually don't leak out. If it turns out the current PCH support isn't good enough yet, we can turn it off again. llvm-svn: 262749
* Switch krait to use -mcpu=cortex-a15 for assembler tool invocations.Stephen Hines2016-03-041-2/+2
| | | | | | | | | | | | | | | | | Summary: Using -no-integrated-as causes -mcpu=krait to be transformed into -march=armv7-a today. This precludes the assembler from using instructions like sdiv, which are present for krait. Cortex-a15 is the closest subset of functionality for krait, so we should switch the assembler to use that instead. Reviewers: cfe-commits, apazos, weimingz Subscribers: aemerson Differential Revision: http://reviews.llvm.org/D17874 llvm-svn: 262742
* [ARM] Add Clang targeting for ARMv8-M Baseline/MainlineBradley Smith2016-03-031-0/+4
| | | | llvm-svn: 262619
* clang-cl pch test: Instead of copying the input, use /Fp to not write into ↵Nico Weber2016-03-021-1/+1
| | | | | | | | | the test directory. Also fix a bug with /Fp and absolute paths uncovered by this. Follow-up to r262487. llvm-svn: 262541
* [PGO] Change profile use cc1 option to handle IR level profilesRong Xu2016-03-021-2/+3
| | | | | | | | | | | | | | | | | | This patch changes cc1 option for PGO profile use from -fprofile-instr-use=<path> to -fprofile-instrument-use-path=<path>. -fprofile-instr-use=<path> is now a driver only option. In addition to decouple the cc1 option from the driver level option, this patch also enables IR level profile use. cc1 option handling now reads the profile header and sets CodeGenOpt ProfileUse (valid values are {None, Clang, LLVM} -- this is a common enum for -fprofile-instrument={}, for the profile instrumentation), and invoke the pipeline to enable the respective PGO use pass. Reviewers: silvas, davidxl Differential Revision: http://reviews.llvm.org/D17737 llvm-svn: 262515
* [libFuzzer] allow -fsanitize-coverage=0 (disables all coverage)Kostya Serebryany2016-03-021-2/+1
| | | | llvm-svn: 262503
* clang-cl: Implement initial limited support for precompiled headers.Nico Weber2016-03-013-2/+194
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the gcc precompiled header model, one explicitly runs clang with `-x c++-header` on a .h file to produce a gch file, and then includes the header with `-include foo.h` and if a .gch file exists for that header it gets used. This is documented at http://clang.llvm.org/docs/UsersManual.html#precompiled-headers cl.exe's model is fairly different, and controlled by the two flags /Yc and /Yu. A pch file is generated as a side effect of a regular compilation when /Ycheader.h is passed. While the compilation is running, the compiler keeps track of #include lines in the main translation unit and writes everything up to an `#include "header.h"` line into a pch file. Conversely, /Yuheader.h tells the compiler to skip all code in the main TU up to and including `#include "header.h"` and instead load header.pch. (It's also possible to use /Yc and /Yu without an argument, in that case a `#pragma hrdstop` takes the role of controlling the point where pch ends and real code begins.) This patch implements limited support for this in that it requires the pch header to be passed as a /FI force include flag – with this restriction, it can be implemented almost completely in the driver with fairly small amounts of code. For /Yu, this is trivial, and for /Yc a separate pch action is added that runs before the actual compilation. After r261774, the first failing command makes a compilation stop – this means if the pch fails to build the main compilation won't run, which is what we want. However, in /fallback builds we need to run the main compilation even if the pch build fails so that the main compilation's fallback can run. To achieve this, add a ForceSuccessCommand that pretends that the pch build always succeeded in /fallback builds (the main compilation will then fail to open the pch and run the fallback cl.exe invocation). If /Yc /Yu are used in a setup that clang-cl doesn't implement yet, clang-cl will now emit a "not implemented yet; flag ignored" warning that can be disabled using -Wno-clang-cl-pch. Since clang-cl doesn't yet serialize some important things (most notably `pragma comment(lib, ...)`, this feature is disabled by default and only enabled by an internal driver flag. Once it's more stable, this internal flag will disappear. (The default stdafx.h setup passes stdafx.h as explicit argument to /Yc but not as /FI – instead every single TU has to `#include <stdafx.h>` as first thing it does. Implementing support for this should be possible with the approach in this patch with minimal frontend changes by passing a --stop-at / --start-at flag from the driver to the frontend. This is left for a follow-up. I don't think we ever want to support `#pragma hdrstop`, and supporting it with this approach isn't easy: This approach relies on the driver knowing the pch filename in advance, and `#pragma hdrstop(out.pch)` can set the output filename, so the driver can't know about it in advance.) clang-cl now also honors /Fp and puts pch files in the same spot that cl.exe would put them, but the pch file format is of course incompatible. This has ramifications on /fallback, so /Yc /Yu aren't passed through to cl.exe in /fallback builds. http://reviews.llvm.org/D17695 llvm-svn: 262420
* Introduce -fembed-bitcode driver optionSteven Wu2016-03-014-10/+65
| | | | | | | | | | | | | | | | | | | | | Summary: This is the clang driver part of the change to embedded bitcode. This includes: 1. -fembed-bitcode option which breaks down the compilation into two stages. The first stage emits optimized bitcode and the second stage compiles bitcode into object file. 2. -fembed-bitcode-marker option which doesn't really break down to two stages to speedup the compilation flow. 3. pass the correct linker flag to darwin linker if tool chains supports embedded bitcode. Reviewers: rsmith, thakis Subscribers: thakis, cfe-commits Differential Revision: http://reviews.llvm.org/D17390 llvm-svn: 262282
* [clang-cl] /EHc should not effect functions with explicit exception ↵David Majnemer2016-02-292-7/+9
| | | | | | | | | | specifications Functions with an explicit exception specification have their behavior dictated by the specification. The additional /EHc behavior only comes into play if no exception specification is given. llvm-svn: 262198
* [clang-cl] /EHc should not have an effect on /EHaDavid Majnemer2016-02-291-1/+5
| | | | | | This matches behavior with MSVC. llvm-svn: 262197
* [Driver] Disable frame pointer elimination by default if target isAkira Hatanaka2016-02-261-0/+2
| | | | | | | | x86_64-pc-win32-macho. rdar://problem/24470634 llvm-svn: 261976
* Fix build by using hasFlag instead of hasArg.Peter Collingbourne2016-02-241-2/+2
| | | | llvm-svn: 261782
* Bail on compilation as soon as a job fails.Justin Lebar2016-02-241-30/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: (Re-land of r260448, which was reverted in r260522 due to a test failure in Driver/output-file-cleanup.c that only showed up in fresh builds.) Previously we attempted to be smart; if one job failed, we'd run all jobs that didn't depend on the failing job. Problem is, this doesn't work well for e.g. CUDA compilation without -save-temps. In this case, the device-side and host-side Assemble actions (which actually are responsible for preprocess, compile, backend, and assemble, since we're not saving temps) are necessarily distinct. So our clever heuristic doesn't help us, and we repeat every error message once for host and once for each device arch. The main effect of this change, other than fixing CUDA, is that if you pass multiple cc files to one instance of clang and you get a compile error, we'll stop when the first cc1 job fails. Reviewers: echristo Subscribers: cfe-commits, jhen, echristo, tra, rafael Differential Revision: http://reviews.llvm.org/D17217 llvm-svn: 261774
* Add whole-program vtable optimization feature to Clang.Peter Collingbourne2016-02-241-0/+26
| | | | | | | | | This patch introduces the -fwhole-program-vtables flag, which enables the whole-program vtable optimization feature (D16795) in Clang. Differential Revision: http://reviews.llvm.org/D16821 llvm-svn: 261767
* AArch64: fix Cyclone CPU features list.Tim Northover2016-02-241-1/+4
| | | | | | It turns out we don't have CRC after all. Who knew? llvm-svn: 261758
* Rename Action::begin() to Action::input_begin().Nico Weber2016-02-233-19/+20
| | | | | | | | Also introduce inputs() that reutnrs an llvm::iterator_range. Iterating over A->inputs() is much less mysterious than iterating over *A. No intended behavior change. llvm-svn: 261674
* [WebAssembly] Initial driver support for standard library paths.Dan Gohman2016-02-222-2/+49
| | | | llvm-svn: 261560
* Don't enable /GX by defaultDavid Majnemer2016-02-221-1/+3
| | | | | | | The /GX flag is disabled unless explicitly specified on the command line. This partially addresses PR26698. llvm-svn: 261537
* [MSVC Compat] Implement -EHc semanticsDavid Majnemer2016-02-201-3/+3
| | | | | | | The -EHc flag implicitly adds a nothrow attribute to any extern "C" function when exceptions are enabled. llvm-svn: 261425
* [MSVC Compat] Add support for /GX, /GX-David Majnemer2016-02-201-5/+12
| | | | | | These are legacy flags which map to /EHsc and /EHs-c- respectively. llvm-svn: 261424
* [modules] Flatten -fmodule-name= and -fmodule-implementation-of= into a singleRichard Smith2016-02-191-1/+1
| | | | | | | | | | | | option. Previously these options could both be used to specify that you were compiling the implementation file of a module, with a different set of minor bugs in each case. This change removes -fmodule-implementation-of, and instead tracks a flag to determine whether we're currently building a module. -fmodule-name now behaves the same way that -fmodule-implementation-of previously did. llvm-svn: 261372
* Make deprecation message for -fsanitize-coverage= with numeric argument ↵Nico Weber2016-02-181-3/+11
| | | | | | | | friendlier. http://reviews.llvm.org/D17397 llvm-svn: 261247
* [MSVC] Turn C++ EH on my defaultDavid Majnemer2016-02-181-5/+3
| | | | | | | | | Our support for C++ EH is sufficiently good that it makes sense to enable support for it out of the box. While we are here, update the MSVCCompatibility doc. llvm-svn: 261195
* [sanitizer-coverage] allow -fsanitize-coverage=trace-pc w/o any other ↵Kostya Serebryany2016-02-181-51/+55
| | | | | | sanitizer and w/o ...=[func,bb,edge]. This makes this syntax a superset of the GCC's syntax llvm-svn: 261182
* [sanitizer-coverage] add a deprecation warning for -fsanitize-coverage=[1234]Kostya Serebryany2016-02-171-0/+2
| | | | llvm-svn: 261178
* [sanitizer-coverage] implement -fsanitize-coverage=trace-pc. This is similar ↵Kostya Serebryany2016-02-171-1/+9
| | | | | | to trace-bb, but has a different API. We already use the equivalent flag in GCC for Linux kernel fuzzing. We may be able to use this flag with AFL too llvm-svn: 261159
* Enable SafeStack for CloudABI.Ed Schouten2016-02-172-0/+8
| | | | | | | | | | | | | | | | | Summary: I've got a patchset in my home directory to integrate support for SafeStack into CloudABI's C library. All of the CloudABI unit tests still seem to pass. Pretty sweet! This change adds the necessary changes to Clang to make -fsanitize=safe-stack work on CloudABI. Without it, passing this command line flag throws an error. Reviewers: eugenis, samsonov Differential Revision: http://reviews.llvm.org/D17243 llvm-svn: 261135
* [CUDA] pass debug options to ptxas.Artem Belevich2016-02-161-9/+11
| | | | | | | | | ptxas optimizations are disabled if we need to generate debug info as ptxas does not accept '-g' otherwise. Differential Revision: http://reviews.llvm.org/D17111 llvm-svn: 261018
* Darwin: fix stdlib handling when CLANG_DEFAULT_STDLIB is setTim Northover2016-02-151-1/+1
| | | | | | | | | I'd accidentally skipped the CMake check in a premature optimisation. I'd also put the original test in completely the wrong place. Thanks Jonas Hahnfeld! llvm-svn: 260898
* As reported in https://llvm.org/bugs/show_bug.cgi?id=25496, on FreeBSD,Dimitry Andric2016-02-142-0/+18
| | | | | | | | | | | | | | | | C++ programs compiled for profiling (using `-pg`) should be linked with `-lc++_p` (or `-lstdc++_p`, depending on the `-stdlib=` setting), not with the regular C++ libraries. Add a `FreeBSD::AddCXXStdlibLibArgs()` override to handle this, and add a test case for it. While here, extend the test case for the proper passing of -lm and -lm_p. Reviewers: compnerd, davide, dws, emaste Reviewed By: compnerd Differential Revision: http://reviews.llvm.org/D16264 llvm-svn: 260851
* Fix remaining Clang-tidy readability-redundant-control-flow warnings; other ↵Eugene Zelenko2016-02-123-9/+0
| | | | | | | | minor fixes. Differential revision: http://reviews.llvm.org/D17218 llvm-svn: 260757
* Darwin: pass -stdlib=libc++ down to cc1 whenever we're targeting libc++Tim Northover2016-02-121-0/+6
| | | | | | | Recent refactoring meant it only got passed down when explicitly specified, which breaks header search on Darwin. llvm-svn: 260755
* [CMake] Add option to switch default C++ stdlibJonas Hahnfeld2016-02-123-29/+39
| | | | | | | | | With this option one can optionally override the architecture dependent default library to use if no -stdlib= is provided on compiler invocation. Differential Revision: http://reviews.llvm.org/D15920 llvm-svn: 260662
* Remove decision logic for old NetBSD development versions, the 7.0Joerg Sonnenberger2016-02-112-2/+2
| | | | | | release made this obsolete. llvm-svn: 260617
* Now that Sparc/Sparc64 backend is mostly usable, provide the sameJoerg Sonnenberger2016-02-112-0/+4
| | | | | | | linking defaults as other NetBSD targets, i.e. compiler_rt-in-libc and libc++ as STL. llvm-svn: 260616
* [Driver] Add support for Qualcomm's Kryo CPU.Chad Rosier2016-02-111-1/+2
| | | | | | http://reviews.llvm.org/D17124 llvm-svn: 260555
* [ARM] Add command-line options for ARMv8.2-AOliver Stannard2016-02-111-4/+0
| | | | | | | | | | | | | | | | | This allows ARMv8.2-A to be targeted either by using "armv8.2a" in the triple, or by using -march=armv8.2-a (or the alias -march=armv8.2a). The FP16 extension can be enabled with the "+fp16" suffix to the -march or -mcpu option. This is consistent with the AArch64 option, rather than the usual ARM option of -mfpu. We have agreed with the team which will be upstreaming this to GCC that we want to use this new option format for new architecture extensions for both ARM and AArch64. Most of the work for this was done by the TargetParser patch in llvm. Differential Revision: http://reviews.llvm.org/D15040 llvm-svn: 260533
* Revert "Bail on compilation as soon as a job fails."Rafael Espindola2016-02-111-8/+30
| | | | | | | | This reverts commit r260448. It was causing Driver/output-file-cleanup.c to fail. llvm-svn: 260522
* Remove unused ToolChain arg from Driver::ConstructPhaseAction and BuildAction.Justin Lebar2016-02-111-13/+9
| | | | | | | | | | | | | | | | Summary: Actions don't depend on the toolchain; they get bound to a particular toolchain via BindArch. No functional changes. Reviewers: echristo Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D17100 llvm-svn: 260478
* Bail on compilation as soon as a job fails.Justin Lebar2016-02-101-30/+8
| | | | | | | | | | | | | | | | | | | | | | | | Previously we attempted to be smart; if one job failed, we'd run all jobs that didn't depend on the failing job. Problem is, this doesn't work well for e.g. CUDA compilation without -save-temps. In this case, the device-side and host-side Assemble actions (which actually are responsible for preprocess, compile, backend, and assemble, since we're not saving temps) are necessarily distinct. So our clever heuristic doesn't help us, and we repeat every error message once for host and once for each device arch. The main effect of this change, other than fixing CUDA, is that if you pass multiple cc files to one instance of clang and you get a compile error, we'll stop when the first cc1 job fails. Reviewers: tra, echristo Subscribers: jhen, cfe-commits Differential Revision: http://reviews.llvm.org/D16514 llvm-svn: 260448
* [clang-cl] /Z7 now generates normal debug info, not just line infoReid Kleckner2016-02-101-5/+2
| | | | | | | | | Previously LLVM could not process any debug info we produced, so it didn't make sense to spend time generating it. Now that it has primitive support for local variable info, it does make sense to generate normal debug info. llvm-svn: 260435
* Driver: adjust linker invocation for GNUToolsSaleem Abdulrasool2016-02-071-7/+10
| | | | | | | | | | | | | | | Adjust the driver to invoke the linker more similar to gcc. -dynamic-linker is only passed if -static and -shared are not part of the compiler (driver) invocation. Replicate the passing of -export-rdynamic as per the GCC link spec: %{!static: %{rdynamic:-export-dynamic} %{!shared:-dynamic-linker ...}} This behaviour is consistent across all the targets that are supported, so no need to conditionalise it on the target. Resolves PR24245. llvm-svn: 260019
* Move DebugInfoKind enum from Driver to Basic. NFCPaul Robinson2016-02-051-1/+1
| | | | llvm-svn: 259935
* [PGO] cc1 option name change for profile instrumentationRong Xu2016-02-041-4/+6
| | | | | | | | | | | | This patch changes cc1 option -fprofile-instr-generate to an enum option -fprofile-instrument={clang|none}. It also changes cc1 options -fprofile-instr-generate= to -fprofile-instrument-path=. The driver level option -fprofile-instr-generate and -fprofile-instr-generate= remain intact. This change will pave the way to integrate new PGO instrumentation in IR level. Review: http://reviews.llvm.org/D16730 llvm-svn: 259811
* Move DebugInfoKind into its own header to cut the cyclic dependency edge ↵Benjamin Kramer2016-02-022-26/+25
| | | | | | from Driver to Frontend. llvm-svn: 259489
OpenPOWER on IntegriCloud