summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
...
* Update our list of distros a bit.Benjamin Kramer2015-04-061-6/+15
| | | | | | | | - Debian jessie will be released this month, add the next testing version to the list. - RHEL7 was released last june. - Ubuntu utopic was released last october, vivid will follow later this month. llvm-svn: 234149
* This reverts commit r234104, bringing back 233393 now that ARM is fixed.Rafael Espindola2015-04-061-3/+6
| | | | | | | | | | | Original message: Don't use unique section names by default if using the integrated as. This saves some IO and ccache space by not creating long section names. It should work with every ELF linker. llvm-svn: 234143
* Revert "Revert "Revert "Don't use unique section names by default if using ↵Rafael Espindola2015-04-041-6/+3
| | | | | | | | the integrated as.""" This reverts commit r234101. I will debug what went wrong with ARM. llvm-svn: 234104
* Revert "Revert "Don't use unique section names by default if using the ↵Rafael Espindola2015-04-041-3/+6
| | | | | | | | | | | | | | | integrated as."" This reverts commit r233398, bringing back 233393 now that LLVM is fixed. Original message: Don't use unique section names by default if using the integrated as. This saves some IO and ccache space by not creating long section names. It should work with every ELF linker. llvm-svn: 234101
* Complete comment. Reflow conditional.Eric Christopher2015-04-041-3/+2
| | | | llvm-svn: 234083
* Implement CFI type checks for non-virtual calls.Peter Collingbourne2015-04-021-1/+1
| | | | | | | | | | | | This uses the same class metadata currently used for virtual call and cast checks. The new flag is -fsanitize=cfi-nvcall. For consistency, the -fsanitize=cfi-vptr flag has been renamed -fsanitize=cfi-vcall. Differential Revision: http://reviews.llvm.org/D8756 llvm-svn: 233874
* [UBSan] Embed UBSan into ASan runtime (Clang part).Alexey Samsonov2015-04-013-15/+8
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Change the way we use ASan and UBSan together. Instead of keeping two separate runtimes (libclang_rt.asan and libclang_rt.ubsan), embed UBSan into ASan and get rid of libclang_rt.ubsan. If UBSan is not supported on a platform, all UBSan sources are just compiled into dummy empty object files. UBSan initialization code (e.g. flag parsing) is directly called from ASan initialization, so we are able to enforce correct initialization order. This mirrors the approach we already use for ASan+LSan. This change doesn't modify the way we use standalone UBSan. Test Plan: regression test suite Reviewers: kubabrecka, zaks.anna, kcc, rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8645 llvm-svn: 233860
* [SystemZ] Support transactional execution on zEC12Ulrich Weigand2015-04-011-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The zEC12 provides the transactional-execution facility. This is exposed to users via a set of builtin routines on other compilers. This patch adds clang support to enable those builtins. In partciular, the patch: - enables the transactional-execution feature by default on zEC12 - allows to override presence of that feature via the -mhtm/-mno-htm options - adds a predefined macro __HTM__ if the feature is enabled - adds support for the transactional-execution GCC builtins - adds Sema checking to verify the __builtin_tabort abort code - adds the s390intrin.h header file (for GCC compatibility) - adds s390 sections to the htmintrin.h and htmxlintrin.h header files Since this is first use of target-specific intrinsics on the platform, the patch creates the include/clang/Basic/BuiltinsSystemZ.def file and hooks it up in TargetBuiltins.h and lib/Basic/Targets.cpp. An associated LLVM patch adds the required LLVM IR intrinsics. For reference, the transactional-execution instructions are documented in the z/Architecture Principles of Operation for the zEC12: http://publibfp.boulder.ibm.com/cgi-bin/bookmgr/download/DZ9ZR009.pdf The associated builtins are documented in the GCC manual: http://gcc.gnu.org/onlinedocs/gcc/S_002f390-System-z-Built-in-Functions.html The htmxlintrin.h intrinsics provided for compatibility with the IBM XL compiler are documented in the "z/OS XL C/C++ Programming Guide". llvm-svn: 233804
* [X86] Use getHostCPUFeatures when 'native' is specified for cpu.Craig Topper2015-03-311-0/+11
| | | | | | This is necessary because not aall Sandybridge, Ivybrige, Haswell, and Broadwell CPUs support AVX. Currently we modify the CPU name back to Nehalem for this case, but that turns off additional features for these CPUs. llvm-svn: 233672
* Add driver support for Native Client SDKDerek Schuff2015-03-305-1/+390
| | | | | | | | | | | | | | Add Tool and ToolChain support for clang to target the NaCl OS using the NaCl SDK for x86-32, x86-64 and ARM. Includes nacltools::Assemble and Link which are derived from gnutools. They are similar to Linux but different enought that they warrant their own class. Also includes a NaCl_TC in ToolChains derived from Generic_ELF with library and include paths suitable for an SDK and independent of the system tools. Differential Revision: http://reviews.llvm.org/D8590 llvm-svn: 233594
* Revert "Don't use unique section names by default if using the integrated as."Rafael Espindola2015-03-271-6/+3
| | | | | | This reverts commit r233393 while a debug a bot failure. llvm-svn: 233398
* Don't use unique section names by default if using the integrated as.Rafael Espindola2015-03-271-3/+6
| | | | | | | This saves some IO and ccache space by not creating long section names. It should work with every ELF linker. llvm-svn: 233393
* Enable -ffunction-sections and -fdata-sections for CloudABI by default.Ed Schouten2015-03-261-2/+5
| | | | | | | | | | | | | | | | | | | | | | Unlike most of the other platforms supported by Clang, CloudABI only supports static linkage, for the reason that global filesystem access is prohibited. Functions provided by dlfcn.h are not present. As we know that applications will not try to do any symbol lookups at run-time, we can garbage collect unused code quite aggressively. Because of this, it makes sense to enable -ffunction-sections and -fdata-sections by default. Object files will be a bit larger than usual, but the resulting binary will not be affected, as the sections are merged again. However, when --gc-sections is used, the linker is able to remove unused code far more more aggressively. It also has the advantage that transitive library dependencies only need to be provided to the linker in case that functionality is actually used. Differential Revision: http://reviews.llvm.org/D8635 Reviewed by: echristo llvm-svn: 233299
* Let Clang invoke CloudABI's linker.Ed Schouten2015-03-265-0/+144
| | | | | | | | | | | | | | | | | | | | | | Now that CloudABI's target information and header search logic for Clang has been submitted, the only thing that remains to be done is adding support for CloudABI's linker. CloudABI uses Binutils ld, although there is some work to use lld instead. This means that this code is largely based on what we use on FreeBSD. There are some exceptions, however: - Only static linking is performed. CloudABI does not support any dynamically linked executables. - CloudABI uses compiler-rt, libc++ and libc++abi unconditionally. Link in these libraries instead of using libgcc_s, libstdc++, etc. - We must ensure that the .eh_frame_hdr is present to make C++ exceptions work properly. Differential Revision: http://reviews.llvm.org/D8250 llvm-svn: 233269
* [UBSan] Use shared library for UBSan on OS X (Clang part).Alexey Samsonov2015-03-232-34/+34
| | | | | | | | | | | | | | | | | | Summary: UBSan is now used in the same way as ASan, and is supported on OSX and on iOS simulator. At the moment ASan and UBSan can't be used together due to PR21112, but I hope to resolve it soon by embedding UBSan into ASan. Test Plan: regression test suite. Reviewers: zaks.anna, kubabrecka Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8471 llvm-svn: 233035
* [UBSan] Introduce "ubsan_standalone" library (Clang part).Alexey Samsonov2015-03-231-7/+10
| | | | | | | | | | | | Get rid of "libclang_rt.san" library that used to contain sanitizer_common pieces required by UBSan if it's used in a standalone mode. Instead, build two variants of UBSan runtime: "ubsan" and "ubsan_standalone" (same for "ubsan_cxx" and "ubsan_standalone_cxx"). Later "ubsan" and "ubsan_cxx" libraries will go away, as they will embedded it into corresponding ASan runtimes. llvm-svn: 233010
* Fix and update comments and a small reformatting.Eric Christopher2015-03-231-4/+3
| | | | llvm-svn: 232997
* handle armeb/thumb/thumbeb consistently in gnutools::Assemble::ConstructJobScott Douglass2015-03-231-5/+10
| | | | | | Differential Revision: http://reviews.llvm.org/D8196 llvm-svn: 232940
* Convert cascading if-else-if to switch. NFCScott Douglass2015-03-231-14/+32
| | | | | | Differential Revision: http://reviews.llvm.org/D8485 llvm-svn: 232939
* [multilib] Turn virtual functor into functin_refBenjamin Kramer2015-03-222-86/+48
| | | | | | And update code to use lambdas where possible, plus random cleanup. NFCI. llvm-svn: 232916
* MS ABI: Implement driver-level support for thread-safe staticsDavid Majnemer2015-03-221-27/+31
| | | | | | | | | | | Decide whether or not to use thread-safe statics depending on whether or not we have an explicit request from the driver. If we don't have an explicit request, infer which behavior to use depending on the compatibility version we are targeting. N.B. CodeGen support is still ongoing. llvm-svn: 232906
* Only add -fno-rtti if KernelOrKext or in C++ mode.Filipe Cabecinhas2015-03-201-2/+3
| | | | llvm-svn: 232869
* Don't claim exception related arguments when looking at RTTIModeFilipe Cabecinhas2015-03-201-1/+1
| | | | | | | | | | | | | | | | | | Summary: We were claiming the -f*exceptions arguments when looking for the RTTIMode. This makes us not warn about unused arguments if compiling a C file with -fcxx-exceptions. This patch fixes it by not claiming the exception-related arguments at that point. Reviewers: rsmith, samsonov Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8507 llvm-svn: 232860
* [UBSan] Don't allow to use UBSan with anything except for ASan.Alexey Samsonov2015-03-201-69/+66
| | | | | | | | | | We are not able to make a reliable solution for using UBSan together with other sanitizers with runtime support (and sanitizer_common). Instead, we want to follow the path used for LSan: have a "standalone" UBSan tool, and plug-in UBSan that would be explicitly embedded into specific sanitizers (in short term, it will be only ASan). llvm-svn: 232829
* C++14: Disable sized deallocation by default due to ABI breakageReid Kleckner2015-03-201-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are no widely deployed standard libraries providing sized deallocation functions, so we have to punt and ask the user if they want us to use sized deallocation. In the future, when such libraries are deployed, we can teach the driver to detect them and enable this feature. N3536 claimed that a weak thunk from sized to unsized deallocation could be emitted to avoid breaking backwards compatibility with standard libraries not providing sized deallocation. However, this approach and other variations don't work in practice. With the weak function approach, the thunk has to have default visibility in order to ensure that it is overridden by other DSOs providing sized deallocation. Weak, default visibility symbols are particularly expensive on MachO, so John McCall was considering disabling this feature by default on Darwin. It also changes behavior ELF linking behavior, causing certain otherwise unreferenced object files from an archive to be pulled into the link. Our second approach was to use an extern_weak function declaration and do an inline conditional branch at the deletion call site. This doesn't work because extern_weak only works on MachO if you have some archive providing the default value of the extern_weak symbol. Arranging to provide such an archive has the same challenges as providing the symbol in the standard library. Not to mention that extern_weak doesn't really work on COFF. Reviewers: rsmith, rjmccall Differential Revision: http://reviews.llvm.org/D8467 llvm-svn: 232788
* Allow -fsanitize-coverage with -fsanitize=dataflowKostya Serebryany2015-03-201-1/+1
| | | | | | | | | | | | | | | | Summary: Allow -fsanitize-coverage with -fsanitize=dataflow Test Plan: check-clang Reviewers: pcc Reviewed By: pcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8476 llvm-svn: 232787
* Ensure that we still parse preprocessed CUDA files as CUDA when we useArtem Belevich2015-03-191-2/+3
| | | | | | | | | -save-temps option. Summary: Fixes PR22926. Review: http://reviews.llvm.org/D8383 llvm-svn: 232737
* Add option to switch off putting header modules into the dependency file.Manuel Klimek2015-03-191-2/+3
| | | | llvm-svn: 232721
* Remove many superfluous SmallString::str() calls.Yaron Keren2015-03-186-26/+26
| | | | | | | | | | | | | | | Now that SmallString is a first-class citizen, most SmallString::str() calls are not required. This patch removes a whole bunch of them, yet there are lots more. There are two use cases where str() is really needed: 1) To use one of StringRef member functions which is not available in SmallString. 2) To convert to std::string, as StringRef implicitly converts while SmallString do not. We may wish to change this, but it may introduce ambiguity. llvm-svn: 232622
* Imply linker arguments from '-fveclib' option.Michael Zolotukhin2015-03-171-0/+10
| | | | | | | | | | Summary: As discussed in D8097, we should provide corresponding linking flags when 'fveclib' is specified. Reviewers: hfinkel Differential Revision: http://reviews.llvm.org/D8362 llvm-svn: 232556
* Add fveclib option.Michael Zolotukhin2015-03-171-0/+2
| | | | | Review: http://reviews.llvm.org/D8097 llvm-svn: 232533
* [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
* Implement bad cast checks using control flow integrity information.Peter Collingbourne2015-03-141-2/+2
| | | | | | | | | | | This scheme checks that pointer and lvalue casts are made to an object of the correct dynamic type; that is, the dynamic type of the object must be a derived class of the pointee type of the cast. The checks are currently only introduced where the class being casted to is a polymorphic class. Differential Revision: http://reviews.llvm.org/D8312 llvm-svn: 232241
* Fix grammar in a comment, wrap to 80 columns. No behavior change.Nico Weber2015-03-121-2/+3
| | | | llvm-svn: 232087
* Driver: Keep -isysroot flags in crash scripts if we're dumping a VFSJustin Bogner2015-03-121-4/+7
| | | | | | | | | | | | | For crashes with a VFS (ie, with modules), the -isysroot flag is often necessary to reproduce the crash. This is especially true if some modules need to be rebuilt, since without the sysroot they'll try to read headers that are outside of the VFS. I find it likely that we should keep some of the other -i flags in this case as well, but I haven't seen that come up in practice yet so it seems better to be conservative. llvm-svn: 231997
* Driver: Print the clang version and original command in crash scriptsJustin Bogner2015-03-121-0/+3
| | | | | | | | | | When a crash report script doesn't work for a reproduction on your machine for one reason or another, it can be really tricky to figure out why not. The compiler version that crashed and the original command line before stripping flags are very helpful when this comes up. llvm-svn: 231989
* Add deprecation notice for -f(no-)sanitize-recover flags.Alexey Samsonov2015-03-111-2/+7
| | | | | | | These flags should be replaced with corresponding -f(no-)sanitize-recover=<list> flags. llvm-svn: 231983
* [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
* Simplify boolean expressions in clang with clang-tidyDavid Blaikie2015-03-091-4/+1
| | | | | | | | Patch by Richard (legalize at xmission dot com). Differential Revision: http://reviews.llvm.org/D8155 llvm-svn: 231619
* 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
* [Sanitizers] Use uint64_t for bitmask of enabled sanitizers.Alexey Samsonov2015-03-031-40/+40
| | | | | | | The total number of sanitizers and sanitizer groups will soon reach 32. llvm-svn: 231149
* Fix program name in "clang -help"Sumanth Gundapaneni2015-03-031-1/+1
| | | | | | | | | | | | | | | | | With out this patch, "clang -help" prints "USAGE: clang-3 [options] <inputs>". It should either print USAGE: clang [options] <inputs> or USAGE: clang-3.7 [options] <inputs> With this patch, on Linux, it prints USAGE: clang-3.7 [options] <inputs> On Windows, it prints USAGE: clang.exe [options] <inputs> llvm-svn: 231124
* 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
OpenPOWER on IntegriCloud