summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Tools.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [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
* [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
* [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
* [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
* Remove decision logic for old NetBSD development versions, the 7.0Joerg Sonnenberger2016-02-111-1/+1
| | | | | | release made this obsolete. llvm-svn: 260617
* Now that Sparc/Sparc64 backend is mostly usable, provide the sameJoerg Sonnenberger2016-02-111-0/+2
| | | | | | | 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
* [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
* [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-021-24/+23
| | | | | | from Driver to Frontend. llvm-svn: 259489
* ARMv7k: select ABI based on v7k Arch rather than watchos OS.Tim Northover2016-01-271-1/+2
| | | | | | | | Various bits we'd like to use the new ABI actually compile with "-arch armv7k -miphoneos-version-min=9.0". Not ideal, but also not ridiculous given how slices work. llvm-svn: 258976
* Revert "[Driver] Make sure -fno-math-builtin option is being passed by the ↵Chad Rosier2016-01-261-3/+2
| | | | | | | | driver." This reverts commit r258814. llvm-svn: 258815
* [Driver] Make sure -fno-math-builtin option is being passed by the driver.Chad Rosier2016-01-261-2/+3
| | | | | | | | | | Support for the -fno-math-builtin option was added in r186899. The codegen side is being tested in test/CodeGen/nomathbuiltin.c. The missing part was just passing the option through the driver. PR26317 llvm-svn: 258814
* [Driver] Update FIXME comment now that PR4941 has been addressed.Chad Rosier2016-01-261-1/+1
| | | | | | The actual fix should be addressed by someone who can test on Darwin. llvm-svn: 258813
* [cfi] Cross-DSO CFI diagnostic mode (clang part)Evgeniy Stepanov2016-01-251-1/+4
| | | | | | | | | | | | | | * Runtime diagnostic data for cfi-icall changed to match the rest of cfi checks * Layout of all CFI diagnostic data changed to put Kind at the beginning. There is no ABI stability promise yet. * Call cfi_slowpath_diag instead of cfi_slowpath when needed. * Emit __cfi_check_fail function, which dispatches a CFI check faliure according to trap/recover settings of the current module. * A tiny driver change to match the way the new handlers are done in compiler-rt. llvm-svn: 258745
* [CUDA] Disable ctor/dtor aliases in device code.Justin Lebar2016-01-251-3/+5
| | | | | | | | | | | | Summary: NVPTX doesn't support aliases, so don't generate them. Reviewers: tra Subscribers: cfe-commits, jhen, echristo Differential Revision: http://reviews.llvm.org/D16499 llvm-svn: 258733
* [MSVC Compat] Only warn for unknown clang-cl argumentsEhsan Akhgari2016-01-251-0/+4
| | | | | | | | | | | | | | | | | Summary: MSVC's driver accepts all unknown arguments but warns about them. clang by default rejects all unknown arguments. This causes issues specifically with build systems such as autoconf which liberally pass things such as $LDFLAGS to the compiler and expect everything to work. This patch teaches clang-cl to ignore unknown driver arguments. Reviewers: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D16511 llvm-svn: 258720
* LTO via the gold plugin needs to be told about debugger tuning.Paul Robinson2016-01-251-0/+11
| | | | | | Differential Revision: http://reviews.llvm.org/D16094 llvm-svn: 258712
* Pass --wrap=pthread_create to linker for -fsplit-stack.Rafael Espindola2016-01-251-0/+3
| | | | | | | | | | | | | From https://gcc.gnu.org/ml/gcc-patches/2010-09/msg01807.html -fsplit-stack should pass --wrap=pthread_create to linker for -fsplit-stack It is needed to initialize the stack guard. This fixes PR 20148. Patch by H.J Lu! llvm-svn: 258698
* [CUDA] Use Triple::isNVPTX() instead of enumerating nvptx && nvptx64.Justin Lebar2016-01-231-4/+2
| | | | | | | | | | Summary: No functional changes. Subscribers: tra, echristo, jhen, cfe-commits Differential Revision: http://reviews.llvm.org/D16495 llvm-svn: 258640
* [driver] Enable some static analyzer "unix" checkers on Windows.Devin Coughlin2016-01-211-2/+11
| | | | | | | | | | | | Many of the "unix" checkers are not actually unix-specific and would be valuable to run on Windows. This commit explicitly enables those checkers on Windows. A patch by Alexander Riccio! Differential Revision: http://reviews.llvm.org/D16245 llvm-svn: 258426
* [CUDA] Handle -O options (more) correctly.Justin Lebar2016-01-191-4/+29
| | | | | | | | | | | | | | Summary: Previously we'd crash the driver if you passed -O0. Now we try to handle all of clang's various optimization flags in a sane way. Reviewers: tra Subscribers: cfe-commits, echristo, jhen Differential Revision: http://reviews.llvm.org/D16307 llvm-svn: 258174
* [Cygwin] Use -femulated-tls by default since r257718 introduced the new pass.NAKAMURA Takumi2016-01-161-1/+1
| | | | | | FIXME: Add more targets to use emutls into clang/test/Driver/emulated-tls.cpp. FIXME: Add cygwin tests into llvm/test/CodeGen/X86. Working in progress. llvm-svn: 257984
* Introduce -fsanitize-stats flag.Peter Collingbourne2016-01-161-10/+28
| | | | | | | | | This is part of a new statistics gathering feature for the sanitizers. See clang/docs/SanitizerStats.rst for further info and docs. Differential Revision: http://reviews.llvm.org/D16175 llvm-svn: 257971
* [CUDA] Invoke ptxas and fatbinary during compilation.Justin Lebar2016-01-141-0/+78
| | | | | | | | | | | | | | | | | | | | Summary: Previously we compiled CUDA device code to PTX assembly and embedded that asm as text in our host binary. Now we compile to PTX assembly and then invoke ptxas to assemble the PTX into a cubin file. We gather the ptx and cubin files for each of our --cuda-gpu-archs and combine them using fatbinary, and then embed that into the host binary. Adds two new command-line flags, -Xcuda_ptxas and -Xcuda_fatbinary, which pass args down to the external tools. Reviewers: tra, echristo Subscribers: cfe-commits, jhen Differential Revision: http://reviews.llvm.org/D16082 llvm-svn: 257809
* [mips] Added support for -Wa,-mips32 and similar.Scott Egerton2016-01-141-1/+25
| | | | | | | | | | Reviewers: vkalintiris, dsanders Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15070 llvm-svn: 257762
* Revert r257602 because it breaks integrated-as.s on mips hosts.Scott Egerton2016-01-131-24/+1
| | | | llvm-svn: 257610
* [mips] Added support for -Wa,-mips32 and similar.Scott Egerton2016-01-131-1/+24
| | | | | | | | | | Reviewers: vkalintiris, dsanders Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15070 llvm-svn: 257602
* Generalize r256026 to apply to all MachO targets, not just Darwin targets.Bob Wilson2016-01-131-2/+3
| | | | | | | | The PIC default is set for the MachO toolchain, not just the Darwin toolchain, so this treats those the same. The behavior with -static should be the same for all MachO targets. rdar://24152327 llvm-svn: 257556
* Add an Action* member to InputInfo.Justin Lebar2016-01-111-2/+2
| | | | | | | | | | | | | | Summary: The CUDA toolchain needs to know which Actions created which InputInfos, because it needs to attach GPU archs to the various InputInfos. Reviewers: echristo Subscribers: jfb, dschuff, jhen, tra, cfe-commits Differential Revision: http://reviews.llvm.org/D16078 llvm-svn: 257411
* Driver: Use the new ELF lld linker for AMDGPUTom Stellard2016-01-081-4/+0
| | | | | | | | | | | | Summary: 'gnu-old' has been deprecated in favor or 'gnu'. Reviewers: arsenm, ruiu, rafael Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15953 llvm-svn: 257175
* Make sure we claim arguments that are going to be passed to a gcc tool,Eric Christopher2016-01-071-5/+6
| | | | | | even if they're not going to be used to avoid unused option warnings. llvm-svn: 257040
* Replace a loop with the call that does the same thing.Eric Christopher2016-01-071-2/+1
| | | | llvm-svn: 257014
* [WebAssembly] Enable -fvisibility=hidden by default.Dan Gohman2016-01-071-0/+15
| | | | | | | This, along with many things in the WebAssembly target, is experimental. Feedback is welcome. llvm-svn: 257006
* [WebAssembly] Enable -ffunction-sections and -fdata-sections by default.Dan Gohman2016-01-071-3/+8
| | | | | | | These remain user-overridable with -fno-function-sections and -fno-data-sections. llvm-svn: 257005
* [WebAssembly] Only enable --gc-sections when optimizations are enabled.Dan Gohman2016-01-071-1/+2
| | | | | | | Also, revamp the wasm-toolchain.c test and add a test to ensure that a user-supplied --no-gc-sections comes after --gc-sections. llvm-svn: 257004
* [WebAssembly] Add --gc-sections to the link line.Dan Gohman2016-01-061-0/+5
| | | | | | | | This will eventually be accompanied with a change to enable -ffunction-sections and -fdata-sections by default, which is currently delayed by some development process issues. llvm-svn: 256967
* [Driver] Add support for -fno-builtin-foo options.Chad Rosier2016-01-061-3/+25
| | | | | | | Addresses PR4941 and rdar://6756912. http://reviews.llvm.org/D15195 llvm-svn: 256937
OpenPOWER on IntegriCloud