summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Tools.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [ARM] Add support for ARMV6K subtarget (Clang)Renato Golin2015-03-171-3/+4
| | | | | | | | | | | | | | | | | | | | | ARMv6K is another layer between ARMV6 and ARMV6T2. This is the Clang side of the changes. ARMV6 family LLVM implementation. +-------------------------------------+ | ARMV6 | +----------------+--------------------+ | ARMV6M (thumb) | ARMV6K (arm,thumb) | <- From ARMV6K and ARMV6M processors +----------------+--------------------+ have support for hint instructions | ARMV6T2 (arm,thumb,thumb2) | (SEV/WFE/WFI/NOP/YIELD). They can +-------------------------------------+ be either real or default to NOP. | ARMV7 (arm,thumb,thumb2) | The two processors also use +-------------------------------------+ different encoding for them. Patch by Vinicius Tinti. llvm-svn: 232469
* Fix grammar in a comment, wrap to 80 columns. No behavior change.Nico Weber2015-03-121-2/+3
| | | | llvm-svn: 232087
* [PowerPC] ABI support for the QPX vector instruction setHal Finkel2015-03-111-1/+14
| | | | | | | | | | | | | | Support for the QPX vector instruction set, used on the IBM BG/Q supercomputer, has recently been added to the LLVM PowerPC backend. This vector instruction set requires some ABI modifications because the ABI on the BG/Q expects <4 x double> vectors to be provided with 32-byte stack alignment, and to be handled as native vector types (similar to how Altivec vectors are handled on mainline PPC systems). I've named this ABI variant elfv1-qpx, have made this the default ABI when QPX is supported, and have updated the ABI handling code to provide QPX vectors with the correct stack alignment and associated register-assignment logic. llvm-svn: 231960
* Gender-neutralize a comment.Nico Weber2015-03-111-2/+2
| | | | llvm-svn: 231891
* Much like we silence warnings about -flto in many cases to facilitateChandler Carruth2015-03-071-0/+2
| | | | | | | | | | | simplicity in build systems, silence '-stdlib=libc++' when linking. Even if we're not linking C++ code per-se, we may be passing this flag so that when we are linking C++ code we pick up the desired standard library. While most build systems already provide separate C and C++ compile flags, many conflate link flags. Sadly, CMake is among them causing this warning in a libc++ selfhost. llvm-svn: 231559
* Pass -dll to link.exe when building with -shared (PR22697)Hans Wennborg2015-03-041-1/+3
| | | | | | And start building a test for non-clang-cl link.exe invocations. llvm-svn: 231312
* Don't force -pie for Android.Dan Albert2015-03-031-5/+1
| | | | | | | | | | | | | | | | | | | Summary: There is no -no-pie flag that can override this, so making it default to being on for Android means it is no longer possible to create non-PIE executables on Android. While current versions of Android support (and the most recent requires) PIE, ICS and earlier versions of Android cannot run PIE executables, so this needs to be optional. Reviewers: srhines Reviewed By: srhines Subscribers: thakis, volkalexey, cfe-commits Differential Revision: http://reviews.llvm.org/D8015 llvm-svn: 231091
* [SDK modernizer]. Patch fixes driver's lack ofFariborz Jahanian2015-03-031-0/+1
| | | | | | | recognition of mernizer's -objcmt-migrate-property-dot-syntax option with a new test in test/Driver. rdar://19994452 llvm-svn: 231080
* Revert r231008 (and dependent r231019).Daniel Jasper2015-03-031-1/+0
| | | | | | | | | As Chandler responded on the initial commit, just directly setting the triple through -Xclang option to the driver creates havoc on other platforms. The driver test should specifically go into test/Driver and test the cc1 commandline itself. llvm-svn: 231063
* [SDK modernizer]. Patch fixes driver's lack ofFariborz Jahanian2015-03-021-0/+1
| | | | | | | recognition of mernizer's -objcmt-migrate-property-dot-syntax option. rdar://19994452 llvm-svn: 231008
* Add clang support for Objective-C application extensions.Bob Wilson2015-03-021-0/+10
| | | | | | | | This adds the -fapplication-extension option, along with the ios_app_extension and macosx_app_extension availability attributes. Patch by Ted Kremenek llvm-svn: 230989
* Add missing include.Benjamin Kramer2015-03-011-0/+1
| | | | llvm-svn: 230910
* Add -fuse-line-directive flag to control usage of #line with -EReid Kleckner2015-02-261-0/+5
| | | | | | | | | | | | | | | | | | Currently -fms-extensions controls this behavior, which doesn't make much sense. It means we can't identify what is and isn't a system header when compiling our own preprocessed output, because #line doesn't represent this information. If someone is feeding Clang's preprocessed output to another compiler, they can use this flag. Fixes PR20553. Reviewers: rsmith Differential Revision: http://reviews.llvm.org/D5217 llvm-svn: 230587
* -fms-extensions: Bump the default _MSC_VER from 1700 to 1800, aka VS2013Reid Kleckner2015-02-231-1/+1
| | | | | | | | VS 2013 is the minimum supported version, so it's reasonable for Clang to simulate this by default. This also simplifies the clang-cl self-host, since we have the 18.00 version check. llvm-svn: 230243
* Move -fdefine-sized-deallocation and -fno-sized-deallocation options from ↵Larisse Voufo2015-02-211-9/+0
| | | | | | driver into CC1 for now. llvm-svn: 230112
* [Mips] Support mips32r3, mips32r5, mips64r3, mips64r5 MIPS ISA namesSimon Atanasyan2015-02-201-2/+2
| | | | | | | | | The patch teaches the clang's driver to understand new MIPS ISA names, pass appropriate options to the assembler, defines corresponding macros etc http://reviews.llvm.org/D7737 llvm-svn: 230092
* Implement Control Flow Integrity for virtual calls.Peter Collingbourne2015-02-201-3/+4
| | | | | | | | | | | | | | | This patch introduces the -fsanitize=cfi-vptr flag, which enables a control flow integrity scheme that checks that virtual calls take place using a vptr of the correct dynamic type. More details in the new docs/ControlFlowIntegrity.rst file. It also introduces the -fsanitize=cfi flag, which is currently a synonym for -fsanitize=cfi-vptr, but will eventually cover all CFI checks implemented in Clang. Differential Revision: http://reviews.llvm.org/D7424 llvm-svn: 230055
* Add -funique-section-names and -fno-unique-section-names options.Rafael Espindola2015-02-201-0/+4
| | | | | | | | | For now -funique-section-names is the default, so no change in default behavior. The total .o size in a build of llvm and clang goes from 241687775 to 230649031 bytes if -fno-unique-section-names is used. llvm-svn: 230031
* Add -fno-implicit-modules.Manuel Klimek2015-02-201-0/+6
| | | | | | | If this flag is set, we error out when a module build is required. This is useful in environments where all required modules are passed via -fmodule-file. llvm-svn: 230006
* Add -fno-sized-deallocation option for completeness of fix in r229241 in ↵Larisse Voufo2015-02-201-0/+4
| | | | | | documentation in r229818. llvm-svn: 229950
* Improve our handling of rtti/sanitize=vptr/sanitize=undefinedFilipe Cabecinhas2015-02-191-63/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the huge blob of code that is dealing with rtti/exceptions/sanitizers and replaces it with: A ToolChain function which, for a given set of Args, figures out if rtti should be: - enabled - disabled implicitly - disabled explicitly A change in the way SanitizerArgs figures out what sanitizers to enable (or if it should error out, or warn); And a check for exceptions/rtti interaction inside addExceptionArgs. The RTTIMode algorithm is: - If -mkernel, -fapple-kext, or -fno-rtti are passed, rtti was disabled explicitly; - If -frtti was passed or we're not targetting the PS4, rtti is enabled; - If -fexceptions or -fcxx-exceptions was passed and we're targetting the PS4, rtti was enabled implicitly; - If we're targetting the PS4, rtti is disabled implicitly; - Otherwise, rtti is enabled; Since the only flag needed to pass to -cc1 is -fno-rtti if we want to disable it, there's no problem in saying rtti is enabled if we're compiling C code, so we don't look at the input file type. addExceptionArgs now looks at the RTTIMode and warns that rtti is being enabled implicitly if targetting the PS4 and exceptions are on. It also errors out if, targetting the PS4, -fno-rtti was passed, and exceptions were turned on. SanitizerArgs now errors out if rtti was disabled explicitly and the vptr sanitizer was enabled implicitly, but just turns off vptr if rtti is disabled but -fsanitize=undefined was passed. Also fixed tests, removed duplicate name from addExceptionArgs comment, and added one or two surrounding lines when running clang-format. This changes test/Driver/fsanitize.c to make it not expect a warning when passed -fsanitize=undefined -fno-rtti, but expect vptr to not be on. Removed all users and definition of SanitizerArgs::sanitizesVptr(). Reviewers: samsonov Subscribers: llvm-commits, samsonov, rsmith Differential Revision: http://reviews.llvm.org/D7525 llvm-svn: 229801
* [ARM] Add missing M/R class CPUsBradley Smith2015-02-181-3/+3
| | | | | | | | | | | | Add some of the missing M and R class Cortex CPUs, namely: Cortex-M0+ (called Cortex-M0plus for GCC compatibility) Cortex-M1 SC000 SC300 Cortex-R5 llvm-svn: 229661
* Rename flags and options to match current naming: from -fdef-sized-delete to ↵Larisse Voufo2015-02-181-3/+3
| | | | | | -fdefine-sized-deallocation, and from DefaultSizedDelete to DefineSizedDeallocation. llvm-svn: 229597
* Replace snprintf with a Twine. NFC.Benjamin Kramer2015-02-141-5/+3
| | | | llvm-svn: 229264
* Revise the implementation logic of sized deallocation: Do not automatically ↵Larisse Voufo2015-02-141-0/+5
| | | | | | | | generate weak definitions of the sized operator delete (in terms of unsized operator delete). Instead, provide the funcitonality via a new compiler flag, -fdef-sized-delete. The current implementation causes link-time ODR violations when the delete symbols are exported into the dynamic table. llvm-svn: 229241
* Revert "Revert r229082 for a bit, it caused PR22577."David Majnemer2015-02-141-0/+13
| | | | | | | This reverts commit r229123. It was a red herring, the bug was present without r229082. llvm-svn: 229205
* Revert r229082 for a bit, it caused PR22577.Nico Weber2015-02-131-13/+0
| | | | llvm-svn: 229123
* MS ABI: Implement /volatile:msDavid Majnemer2015-02-131-0/+13
| | | | | | | | | | | | The /volatile:ms semantics turn volatile loads and stores into atomic acquire and release operations. This distinction is important because volatile memory operations do not form a happens-before relationship with non-atomic memory. This means that a volatile store is not sufficient for implementing a mutex unlock routine. Differential Revision: http://reviews.llvm.org/D7580 llvm-svn: 229082
* [PowerPC] Remove the --no-tls-optimize workaround from the clang driverBill Schmidt2015-02-101-7/+0
| | | | llvm-svn: 228739
* -iframework option should be forwarded to linkerSteven Wu2015-02-061-0/+6
| | | | | | | | | | | | | | | Summary: -iframework option is used to specified System framework path so the path specified should be passed to linker as -F option rdar://problem/18234544 Reviewers: bob.wilson Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D7106 llvm-svn: 228413
* [PowerPC] Re-disable linker optimizations for nowBill Schmidt2015-02-061-0/+7
| | | | llvm-svn: 228402
* Re-land r228258 and make clang-cl's /EHs- disable -fexceptions againReid Kleckner2015-02-051-3/+3
| | | | | | | | | | | After r228258, Clang started emitting C++ EH IR that LLVM wasn't ready to deal with, even when exceptions were disabled with /EHs-. This time, make /EHs- turn off -fexceptions while still emitting exceptional constructs in functions using __try. Since Sema rejects C++ exception handling constructs before CodeGen, landingpads should only appear in such functions as the result of a __try. llvm-svn: 228329
* [PowerPC] Revert workaround for TLS linker bugBill Schmidt2015-02-051-7/+0
| | | | | | | | | | | | | | | | In r227480, Ulrich Weigand introduced a workaround for a linker optimization bug that can create mis-optimized code for accesses to general-dynamic or local-dynamic TLS variables. The linker optimization bug only occurred for Clang/LLVM because of some inefficient code being generated for these TLS accesses. I have recently corrected LLVM to produce the efficient code sequence expected by the linkers, so this workaround is no longer needed. Therefore this patch reverts r227480. I've tested that the previous bootstrap failure no longer occurs with the workaround reverted. llvm-svn: 228253
* Driver: Stop forcing frame pointer usage on WindowsReid Kleckner2015-02-041-17/+39
| | | | | | | | | | | | | | | | | Previously, we would use a frame pointer by default on non-Linux OSs. On Linux, any optimization flags imply -fomit-frame-pointer. XCore always defaulted to -fomit-frame-pointer. Now x86 Windows matches our behavior on Linux. All other ISAs supported by Windows (ARM, x64) use xdata information, and frame pointers aren't useful. Frame pointers are now off by default for such targets, but can be forced via -fno-omit-frame-pointer and code using alloca(). In fact, on Win64 our frame-pointer prologue is not describable with UNWIND_INFO. This change is a workaround to avoid using the broken FP using prologue for most functions. This is PR22467. llvm-svn: 228236
* Replace isalnum with isAlphanumeric per reviewBen Langmuir2015-02-041-1/+2
| | | | | | Thanks Dmitri! llvm-svn: 228163
* Teaches the Clang driver to accept Cortex-A72Renato Golin2015-02-041-2/+2
| | | | | | | | | A previous commit added Cortex-A72 to LLVM, this teaches Clang to accept it as well. Patch by Ranjeet Singh. llvm-svn: 228141
* Make the default module cache user-specificBen Langmuir2015-02-031-1/+38
| | | | | | | | | Appends the username to the first component (after the temp dir) of the module cache path. If the username contains a character that shouldn't go into a path (for now conservatively allow [a-zA-Z0-9_]), we fallback to the user id. llvm-svn: 228013
* Use CLANG_LIBDIR_SUFFIX when looking for the gold plugin.Rafael Espindola2015-02-031-1/+2
| | | | | | Patch by İsmail Dönmez! llvm-svn: 227979
* PR 17421: Implemented -save-temps={obj|cwd} optionReid Kleckner2015-02-021-1/+1
| | | | | | | | | | | | | | | | | -save-temps=cwd is equivalent to -save-temps -save-temps=obj saves temporary file in the same directory as output This helps to avoid clobbering of temp files in case of parallel compilation with -save-temps of the files that have the same name but located in different directories. Patch by Artem Belevich Reviewed By: rnk Differential Revision: http://reviews.llvm.org/D7304 llvm-svn: 227886
* Tweak behavior due to -fexceptions, in C++ mode, imply -fcxx-exceptionsFilipe Cabecinhas2015-01-311-3/+11
| | | | | | Added test llvm-svn: 227695
* Fix regression in r227409 where we were passing -fsyntax-onlyEric Christopher2015-01-301-0/+1
| | | | | | | | in all cases. Patch by Artem Belevich. llvm-svn: 227591
* [mips] Pass ABI name via -target-abi instead of target-featuresDaniel Sanders2015-01-301-11/+24
| | | | | | | | | | | | | | Patch by Vladimir Medic Reviewers: echristo, atanasyan, dsanders Reviewed By: atanasyan, dsanders Subscribers: llvm-commits, echristo, atanasyan Differential Revision: http://reviews.llvm.org/D6091 llvm-svn: 227583
* Remove unneeded codeFilipe Cabecinhas2015-01-301-2/+1
| | | | | | | We don't really care about enabling RTTI with -fexceptions, only with -fcxx-exceptions. llvm-svn: 227567
* clang-cl: Enable -fexceptions but not -fcxx-exceptions by defaultReid Kleckner2015-01-301-3/+3
| | | | | | This enables proper IRgen of SEH constructs. llvm-svn: 227528
* Add some more PS4 driver settings related to rtti and exceptions.Filipe Cabecinhas2015-01-291-9/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The PS4 defaults to -fno-rtti, and has to have rtti enabled when enabling exceptions. This commit makes clang add the -fno-rtti by default on the PS4, unless -frtti was passed in. It also diagnoses misuses for the PS4: - Exceptions need rtti. Warn and enable rtti if no rtti flag was passed, error if -fno-rtti was passed. I also added a more general warning for when -fno-rtti is the default (currently it's only on the PS4) and the vptr sanitizer is on. Fixed a few tests, due to different flag order when passing cc1 arguments. Reviewers: chandlerc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D7250 llvm-svn: 227518
* [PowerPC] Work around TLS linker bugUlrich Weigand2015-01-291-0/+7
| | | | | | | | | | | Work around a bug in GNU ld (and gold) linker versions up to 2.25 that may mis-optimize code generated by this version of clang/LLVM to access general-dynamic or local-dynamic TLS variables. Bug is fixed here: https://sourceware.org/ml/binutils/2015-01/msg00318.html llvm-svn: 227480
* Ensure that -fsyntax-only with fortran 90 passes along silentlyEric Christopher2015-01-291-7/+12
| | | | | | | | | to the underlying gcc. PR22234 Patch by Artem Belevich. llvm-svn: 227409
* For the --be8 flag, check explicitly for pre-v7 / pre-v6m cores.Joerg Sonnenberger2015-01-281-2/+19
| | | | | | | | Those used the old Big Endian support on ARM and don't need flags. Refactor the logic in a separate common function, which also looks at -march. Add corresponding logic for the Linux toolchain. llvm-svn: 227393
* [clang] Use -android environment for all compiler-rt libs.Dan Albert2015-01-281-8/+6
| | | | | | | | | | | | | | | | Summary: This was already done for the sanitizers, but it needs to be done for the profile and builtin libs as well. Reviewers: srhines, timmurray, eugenis, samsonov Reviewed By: samsonov Subscribers: compnerd, cfe-commits Differential Revision: http://reviews.llvm.org/D7187 llvm-svn: 227392
* Fix part of r227215. PS4 code just omits leaf frame pointers.Filipe Cabecinhas2015-01-271-3/+4
| | | | llvm-svn: 227219
OpenPOWER on IntegriCloud