summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Tools.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [ARM] Allow passing/returning of __fp16 argumentsOliver Stannard2015-09-031-2/+12
| | | | | | | | | | | | | | | | | | | | | The ACLE (ARM C Language Extensions) 2.0 allows the __fp16 type to be used as a functon argument or return type (ACLE 1.1 did not). The current public release of the AAPCS (2.09) states that __fp16 values should be converted to single-precision before being passed or returned, but AAPCS 2.10 (to be released shortly) changes this, so that they are passed in the least-significant 16 bits of either a GPR (for base AAPCS) or a single-precision register (for AAPCS-VFP). This does not change how arguments are passed if they get passed on the stack. This patch brings clang up to compliance with the latest versions of both of these specs. We can now set the __ARM_FP16_ARGS ACLE predefine, and we have always been able to set the __ARM_FP16_FORMAT_IEEE predefine (we do not support the alternative format). llvm-svn: 246764
* Revert 246755 as it breaks buildbotsOliver Stannard2015-09-031-12/+2
| | | | | | | | | | | | | | | | | | | | | | | | Original commit message: [ARM] Allow passing/returning of __fp16 arguments The ACLE (ARM C Language Extensions) 2.0 allows the __fp16 type to be used as a functon argument or return type (ACLE 1.1 did not). The current public release of the AAPCS (2.09) states that __fp16 values should be converted to single-precision before being passed or returned, but AAPCS 2.10 (to be released shortly) changes this, so that they are passed in the least-significant 16 bits of either a GPR (for base AAPCS) or a single-precision register (for AAPCS-VFP). This does not change how arguments are passed if they get passed on the stack. This patch brings clang up to compliance with the latest versions of both of these specs. We can now set the __ARM_FP16_ARGS ACLE predefine, and we have always been able to set the __ARM_FP16_FORMAT_IEEE predefine (we do not support the alternative format). llvm-svn: 246760
* [ARM] Allow passing/returning of __fp16 argumentsOliver Stannard2015-09-031-2/+12
| | | | | | | | | | | | | | | | | | | | | The ACLE (ARM C Language Extensions) 2.0 allows the __fp16 type to be used as a functon argument or return type (ACLE 1.1 did not). The current public release of the AAPCS (2.09) states that __fp16 values should be converted to single-precision before being passed or returned, but AAPCS 2.10 (to be released shortly) changes this, so that they are passed in the least-significant 16 bits of either a GPR (for base AAPCS) or a single-precision register (for AAPCS-VFP). This does not change how arguments are passed if they get passed on the stack. This patch brings clang up to compliance with the latest versions of both of these specs. We can now set the __ARM_FP16_ARGS ACLE predefine, and we have always been able to set the __ARM_FP16_FORMAT_IEEE predefine (we do not support the alternative format). llvm-svn: 246755
* Remove inadvertent debug output from prior change.Douglas Katzman2015-09-021-1/+0
| | | | llvm-svn: 246715
* Use new utility function to clean leading junk from pathnames. NFCDouglas Katzman2015-09-021-0/+1
| | | | llvm-svn: 246714
* [Shave]: pass through more clang options to moviCompileDouglas Katzman2015-09-021-0/+1
| | | | llvm-svn: 246652
* Stop hardcoding GCC paths in crt/ld.so lookup.Rafael Espindola2015-08-311-34/+20
| | | | | | | | | | This patch refactors the code to use the GCC installation detector (modified so that it works in Solaris), and uses ToolChain::GetFilePath everywhere once it works. Patch by Xan López <xan@igalia.com>! llvm-svn: 246473
* Update for several APIs in LLVM that now use StringRefs rather thanChandler Carruth2015-08-301-12/+9
| | | | | | | | const char pointers. In turn, push this through Clang APIs as well, simplifying a number of bits of code that was handling the oddities of nullptrs. llvm-svn: 246375
* Update for API change in LLVM: ARMTargetParser class is just the ARMChandler Carruth2015-08-301-11/+11
| | | | | | namespace. llvm-svn: 246368
* Support Debian s390x multiarch pathsSylvestre Ledru2015-08-281-1/+1
| | | | | | | | | | Summary: Patch by Steven Chamberlain <steven@pyro.eu.org> Reviewers: uweigand Differential Revision: http://reviews.llvm.org/D12430 llvm-svn: 246295
* Add a -gmodules option to the driver and a -dwarf-ext-refs to cc1Adrian Prantl2015-08-271-0/+6
| | | | | | | | | | | | | to enable the use of external type references in the debug info (a.k.a. module debugging). The driver expands -gmodules to "-g -fmodule-format=obj -dwarf-ext-refs" and passes that to cc1. All this does at the moment is set a flag codegenopts. http://reviews.llvm.org/D11958 llvm-svn: 246192
* [ARM] Error out if float-ab=hard and abi=apcs-gnu on macho platforms.Akira Hatanaka2015-08-261-4/+15
| | | | | | | | | | | | | | | | Error out if -mfloat-abi=hard or -mhard-float is specified on the command line and the target ABI is APCS. Previously clang issued no warnings or errors and just passed the option to the backend, which had no effect on code generation for targets using APCS. This commit corrects the patch commited in r245866, which didn't take into account the fact that not all darwin targets use APCS. rdar://problem/22257950 http://reviews.llvm.org/D12344 llvm-svn: 246054
* Revert r245866.Akira Hatanaka2015-08-241-4/+0
| | | | | | This commit was causing buildbot failures. llvm-svn: 245871
* [ARM] Error out on apple darwin platforms if float-abi is "hard".Akira Hatanaka2015-08-241-0/+4
| | | | | | | | | | | | | Error out if the user tries to use float-abi="hard" since it isn't supported on darwin platforms. Previously clang issued no warnings or erros and just passed the option to the backend, which had no effect on code generation for targets using apcs. rdar://problem/22257950 Differential Revision: http://reviews.llvm.org/D12155 llvm-svn: 245866
* Stop treating -static as overriding -fPIC: they are distinct.James Y Knight2015-08-211-4/+2
| | | | | | | | | | | | | | | | | For some reason, clang had been treating a command like: clang -static -fPIC foo.c as if it should be compiled without the PIC relocation model. This was incorrect: -static should be affecting only the linking model, and -fPIC only the compilation. This new behavior also matches GCC. This is a follow-up from a review comment on r245447. Differential Revision: http://reviews.llvm.org/D12208 llvm-svn: 245667
* Revert r245344.Evgeniy Stepanov2015-08-201-1/+0
| | | | | | | | That change is causing strange test failures on Fedora 22 (PR24503), and it does not have any effect with Gold linker anyway (PR15823, https://sourceware.org/bugzilla/show_bug.cgi?id=18859). llvm-svn: 245619
* [Sparc] Add '-EL' when invoking gcc to link little-endian binaries.Douglas Katzman2015-08-201-4/+14
| | | | | | Differential Revision: http://reviews.llvm.org/D12201 llvm-svn: 245595
* Silence a "not all control paths return a value" warning; NFC.Aaron Ballman2015-08-201-1/+1
| | | | llvm-svn: 245562
* Properly pass through the PIC mode to the integrated assembler whenJames Y Knight2015-08-191-162/+201
| | | | | | | | | | | | | | | | | | doing assembly-only, and unify the Driver's PIC argument parsing. On a few architectures, parsing of assembly files annoyingly depends on whether PIC is enabled or not. This was handled for external 'as' already (passing -KPIC), but was missed for calls to the standalone internal assembler. The integrated-as.s test needed to be modified to not expect -fsanitize=address to be unused, as now fsanitize *IS* used for assembly, since -fsanitize=memory can sometimes imply -fPIE, which the assembler needs to know (gack!!). Differential Revision: http://reviews.llvm.org/D11845 llvm-svn: 245447
* [ARM] Proper generic cpus handlingVladimir Sukharev2015-08-191-3/+3
| | | | | | | | | | | | | | "generic" cpu was wrongly handled as exact real CPU name of ARMv8.1A architecture. This has been fixed, now it is abstract name, suitable for any arch. Reviewers: rengolin Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11640 llvm-svn: 245445
* [OPENMP] Link libomp.lib on WindowsAlexey Bataev2015-08-191-0/+21
| | | | | | | Adds libomp.lib for -fopenmp=libomp and libiomp5md.lib for -fopenmp=libiomp5 on Windows Differential Revision: http://reviews.llvm.org/D11932 llvm-svn: 245414
* [sanitizer] Add -lutil to static runtime link flags.Evgeniy Stepanov2015-08-181-0/+1
| | | | | | | This is needed to prevent breakage of -Wl,-as-needed link when interceptors for functions in libutil are added. See PR15823. llvm-svn: 245344
* Tiny cleanup: move some Triple variables up to the top of theJames Y Knight2015-08-151-21/+27
| | | | | | function, and remove a duplicate var. llvm-svn: 245154
* [Driver] Fix handling of -fbuiltin/-fcommon when combined with -mkernelJohn Brawn2015-08-101-18/+10
| | | | | | | | | | | -mkernel enables -fno-builtin and -fno-common by default, but allows -fbuiltin and -fcommon to override that. However "-fbuiltin -fno-builtin" is treated the same as "-fbuiltin" which is wrong, so fix that. Also fixes similar behaviour when -fno-common is default. Differential Revision: http://reviews.llvm.org/D11459 llvm-svn: 244437
* Teach mingw toolchain driver to properly emit static or dynamic linking of ↵Yaron Keren2015-08-091-2/+18
| | | | | | | | | | ligcc. Implemented in MinGW::Linker::AddLibGCC since AddLibgcc is a logic puzzle even before adding one more boolean. A first step towards simplification of AddLibgcc would be to factor out the Android AddLibgcc code into its own routine. llvm-svn: 244407
* Add -fno-coverage-mapping flag.Diego Novillo2015-08-051-2/+5
| | | | | | | This new flag allows the user to disable a previous instance of -fcoverage-mapping, if needed. llvm-svn: 244170
* Add flags to disable profile generation.Diego Novillo2015-08-051-28/+39
| | | | | | | | | | | | This patch adds flags -fno-profile-instr-generate and -fno-profile-instr-use, and the GCC aliases -fno-profile-generate and -fno-profile-use. These flags are used in situations where users need to disable profile generation or use for specific files in a build, without affecting other files. llvm-svn: 244153
* Add -gcodeview and -gdwarf to control which type Clang emitsReid Kleckner2015-08-051-2/+16
| | | | | | | | | | | | | | | Summary: By default, 'clang' emits dwarf and 'clang-cl' emits codeview. You can force emission of one or both by passing -gcodeview and -gdwarf to either driver. Reviewers: dblaikie, hans Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11742 llvm-svn: 244097
* Claim arguments that belong to 'clang_ignored_gcc_optimization_f_Group'Douglas Katzman2015-08-051-0/+1
| | | | | | | | | | This seems preferable to printing two warnings per unsupported option- one warning about not supporting it, and one about not using it. It also makes the '-Wno-' option do what you mean. Differential Revision: http://reviews.llvm.org/D11766 llvm-svn: 244079
* [SHAVE] Pass all -f, -g, -O, -W options through directly to moviCompile.Douglas Katzman2015-08-031-16/+11
| | | | | | Differential Revision: http://reviews.llvm.org/D11581 llvm-svn: 243878
* Split DWARF: Allow -gmlt/-gsplit-dwarf to override rather than complement ↵David Blaikie2015-07-301-6/+7
| | | | | | | | | | | | | | each other It doesn't make any sense to enable -gmlt with -gsplit-dwarf, since -gmlt is designed for on-line symbolication (and -gsplit-dwarf normally emits all the -gmlt data into the .o anyway - so there's nothing to split out except redundant/duplicate info). With this change they override each other, -gmlt -gsplit-dwarf is the same as -gsplit-dwarf and -gsplit-dwarf -gmlt is the same as -gmlt. llvm-svn: 243694
* [ARM] Allow setting the generic features for native cpusRenato Golin2015-07-301-23/+32
| | | | | | | | | | | | | | | | | Copying the already existing code for x86 to ARM to set the correct CPU features when using -mcpu=native. We can already detect the CPU name but we were not setting the correct feature bits. Moving fpu/hwdiv down to make sure they override whatever we set the default to be. No tests because this is native detection, and not all ARM-enabled builds will hapen at a specific CPU, or even ARM. I have tested locally and it works as expected. Fixes PR12794. llvm-svn: 243656
* Add support for System z vector language extensionsUlrich Weigand2015-07-301-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The z13 vector facility has an associated language extension, closely modeled on AltiVec/VSX. The main differences are: - vector long, vector float and vector pixel are not supported - vector long long and vector double are supported (like VSX) - comparison operators return a vector rather than a scalar integer - shift operators behave like the OpenCL shift operators - vector bool is only supported as argument to certain operators; some operators allow mixing a bool with a non-bool vector This patch adds clang support for the extension. It is closely modelled on the AltiVec support. Similarly to the -faltivec option, there's a new -fzvector option to enable the extensions (as well as an -mzvector alias for compatibility with GCC). There's also a separate LangOpt. The extension as implemented here is intended to be compatible with the -mzvector extension recently implemented by GCC. Based on a patch by Richard Sandiford. Differential Revision: http://reviews.llvm.org/D11001 llvm-svn: 243642
* Use the AddAllArgs overload which accepts an ArrayRef of OptSpecifier.Douglas Katzman2015-07-291-46/+29
| | | | | | Differential Revision: http://reviews.llvm.org/D11599 llvm-svn: 243552
* [AArch64] Pass subtarget feature "+strict-align".Akira Hatanaka2015-07-291-9/+5
| | | | | | | | | | This commit changes the driver to save subtarget feature "+strict-align" to the IR instead of using backend option "aarch64-strict-align". This is needed for LTO. rdar://problem/21529937 llvm-svn: 243518
* [ARM] Pass subtarget feature "+strict-align".Akira Hatanaka2015-07-281-21/+36
| | | | | | | | | | | | | | This commit changes the driver to save subtarget feature "+strict-align" to the IR instead of using backend option "arm-strict-align". This is needed for LTO. Also, move the logic in ARM backend that was deciding whether strict alignment should be forced to the front-end. rdar://problem/21529937 http://reviews.llvm.org/D11472 llvm-svn: 243489
* Add -femulated-tls flag to select the emulated TLS model.Chih-Hung Hsieh2015-07-281-0/+6
| | | | | | | | | This will be used for old targets like Android that do not support ELF TLS models. Differential Revision: http://reviews.llvm.org/D10524 llvm-svn: 243441
* Use TargetParser to parse -mhwdiv command line option in Driver.Alexandros Lamprineas2015-07-281-13/+2
| | | | | | Change-Id: I2ebc40f77af75ec6b43ce8364d6d5a1d29988bd6 Phabricator: http://reviews.llvm.org/D11501 llvm-svn: 243398
* [ARM] Implement -Wa,-mfpu and friends for assemblersRenato Golin2015-07-271-62/+115
| | | | | | | | | | | This patch allows Clang to pass on -Wa,-mfpu, -Wa,-mhwdiv and -Wa,-mcpu to the integrated assembler (via target-features), but -march is still not being passed, but validated. In case the command line has both -mxxx and -Wa,-mxxx, we warn that the naked one will not be used in assembler mode. llvm-svn: 243353
* [ARM] Changes to Arch/CPU handling to help with -Wa,-mfpu etc. (nfc)Renato Golin2015-07-271-36/+75
| | | | | | | | | | | | To be able to handle -Wa, options in the assembler (ClangAs), we need to make the handling of options based on the value of the options, not direct Arguments from the list, since the list is immutable. No functional change in this patch, but this allows validating of -Wa,-mfpu and friends in the same way we validate -mfpu and friends, *just* for the assembler. llvm-svn: 243352
* [AArch64] Unconditionally pass subtarget feature reserve-x18 on Darwin.Akira Hatanaka2015-07-271-3/+5
| | | | | | | After r243308, the front-end is responsible for checking the target OS and passing reserve-x18 if the target is Darwin. llvm-svn: 243310
* Rename {Hexagon,NaCl}_TC to {Hexagon,NaCl}ToolChain respectively. NFCDouglas Katzman2015-07-271-23/+24
| | | | | | | | | Also rename XCore (the toolchain) to XCoreToolChain since XCore is also a namespace for its tools. Differential Revision: http://reviews.llvm.org/D10609 llvm-svn: 243279
* Setting ARM dynamic linker name from commandlineRenato Golin2015-07-271-2/+4
| | | | | | | | | | Currently trigger to select hard-float linker is only based of -gnueabihf appearing in target triplet, but we should also select it when hardfloat is requested via cmdline. Patch by Khem Raj. llvm-svn: 243262
* [clang-cl] Handle -O correctlyDavid Majnemer2015-07-271-4/+18
| | | | | | | | | | | | | | | We had multiple bugs here: - We didn't support multiple optimization options in one argument. e.g. -O2y- - We didn't correctly expand -O[12dx] to their respective options. - We treated -O1 as clang -O1 instead of clang -Os. - We treated -Ox as clang -O3 instead of clang -O2. In fact, cl's -Ox option is *less* powerful than cl's -O2 option despite -Ox described as "Full Optimization". This fixes PR24003. llvm-svn: 243261
* [clang-cl] Add fallback support for /ZlDavid Majnemer2015-07-251-0/+1
| | | | llvm-svn: 243207
* [AArch64] Pass subtarget feature "+reserve-x18" instead of passing backendAkira Hatanaka2015-07-251-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
* [clang-cl] Implement support for the /Zl flagDavid Majnemer2015-07-241-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
* [Compiler-RT] Remove dependency on libgcc_s/ehRenato Golin2015-07-231-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
* [mingw] Add support for -rtlib option and -stdlib option to the mingw driverReid Kleckner2015-07-221-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
* Pass -I options to integrates and external assemblersRenato Golin2015-07-221-0/+4
| | | | | | | | Fixes PR21000. Patch by Artem Belevich. llvm-svn: 242904
OpenPOWER on IntegriCloud