summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Tools.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert "[Driver] Quote clang full version in dwarf producer when invoking cc1as"Bruno Cardoso Lopes2016-05-021-2/+1
| | | | | | | | | | | | | | This reverts commit r264813 / 6484b95d634f53dd929c75265ef3c4decf397584. While using it in the shell is fine, this a problem when cc1as is invoked directly by the driver because single quoting the clang full version makes cc1as write out the version with the quotes in the final binary. If the user wants to copy-n-pastable output, it could use either -### or CC_PRINT_OPTIONS=1 clang -v ... llvm-svn: 268297
* Re-apply r267784, r267824 and r267830.Peter Collingbourne2016-04-281-26/+13
| | | | | | I have updated the compiler-rt tests. llvm-svn: 267903
* Revert r267784, r267824 and r267830.Benjamin Kramer2016-04-281-13/+26
| | | | | | | | | | It makes compiler-rt tests fail if the gold plugin is enabled. Revert "Rework interface for bitset-using features to use a notion of LTO visibility." Revert "Driver: only produce CFI -fvisibility= error when compiling." Revert "clang/test/CodeGenCXX/cfi-blacklist.cpp: Exclude ms targets. They would be non-cfi." llvm-svn: 267871
* Rework interface for bitset-using features to use a notion of LTO visibility.Peter Collingbourne2016-04-271-26/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Bitsets, and the compiler features they rely on (vtable opt, CFI), only have visibility within the LTO'd part of the linkage unit. Therefore, only enable these features for classes with hidden LTO visibility. This notion is based on object file visibility or (on Windows) dllimport/dllexport attributes. We provide the [[clang::lto_visibility_public]] attribute to override the compiler's LTO visibility inference in cases where the class is defined in the non-LTO'd part of the linkage unit, or where the ABI supports calling classes derived from abstract base classes with hidden visibility in other linkage units (e.g. COM on Windows). If the cross-DSO CFI mode is enabled, bitset checks are emitted even for classes with public LTO visibility, as that mode uses a separate mechanism to cause bitsets to be exported. This mechanism replaces the whole-program-vtables blacklist, so remove the -fwhole-program-vtables-blacklist flag. Because __declspec(uuid()) now implies [[clang::lto_visibility_public]], the support for the special attr:uuid blacklist entry is removed. Differential Revision: http://reviews.llvm.org/D18635 llvm-svn: 267784
* [esan] EfficiencySanitizer driver flagsDerek Bruening2016-04-211-0/+2
| | | | | | | | | | | | | | | | Summary: Adds a framework to enable the instrumentation pass for the new EfficiencySanitizer ("esan") family of tools. Adds a flag for esan's cache fragmentation tool via -fsanitize=efficiency-cache-frag. Adds appropriate tests for the new flag. Reviewers: eugenis, vitalybuka, aizatsky, filcab Subscribers: filcab, kubabrecka, llvm-commits, zhaoqin, kcc Differential Revision: http://reviews.llvm.org/D19169 llvm-svn: 267059
* Compilation for Intel MCU (Part 1/3)Andrey Turetskiy2016-04-211-0/+7
| | | | | | | | | | | Add -miamcu option which: * Sets IAMCU triple * Sets IAMCU ABI * Enforces static compilation Differential Revision: http://reviews.llvm.org/D18398 llvm-svn: 266972
* Fix PR26999 better- RenderDebugEnablingArgs() once onlyDouglas Katzman2016-04-191-22/+22
| | | | llvm-svn: 266797
* Pass dwarf-version to cc1as.Douglas Katzman2016-04-191-0/+6
| | | | | | Fix PR26999 - crashing in cc1as with any '*bsd' target. llvm-svn: 266775
* Revert r266747 (Compilation for Intel MCU (Part 1/3)) since it breaks a few ↵Andrey Turetskiy2016-04-191-7/+0
| | | | | | buildbots. llvm-svn: 266753
* Compilation for Intel MCU (Part 1/3)Andrey Turetskiy2016-04-191-0/+7
| | | | | | | | | | | Add -miamcu option which: * Sets IAMCU triple * Sets IAMCU ABI * Enforces static compilation Differential Revision: http://reviews.llvm.org/D18398 llvm-svn: 266747
* [CUDA] Add --no-cuda-noopt-debug, which disables --cuda-noopt-debug.Justin Lebar2016-04-191-1/+2
| | | | | | | | | | Reviewers: tra Subscribers: cfe-commits, jhen Differential Revision: http://reviews.llvm.org/D19251 llvm-svn: 266708
* ARM: make Darwin's "-arch armv7em" default to hard-float.Tim Northover2016-04-131-1/+6
| | | | | | | | | | We've already paid the price for separate "armv7m" and "armv7em" slices (support in other tools), it's silly to make them identical other than the default CPU. rdar://23055688 llvm-svn: 266211
* [AMDGPU] Add debugger related target optionsKonstantin Zhuravlyov2016-04-121-0/+20
| | | | | | Differential Revision: http://reviews.llvm.org/D18748 llvm-svn: 266133
* Always use --eh-frame-hdr on FreeBSD, even for -staticEd Maste2016-04-121-1/+1
| | | | | | | | | | | | FreeBSD uses LLVM's libunwind on FreeBSD/arm64 today (and is expected to use it more widely in the future), and it requires the EH frame segment in static binaries. This is the same as r203742 for NetBSD. Differential Revision: http://reviews.llvm.org/D19029 llvm-svn: 266123
* Allow simultaneous safestack and stackprotector attributes.Evgeniy Stepanov2016-04-111-9/+4
| | | | | | | | | This is the clang part of http://reviews.llvm.org/D18846. SafeStack instrumentation pass adds stack protector canaries if both attributes are present on a function. StackProtector pass will step back if the function has a safestack attribute. llvm-svn: 266005
* Enable PIE for CloudABI.Ed Schouten2016-04-061-0/+6
| | | | | | | | | | | | | | | | | | As we're currently working on making CloudABI executables easier to emulate in userspace (e.g., on OS X and Windows), it makes a whole lot of sense to build these using PIE. By using PIE, they can simply be loaded into the existing process address space without clashes. PIE support got added to CloudABI's C library and seems to work pretty well. CloudABI does not make use of an ld.so, so the binary's _start() has all the logic in it to do the relocations. Now that all but one bug in LLD relating to PIE support have been squashed (and a patch for that is already in code review), I'd like to go ahead and force the use of PIE for Clang 3.9. When released, we'll also switch over to using LLD exclusively. llvm-svn: 265546
* Add -fno-jump-tables and-fjump-tables flagsNirav Dave2016-04-051-0/+4
| | | | | | | | | | | | | Add no-jump-tables flag to disable use of jump tables when lowering switch statements Reviewers: echristo, hans Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D18407 llvm-svn: 265425
* clang-cl: Don't skip i_group flags other than -include when building pchs.Nico Weber2016-04-021-1/+2
| | | | | | | Before this change, e.g. -isystem flags in front of the /FI corresponding to the pch file would be incorrectly ignored. llvm-svn: 265238
* [DarwinDriver] Increase the number of valid digits for ld64 version string.Bruno Cardoso Lopes2016-03-311-5/+2
| | | | | | | | | | Previously only 3 digits were valid. Increase it to 5. Differential Revision: http://reviews.llvm.org/D18304 rdar://problem/24843016 llvm-svn: 264987
* [Driver] Quote clang full version in dwarf producer when invoking cc1asBruno Cardoso Lopes2016-03-301-1/+2
| | | | | | | | | Convenience to allow easy copy-n-paste from clang -v output when reproducing cc1as comandline. rdar://problem/23959295 llvm-svn: 264813
* [CUDA] Remove three obsolete CUDA cc1 flags.Justin Lebar2016-03-291-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: * -fcuda-target-overloads Previously unconditionally set to true by the driver. Necessary for correct functioning of the compiler -- our CUDA headers wrapper won't compile without this. * -fcuda-disable-target-call-checks Previously unconditionally set to true by the driver. Necessary to compile almost any external CUDA code -- almost all libraries assume that host+device code can call host or device functions. * -fcuda-allow-host-calls-from-host-device No effect when target overloading is enabled. Reviewers: tra Subscribers: rsmith, cfe-commits Differential Revision: http://reviews.llvm.org/D18416 llvm-svn: 264739
* [AMDGPU] Switch linker to amdphdrs + update testKonstantin Zhuravlyov2016-03-291-1/+0
| | | | | | Differential Revision: http://reviews.llvm.org/D18253 llvm-svn: 264737
* [lanai] Add Lanai backend to clang driver.Jacques Pienaar2016-03-281-0/+37
| | | | | | | | | | Changes to clang to add Lanai backend. Adds a new target, ABI and toolchain. General Lanai backend discussion on llvm-dev thread "[RFC] Lanai backend" (http://lists.llvm.org/pipermail/llvm-dev/2016-February/095118.html). Differential Revision: http://reviews.llvm.org/D17002 llvm-svn: 264655
* Modules builds are necessarily compile actions, but they don'tEric Christopher2016-03-241-1/+1
| | | | | | | necessarily produce object files. Turn off split dwarf if we're not producing a file that the driver believes is an object file. llvm-svn: 264227
* clang-cl: Add a FIXME for bumping the default msc version.Nico Weber2016-03-231-0/+1
| | | | llvm-svn: 264216
* clang-cl: Add more tests for the interaction of /FI and /Yc /Yu.Nico Weber2016-03-231-2/+4
| | | | | | | | | | | | Most things even work; see the included FIXMEs for things that need polishing. Also don't warn about unused flags for the `/Yuh2.h /FIh1.h /FIh2.h`. The common case is that the pch was built with `/Ych2.h /FIh1.h /FIh2.h`, so h1.h is in the PCH, and we shouldn't warn about /FIh1.h not having an effect. (If we wanted to get fancy, we could store the list of -include flags in the pch and then check that it matches later on.) llvm-svn: 264178
* Revert r263974, "clang-cl: With -fmsc-version=1900, use MSVS2015 diag ↵NAKAMURA Takumi2016-03-211-1/+0
| | | | | | | | formatting." It seems the test wouldn't expect if default target is *-win32. llvm-svn: 264007
* Revert "Convert some ObjC msgSends to runtime calls."Pete Cooper2016-03-211-12/+0
| | | | | | | | | | | | | | This reverts commit r263607. This change caused more objc_retain/objc_release calls in the IR but those are then incorrectly optimized by the ARC optimizer. Work is going to have to be done to ensure the ARC optimizer doesn't optimize user written RR, but that should land before this change. This change will also need to be updated to take account for any changes required to ensure that user written calls to RR are distinct from those inserted by ARC. llvm-svn: 263984
* clang-cl: With -fmsc-version=1900, use MSVS2015 diag formatting.Nico Weber2016-03-211-0/+1
| | | | llvm-svn: 263974
* [modules] Don't invent a module cache path unless implicit module builds are ↵Richard Smith2016-03-211-22/+20
| | | | | | enabled. llvm-svn: 263970
* Minor code cleanups. NFC.Junmo Park2016-03-171-1/+1
| | | | llvm-svn: 263694
* Convert some ObjC msgSends to runtime calls.Pete Cooper2016-03-161-0/+12
| | | | | | | | | | | | | | It is faster to directly call the ObjC runtime for methods such as retain/release instead of sending a message to those functions. This patch adds support for converting messages to retain/release/alloc/autorelease to their equivalent runtime calls. Tests included for the positive case of applying this transformation, negative tests that we ensure we only convert "alloc" to objc_alloc, not "alloc2", and also a driver test to ensure we enable this only for supported runtime versions. Reviewed by John McCall. Differential Revision: http://reviews.llvm.org/D14737 llvm-svn: 263607
* Myriad: Pass -mcpu to movi{Compile,Asm}Douglas Katzman2016-03-151-3/+6
| | | | | | Differential Revision: http://reviews.llvm.org/D18186 llvm-svn: 263556
* [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
* 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
* [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
* clang-cl: Implement initial limited support for precompiled headers.Nico Weber2016-03-011-1/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-011-0/+20
| | | | | | | | | | | | | | | | | | | | | 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-291-6/+8
| | | | | | | | | | 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
* 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-231-2/+2
| | | | | | | | 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-221-2/+44
| | | | 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
OpenPOWER on IntegriCloud