summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
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
* Add a new warning to notify users of mismatched SDK and deployment targetChris Bieneman2016-04-292-5/+45
| | | | | | | | | | | | | | | Summary: This patch adds a new driver warning -Wincompatible-sdk which notifies the user when they are mismatching the version min options and the sysroot. The patch works by checking the sysroot (if present) for an SDK name, then matching that against the target platform. In the case of a mismatch it logs a warning. Reviewers: bob.wilson, rsmith Subscribers: rsmith, edward-san, cfe-commits Differential Revision: http://reviews.llvm.org/D18088 llvm-svn: 268127
* Re-apply r267784, r267824 and r267830.Peter Collingbourne2016-04-282-26/+24
| | | | | | I have updated the compiler-rt tests. llvm-svn: 267903
* Revert r267784, r267824 and r267830.Benjamin Kramer2016-04-282-24/+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
* Driver: only produce CFI -fvisibility= error when compiling.Peter Collingbourne2016-04-281-8/+10
| | | | | | | The -fvisibility= flag only affects compile jobs, so there's no need to error out because of it if we aren't compiling (e.g. if we are only linking). llvm-svn: 267824
* Rework interface for bitset-using features to use a notion of LTO visibility.Peter Collingbourne2016-04-272-26/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* driver: Add a `--rsp-quoting` flag to pick response file quoting.Nico Weber2016-04-251-1/+2
| | | | | | | | | | | | | | | | | | | | Currently, clang-cl always uses Windows style for unquoting, and clang always uses POSIX style for unquoting. With this flag, it's possible to change these defaults. In general, response file quoting should match the shell the response file is used in. On Windows, it's possible to run clang-cl in a bash shell, or clang in cmd.exe, so a flag for overriding the default behavior is natural there. On non-Windows, Windows quoting probably never makes sense (except maybe in Wine), but having clang-cl behave differently based on the host OS seems strange too. So require that people who want to use posix-style response files with clang-cl on non-Windows pass --rsp-quoting=posix. http://reviews.llvm.org/D19425 llvm-svn: 267474
* [esan] EfficiencySanitizer driver flagsDerek Bruening2016-04-213-1/+16
| | | | | | | | | | | | | | | | 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
* clang-cl: Don't assert on using /Yc with non-source files, PR27450Nico Weber2016-04-211-19/+19
| | | | | | Move phase handling after input type validation. llvm-svn: 267040
* Compilation for Intel MCU (Part 1/3)Andrey Turetskiy2016-04-212-8/+40
| | | | | | | | | | | 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-192-40/+8
| | | | | | buildbots. llvm-svn: 266753
* Compilation for Intel MCU (Part 1/3)Andrey Turetskiy2016-04-192-8/+40
| | | | | | | | | | | 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
* [CUDA] Add --cuda-compile-host-device, which overrides --cuda-host-only and ↵Justin Lebar2016-04-191-11/+17
| | | | | | | | | | | | | | | | --cuda-device-only. Summary: This completes the flag's tristate, letting you override it at will on the command line. Reviewers: tra Subscribers: cfe-commits, jhen Differential Revision: http://reviews.llvm.org/D19248 llvm-svn: 266707
* [sanitizer-coverage] make sure coverage flags are not passed to clang if the ↵Kostya Serebryany2016-04-181-0/+2
| | | | | | driver thinks they are unused llvm-svn: 266673
* [CUDA] Raise an error if the CUDA install can't be found.Justin Lebar2016-04-161-4/+7
| | | | | | | | | | | | | | | Summary: Without this change, we silently proceed on without including __clang_cuda_runtime_wrapper.h. This leads to very strange behavior -- you say you're compiling CUDA code, but e.g. __device__ is not defined! Reviewers: tra Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19180 llvm-svn: 266496
* clang-cl: Don't check for existence of linker inputs when /link is usedHans Wennborg2016-04-151-7/+16
| | | | | | | | | There might be flags passed to the linker (e.g. /libpath), causing it to search in paths the Clang driver doesn't know about. PR27234 llvm-svn: 266402
* 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
* clang-cl: Remove -isystem, add -imsvc.Nico Weber2016-04-121-0/+4
| | | | | | | | | | | | | | | | | r260990 exposed -isystem in clang-cl. -isystem adds a directory to the front of the system include search path. The idea was to use this to point to a hermetic msvc install, but as it turns out this doesn't work: -isystem then adds the hermetic headers in front of clang's builtin headers, and clang's headers that are supposed to wrap msvc headers (say, stdarg.h) aren't picked up at all anymore. So revert that, and instead expose -imsvc which works as if the passed directory was part of %INCLUDE%: The header is treated as a system header, but it is searched after clang's lib/Header headers. Fixes half of PRPR26751. llvm-svn: 266108
* 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-062-1/+7
| | | | | | | | | | | | | | | | | | 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
* [CUDA] Add -fcuda-flush-denormals-to-zero.Justin Lebar2016-04-051-0/+4
| | | | | | | | | | | | | | | | | | Summary: Setting this flag causes all functions are annotated with the "nvvm-f32ftz" = "true" attribute. In addition, we annotate the module with "nvvm-reflect-ftz" set to 0 or 1, depending on whether -cuda-flush-denormals-to-zero is set. This is read by the NVVMReflect pass. Reviewers: tra, rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18671 llvm-svn: 265435
* 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
* [CrashReproducer] Pass -I, -F and -resource-dir to the reproducer script ↵Bruno Cardoso Lopes2016-04-041-4/+4
| | | | | | | | | | when using modules/vfs The reproducer should use -I/-F/-resource-dir in the same way as the original command. The VFS already collects the right headers but without these flags the reproducer will fail to do the right thing. llvm-svn: 265343
* 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
* [CrashReproducer] Add -fmodule-cache-path to reproducer scriptBruno Cardoso Lopes2016-04-011-0/+13
| | | | | | | | The cc1 invocation in the reproducer script should contain a valid path in -fmodule-cache-path; for that reuse "<name>.cache/module" dir we already use to dump the vfs and modules. llvm-svn: 265162
* [DarwinDriver] Increase the number of valid digits for ld64 version string.Bruno Cardoso Lopes2016-03-312-5/+30
| | | | | | | | | | Previously only 3 digits were valid. Increase it to 5. Differential Revision: http://reviews.llvm.org/D18304 rdar://problem/24843016 llvm-svn: 264987
* [CUDA] Don't initialize the CUDA toolchain if we don't have any CUDA inputs.Justin Lebar2016-03-301-4/+13
| | | | | | | | | | | | | | | | | | | | Summary: This prevents errors when you invoke clang with a flag that the NVPTX toolchain doesn't support. For example, on x86-64, clang -mthread-model single -x c++ /dev/null -o /dev/null should output just one error about "invalid thread model 'single' in '-mthread-model single' for this target"; x86-64 doesn't support -mthread-model, but we shouldn't also instantiate a NVPTX target! Reviewers: echristo Subscribers: tra, sunfish, cfe-commits Differential Revision: http://reviews.llvm.org/D18629 llvm-svn: 264965
* [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
* Enable the SafeStack sanitizer on CloudABI by default.Ed Schouten2016-03-293-0/+8
| | | | | | | | | | | | | | | | | | | Over the last month we've been testing SafeStack extensively. As far as we know, it works perfectly fine. That why I'd like to see us having this enabled by default for CloudABI. This change introduces a getDefaultSanitizers() function that toolchains can use to specify which sanitizers are enabled by default. Once all flags are processed, only flags that had no -fno-sanitize overrides are enabled. Extend the thests for CloudABI to test both the default case and the case in which we want to explicitly disable SafeStack. Reviewed by: eugenis, pcc Differential Revision: http://reviews.llvm.org/D18505 llvm-svn: 264787
* [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-292-2/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D18253 llvm-svn: 264737
* [lanai] Add Lanai backend to clang driver.Jacques Pienaar2016-03-284-0/+50
| | | | | | | | | | 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
* clang-cl: Don't warn about /Oy- being unused in 64-bit builds.Nico Weber2016-03-231-0/+6
| | | | | | http://reviews.llvm.org/D18392 llvm-svn: 264163
* 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
* [tsan] Allow -fsanitize=thread for iOS-style simulator targetsDevin Coughlin2016-03-201-1/+6
| | | | | | | | | Update the clang driver to allow -fsanitize=thread when targeting x86_64 iOS and tvOS simulators. Also restrict TSan targeting OS X to only be supported on x86_64 and not i386. Differential Revision: http://reviews.llvm.org/D18280 llvm-svn: 263913
* Remove usage of LLVM_PREFIX.Chaoren Lin2016-03-181-4/+0
| | | | | | | | | | | | Summary: LLVM_PREFIX could be undefined if CMAKE_INSTALL_PREFIX were set to empty. Reviewers: kparzysz, bkramer, chandlerc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D17784 llvm-svn: 263766
* 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
* [Driver] [Darwin] Fix linking libclang_rt.profile_*sim.aChris Bieneman2016-03-151-28/+2
| | | | | | | | | | | | Summary: isTarget*() calls are order-dependent. This is because iOS Sim *is* iOS. This means checks for the simulator version of the platform must always be ahead of checks for the embedded platform. Reviewers: zaks.anna, bogner Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D17947 llvm-svn: 263567
OpenPOWER on IntegriCloud