summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
...
* Removing an unused variable; NFC.Aaron Ballman2014-11-141-1/+0
| | | | llvm-svn: 222048
* [Sanitizer] Refactor SanitizerArgs parsing in Driver.Alexey Samsonov2014-11-141-118/+213
| | | | | | | | | | | Remove flag parsing details from the public header. Use SanitizerSet to represent the set of enabled sanitizers. Cleanup the implementation: update the comments to reflect reality, remove dead code. No functionality change. llvm-svn: 221968
* Remove -fseh-exceptions in favor of checking the tripleReid Kleckner2014-11-141-2/+0
| | | | | | | | | This option was misleading because it looked like it enabled the language feature of SEH (__try / __except), when this option was really controlling which EH personality function to use. Mingw only supports SEH and SjLj EH on x86_64, so we can simply do away with this flag. llvm-svn: 221963
* Cleanup SanitizerArgs: get rid of unused variable, make one method ↵Alexey Samsonov2014-11-141-7/+2
| | | | | | non-static. NFC. llvm-svn: 221959
* [Profile] Always build profile runtime library with -fPIC.Alexey Samsonov2014-11-141-9/+3
| | | | | | | | | This change removes libclang_rt.profile-pic-<arch>.a version of profile runtime. Instead, it's sufficient to always build libclang_rt.profile-<arch>.a with -fPIC, as it can be linked into both executables and shared objects. llvm-svn: 221952
* Introduce -fsanitize-coverage=N flagKostya Serebryany2014-11-111-0/+15
| | | | | | | | | | | | | | | | | | | Summary: This change makes the asan-coverge (formerly -mllvm -asan-coverge) accessible via a clang flag. Companion patch to LLVM is http://reviews.llvm.org/D6152 Test Plan: regression tests, chromium Reviewers: samsonov Reviewed By: samsonov Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6153 llvm-svn: 221719
* AArch64: set all processor features from -arch if nothing else presentTim Northover2014-11-101-0/+6
| | | | | | | | | | Darwin's "-arch arm64" option implies full Cyclone CPU, for both architectural and tuning purposes. So if neither of the explicit options have been given, forward that on to the proper invocation. rdar://problem/18906227 llvm-svn: 221631
* Fix style.Michael J. Spencer2014-11-071-4/+3
| | | | llvm-svn: 221546
* Fix clash of gcc toolchains in hexagon driver regression tests.Samuel Antao2014-11-073-10/+15
| | | | | | If clang was configured with a custom gcc toolchain (either by using GCC_INSTALL_PREFIX in cmake or the equivalent configure command), the path to the custom gcc toolchain path takes precedence to the one specified by -ccc-install-dir. This causes several regression tests to fail as they will be using an unexpected path. Adding the switch --gcc-toolchain="" in each test command is not enough as the hexagon toolchain implementation in the driver is not evaluating this argument. This commit modifies the hexagon toolchain to take the --gcc-toolchain="" argument into account when deciding the toolchain path, similarly to what is already done for other targets toolchains. Additionally, the faulty regression tests are modified in order to --gcc-toolchain="" be passed to the commands. llvm-svn: 221535
* Remove references to the cortex-a9-mp CPU.Charlie Turner2014-11-062-2/+2
| | | | | | | | | | This CPU definition is redundant. The Cortex-A9 is defined as supporting multiprocessing extensions. Remove references to this CPU. This CPU was recently removed from LLVM. See http://reviews.llvm.org/D6057 Change-Id: I62ae7cc656fcae54fbaefc4b6976e77e694a8678 llvm-svn: 221458
* Use backslashes to escape spaces and other backslashes in -dwarf-debug-flags.Bob Wilson2014-11-041-2/+23
| | | | | | | | | | The command line options are specified in a space-separated list that is an argument to -dwarf-debug-flags, so that breaks if there are spaces in the options. This feature came from Apple's internal version of GCC, so I went back to check how llvm-gcc handled this and matched that behavior. rdar://problem/18775420 llvm-svn: 221309
* Make helper function static. NFC.Benjamin Kramer2014-11-041-1/+2
| | | | llvm-svn: 221290
* Use @rpath as LC_ID_DYLIB for ASan dylib on OS XKuba Brecka2014-11-042-7/+30
| | | | | | | | Change the LC_ID_DYLIB of ASan's dynamic libraries on OS X to be set to "@rpath/libclang_rt.asan_osx_dynamic.dylib" and similarly for iossim. Clang driver then sets the "-rpath" to be the real path to where clang currently has the dylib (because clang uses the relative path to its current executable). This means if you move the compiler or install the binary release, -fsanitize=address will link to the proper library. Reviewed at http://reviews.llvm.org/D6018 llvm-svn: 221279
* Driver: Pass some std::strings by reference instead of valueDavid Majnemer2014-11-041-2/+2
| | | | | | No functional change intended. This fixes PR21463. llvm-svn: 221249
* [llvm-api-change] Use findProgramByName.Michael J. Spencer2014-11-041-3/+3
| | | | llvm-svn: 221222
* Rename 'DarwinStaticLib' to 'DarwinLibName'Kuba Brecka2014-10-312-3/+3
| | | | | | | | | | The former name doesn't make sense, we are using this parameter for both .a and .dylib libraries. No functional change. http://reviews.llvm.org/D6040 llvm-svn: 220939
* Driver: remove a stray s that propagated in cross-windowsSaleem Abdulrasool2014-10-281-1/+1
| | | | | | The option is '--allow-multiple-definition' not '--allow-multiple-definitions'. llvm-svn: 220760
* Allow thread sanitizer in clang driver on FreeBSDViktor Kutuzov2014-10-271-4/+9
| | | | | | http://reviews.llvm.org/D5999 llvm-svn: 220680
* Revert rL220675 due to failures on check-clangViktor Kutuzov2014-10-271-6/+1
| | | | llvm-svn: 220677
* Allow thread sanitizer in clang driver on FreeBSDViktor Kutuzov2014-10-271-1/+6
| | | | | | Differential Revision: http://reviews.llvm.org/D5994 llvm-svn: 220675
* Driver: reduce search logic duplicationSaleem Abdulrasool2014-10-251-21/+28
| | | | | | | Refactor the path search into a helper function to avoid duplicating the path handling for the search. NFC. llvm-svn: 220628
* Driver: assume that all architectures are supported for libstc++Saleem Abdulrasool2014-10-251-8/+2
| | | | | | | | | Rather than asserting that the target is unsupported, make a guess at what the tree for a port would look like and use that for the search path. Addresses review comments from Ried Kleckner for SVN r220547. llvm-svn: 220624
* [Thumb] Clang thinks "char" is signed when using a thumb tripleOliver Stannard2014-10-241-0/+2
| | | | | | | | 'char' is unsigned on all ARM and Thumb architectures. Clang gets this right for ARM, and for thumb when using and arm triple and the -mthumb option, but gets it wrong for thumb triples. This fixes that. llvm-svn: 220555
* Driver: add missed file from previous commitSaleem Abdulrasool2014-10-241-0/+123
| | | | llvm-svn: 220547
* Driver: add CrossWindowsToolChainSaleem Abdulrasool2014-10-245-1/+253
| | | | | | | | | | | | | | | | | | | | This is a very basic toolchain. It supports cross-compiling Windows (primarily inspired by the WoA target). It is meant to use clang with the LLVM IAS and a binutils ld-compatible interface for the linker (eventually to be lld). It does not perform any "standard" GCC lookup, nor does it perform any special adjustments given that it is expected to be used in an environment where the user is using MSVCRT (and as such Visual Studio headers) and the Windows SDK. The primary runtime library is expected to be compiler-rt and the C++ implementation to be libc++. It also expects that a sysroot has been setup given the usual Unix semantics (standard C headers in /usr/include, all the import libraries available in /usr/lib). It also expects that an entry point stub is present in /usr/lib (crtbegin.obj for executables, crtbeginS.obj for shared libraries). The entry point stub is responsible for running any GNU constructors. llvm-svn: 220546
* Revert r218541 - Don't link in sanitizer runtimes if ↵Alexey Samsonov2014-10-231-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | -nostdlib/-nodefaultlibs is provided. This is a sad thing to do, but all the alternatives look ugly. Looks like there are legitimate cases when users may want to link with sanitizer runtimes *and* -nodefaultlibs (and ensure they provide replacements for system libraries). For example, this happens in libc++ test suite. "-nodefaultlibs" is told to link only the libraries explicitly provided by the user, and providing "-fsanitize=address" is a clear indication of intention to link with ASan runtime. We can't easily introduce analogue of "-print-libgcc-name": linking with sanitizers runtimes is not trivial: some runtimes are split into several archive libraries, which are required to be wrapped in -whole-archive/-no-whole-archive. If "-fsanitize=whatever" and "-nodefaultlibs" are provided, system library dependencies of sanitizer runtimes (-lc/-ldl/-lpthread/-lrt) will *not* be linked, and user would have to link them in manually. Note that this can cause problems, as failing to provide "-lrt" might lead to crashes in runtime during ASan initialization. But looks like we should bite this bullet. See r218541 review thread for the discussion. llvm-svn: 220455
* Fix C++ compliance issue. string literals must be const char *Zachary Turner2014-10-221-2/+2
| | | | llvm-svn: 220434
* Make a good guess about where MSVC and Windows SDK libraries are for linking.Zachary Turner2014-10-223-0/+99
| | | | | | | | | | | | | When a user has not configured a standard Visual Studio environment by running vcvarsall, clang tries its best to find Visual Studio include files and executables anyway. This patch makes clang also try to find system and Windows SDK libraries for linking against, as well. Reviewed by: Hans Wennborg Differential Revision: http://reviews.llvm.org/D5873 llvm-svn: 220425
* Resubmit "Improve Windows toolchain support for non-standard environments."Zachary Turner2014-10-223-122/+219
| | | | | | | | | | | | | | This resubmits change r220226. That change broke the chromium build bots because chromium it ships an hermetic MSVC toolchain that it expects clang to fallback to by finding it on the path. This patch fixes the issue by bumping up the prioritization of PATH when looking for MSVC binaries. Reviewed by: Hans Wennborg, Reid Kleckner Differential Revision: http://reviews.llvm.org/D5892 llvm-svn: 220424
* Driver: rename Windows to MSVCToolChainSaleem Abdulrasool2014-10-224-18/+18
| | | | | | | | This renames the Windows toolchain to MSVCToolChain. This is a preparatory step for adding a CrossWindowsToolChain which uses clang/libc++/(ld/lld) without the standard GCC toolchain lookup. NFC. llvm-svn: 220362
* [modules] Initial support for explicitly loading .pcm files.Richard Smith2014-10-221-1/+5
| | | | | | | | | | | | | | | Implicit module builds are not well-suited to a lot of build systems. In particular, they fare badly in distributed build systems, and they lead to build artifacts that are not tracked as part of the usual dependency management process. This change allows explicitly-built module files (which are already supported through the -emit-module flag) to be explicitly loaded into a build, allowing build systems to opt to manage module builds and dependencies themselves. This is only the first step in supporting such configurations, and it should be considered experimental and subject to change or removal for now. llvm-svn: 220359
* Removing unused variable (assigned into, but never read from); NFC.Aaron Ballman2014-10-211-2/+0
| | | | llvm-svn: 220313
* Treat -g1 as -gline-tables-onlyHal Finkel2014-10-211-1/+2
| | | | | | | | | | | | | -g1 on gcc (and also IBM's xlc) are documented to be very similar to -gline-tables-only. Our -gline-tables-only might still be more verbose than -g1 on other compilers, but currently we treat -g1 as -g, and so we're producing much more debug info at -g1 than everybody else. Treating -g1 as -gline-tables-only brings us much closer to what everyone else is doing. For more information, see the discussion on http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-October/039649.html llvm-svn: 220311
* Driver: Quote the command in crash reproduction scripts.Justin Bogner2014-10-212-12/+1
| | | | | | | | This fixes crash report generation when filenames have spaces. It also removes an awkward workaround that quoted *some* arguments when generating crash reports. llvm-svn: 220307
* Driver: Move crash report command mangling into Command::PrintJustin Bogner2014-10-212-35/+33
| | | | | | | | | | This pushes the logic for generating a crash reproduction script entirely into Command::Print, instead of Command doing half of the work and then relying on textual substitution for the rest. This makes this logic much easier to read and will simplify fixing a couple of issues in this area. llvm-svn: 220305
* Revert "Improve Windows toolchain support for non-standard environments." ↵Hans Wennborg2014-10-203-158/+122
| | | | | | | | | | | | | | (r220226) In environments where PATH was set to point to the VS installation, Clang would override that by looking in the registry and finding the latest VS installation. If the environment is set up to point to a VS installation, that should take precedence. Reverting this until we can fix it. llvm-svn: 220243
* Driver: Consolidate the logic for naming the module crashdump cacheJustin Bogner2014-10-202-15/+13
| | | | | | | | List the module cache we use for crashdumps as a tempfile. This simplifies how we pick up this directory when generating the actual crash diagnostic and removes some duplicate logic. llvm-svn: 220241
* Driver: Name crashdump scripts after the first temp fileJustin Bogner2014-10-201-42/+54
| | | | | | | | | | | | | | | | In practice there's only ever one temporary output file when generating a crashdump, but even if there were many iterating over each and creating a duplicate run script for each one wouldn't make very much sense. This updates the behaviour to only generate the script once, based on the first filename. This should make it more reasonable to generate extra output files to include in the crashdump going forward, so I've also added a FIXME to look into doing just that with the extra module crashdump files. llvm-svn: 220238
* Driver: Use an early return instead of a long if condition (NFC)Justin Bogner2014-10-201-56/+55
| | | | | | | This just flattens an if block by returning early on the "else" condition. llvm-svn: 220235
* Driver: Make FailingCommand mandatory for generateCompilationDiagnosticsJustin Bogner2014-10-201-9/+4
| | | | | | | | | | | | | We currently use a null FailingCommand when generating crash reports as an indication that the cause is FORCE_CLANG_DIAGNOSTICS_CRASH, the environment variable that exists to test crash dumps. This means that our tests don't actually cover real crashes at all, and adds a more complicated code path that's only used in the tests. Instead, we can have the driver synthesize that every command failed and just call generateCompilationDiagnostics normally. llvm-svn: 220234
* Improve Windows toolchain support for non-standard environments.Zachary Turner2014-10-203-122/+158
| | | | | | | | | | | | | | | | | | | | | Typically clang finds Visual Studio by the user explicitly setting up a Visual Studio environment via vcvarsall. But we still try to behave intelligently and fallback to different methods of finding Visual Studio when this is not done. This patch improves various fallback codepaths to make Visual Studio locating more robust. Specifically, this patch: * Adds support for searching environment variables for VS 12.0 * Correctly locates include folders for Windows SDK 8.x (this was previously broken, and would cause clang to error) * Prefers locating link.exe in the same location as cl.exe. This is helpful in case another link.exe is in the path earlier than Visual Studio (e.g. GnuWin32) * Minor cleanup in the registry reading code to make it more robust in the presence of long pathnames. llvm-svn: 220226
* Use non-member begin/end for a slight readability improvement.Benjamin Kramer2014-10-181-125/+67
| | | | llvm-svn: 220140
* PR21215: Support -fmodule-map-file being specified multiple times. SupportRichard Smith2014-10-171-8/+5
| | | | | | loading multiple module map files from the same directory. llvm-svn: 220020
* [AArch64] Enable A53 erratum workaround (835769) by default for Android targetsBradley Smith2014-10-161-0/+4
| | | | llvm-svn: 219933
* specify dwarf version for SolarisAlexander Eremin2014-10-161-4/+6
| | | | llvm-svn: 219901
* clang-cl: Diagnose the usage of ASAN with a debug runtime libraryEhsan Akhgari2014-10-141-0/+15
| | | | | | | | | | | | | | | | Summary: AddressSanitizer currently doesn't support this configuration, and binaries built with it will just get into an infinite loop during startup. Test Plan: Includes an automated test. Reviewers: samsonov Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5764 llvm-svn: 219744
* Adds support for the Cortex-A17 processor to ClangRenato Golin2014-10-132-2/+2
| | | | | | Patch by Matthew Wahab. llvm-svn: 219607
* [AArch64] Add workaround for Cortex-A53 erratum (835769)Bradley Smith2014-10-131-0/+9
| | | | | | | | | | | | | | | | | | | Some early revisions of the Cortex-A53 have an erratum (835769) whereby it is possible for a 64-bit multiply-accumulate instruction in AArch64 state to generate an incorrect result. The details are quite complex and hard to determine statically, since branches in the code may exist in some circumstances, but all cases end with a memory (load, store, or prefetch) instruction followed immediately by the multiply-accumulate operation. The safest work-around for this issue is to make the compiler avoid emitting multiply-accumulate instructions immediately after memory instructions and the simplest way to do this is to insert a NOP. This patch implements clang options to enable this workaround in the backend. The work-around code generation is not enabled by default. llvm-svn: 219604
* Treat -mios-simulator-version-min option as an alias for -mios-version-min.Bob Wilson2014-10-101-30/+10
| | | | | | | | We can safely rely on the architecture to distinguish iOS device builds from iOS simulator builds. We already have code to do that, in fact. This simplifies some of the error checking for the option handling. llvm-svn: 219545
* Remove rest of the comment that is no longer true after r219527.Bob Wilson2014-10-101-4/+0
| | | | llvm-svn: 219528
OpenPOWER on IntegriCloud