summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
...
* [omp] Re-work Clang's handling of -fopenmp and undo r237769.Chandler Carruth2015-05-281-53/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This isn't an actual revert of r237769, it just restores the behavior of the Clang driver prior to it while completely re-implementing how that behavior works. This also re-does the work of making the default OpenMP runtime selectable at CMake (or configure) time to work in the way all of our other such hooks do (config.h, configure and cmake hooks, etc.). I've re-implemented how we manage the '-fopenmp' flagset in an important way. Now, the "default" hook just makes '-fopenmp' equivalent to '-fopenmp=<default>' rather than a separate special beast. Also, there is an '-fno-openmp' flag which does the obvious thing. Also, the code is shared between all the places to select a known OpenMP runtime and act on it. Finally, and most significantly, I've taught the driver to inspect the selected runtime when choosing whether to propagate the '-fopenmp' flag to the frontend in the CC1 commandline. Without this, it isn't possible to use Clang with libgomp, even if you were happy with the serial, boring way in which it worked previously (ignoring all #pragmas but linking in the library to satisfy direct calls into the runtime). While I'm here, I've gone ahead and sketched out a path for the future name of LLVM's OpenMP runtime (libomp) and the legacy support for its current name (libiomp5) in what seems a more reasonable way. To re-enable LLVM's OpenMP runtime (which I think should wait until the normal getting started instructions are a reasonable way for falks to check out, build, and install Clang with the runtime) all that needs to change is the default string in the CMakeLists.txt and configure.ac file. No code changes necessary. I also added a test for the driver's behavior around OpenMP since it was *completely missing* previously. Makes it unsurprising that we got it wrong. llvm-svn: 238389
* Change final case of Driver::getToolChain to "if/else/else/else..."Douglas Katzman2015-05-261-20/+11
| | | | | | Differential Revision: http://reviews.llvm.org/D9939 llvm-svn: 238225
* [Driver] Unbreak hexagon build botsDavid Majnemer2015-05-231-1/+1
| | | | | | | | AddHexagonTargetArgs didn't respect the driver flags by unconditionally pushing -fno-signed-char. Instead, add Hexagon handling to isSignedCharDefault. llvm-svn: 238106
* [Driver] Handle -fno-signed-char and -fno-unsigned-charDavid Majnemer2015-05-231-2/+9
| | | | | | | GCC maps -fno-unsigned-char to -fsigned-char and -fno-signed-char to -funsigned-char. llvm-svn: 238105
* This reverts commit r238064 and r238055.Rafael Espindola2015-05-231-134/+0
| | | | | | They depend on a reverted llvm commit. llvm-svn: 238076
* add the -mrecip driver flag and process its optionsSanjay Patel2015-05-221-0/+134
| | | | | | | | | | | | | | | This is the front-end counterpart to D8982 (LLVM r238051). The -mrecip option interface is based on maintaining compatibility with gcc: https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/i386-and-x86-64-Options.html#index-mrecip_003dopt-1627 https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/RS_002f6000-and-PowerPC-Options.html#index-mrecip-2289 ...while adding more functionality (allowing users to specify the number of refinement steps for each estimate type). Differential Revision: http://reviews.llvm.org/D8989 llvm-svn: 238055
* Make unique section names the default again.Rafael Espindola2015-05-221-6/+3
| | | | | | | | | | Using non unique names found a bug in the ICF inplementation in gold: https://sourceware.org/bugzilla/show_bug.cgi?id=18440 This reverts commit r234143. llvm-svn: 238048
* Use profile and version parsers from ARMTargetParserRenato Golin2015-05-221-32/+5
| | | | | | | Now that ARMTargetParser can parse profile and version numbers, use them instead of the local implementation. llvm-svn: 238037
* [ARM] Restructure cpu handling in the driver to mostly use the tripleJohn Brawn2015-05-211-44/+92
| | | | | | | | | | | | | | | | | | Using the target cpu to determine some behaviour is sprinkled in several places in the driver, but in almost all the information that is needed can be found in the triple. Restructure things so that the triple is used, and the cpu is only used if the exact cpu name is needed. Also add a check that the -mcpu argument is valid, and correct the -march argument checking so that it handles -march=native correctly. I would have liked to move these checks into the computation of the triple, but the triple is calculated several times in several places and that would lead to multiple error messages for the same thing. Differential Revision: http://reviews.llvm.org/D9879 llvm-svn: 237894
* [Driver] Improve unused-argument diagnostic for extra sanitizer features.Alexey Samsonov2015-05-211-3/+9
| | | | | | | | | | | | | | | Don't print unused-argument warning for sanitizer-specific feature flag if this sanitizer was eanbled, and later disabled in the command line. For example, now: clang -fsanitize=address -fsanitize-coverage=bb -fno-sanitize=address a.cc doesn't print warning, but clang -fsanitize-coverage=bb does. Same holds for -fsanitize-address-field-padding= and -fsanitize-memory-track-origins= flags. Fixes PR23604. llvm-svn: 237870
* [OpenMP] Make default OpenMP library (the one selected with just -fopenmp)Richard Smith2015-05-201-41/+52
| | | | | | | | | configurable in the CMake build. There shouldn't be any change in default behavior. Derived from a patch by Daniel Jasper! llvm-svn: 237850
* [OPENMP] -fopenmp enables OpenMP support (fix for http://llvm.org/PR23492)Alexey Bataev2015-05-201-10/+16
| | | | | | | -fopenmp turns on OpenMP support and links libiomp5 as OpenMP library. Also there is -fopenmp={libiomp5|libgomp} option that allows to override effect of -fopenmp and link libgomp library (if -fopenmp=libgomp is specified). Differential Revision: http://reviews.llvm.org/D9736 llvm-svn: 237769
* [clang-cl] Enable C++14 when targeting 2015 compatibilityDavid Majnemer2015-05-181-2/+11
| | | | llvm-svn: 237553
* Remove unused function HasPICArg().Ikhlas Ajbar2015-05-141-5/+0
| | | | llvm-svn: 237374
* Factor out SmallDataThresholdIkhlas Ajbar2015-05-143-31/+39
| | | | | | This patch factors out SmallDataThreshold code. llvm-svn: 237364
* [ARM] Add v8.1a architectureVladimir Sukharev2015-05-143-14/+41
| | | | | | | | | | | | | | Add support for ARMv8.1a architecture. Briefly it is described on http://community.arm.com/groups/processors/blog/2014/12/02/the-armv8-a-architecture-and-its-ongoing-development Reviewers: jmolloy, rengolin Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8799 llvm-svn: 237349
* Change TargetParser enum names to avoid macro conflicts (clang)Renato Golin2015-05-121-14/+14
| | | | | | | | | sys/time.h on Solaris (and possibly other systems) defines "SEC" as "1" using a cpp macro. The result is that this fails to compile. Fixes https://llvm.org/PR23482 llvm-svn: 237113
* Driver: Fix a -Wshadow issue from r237091Justin Bogner2015-05-122-3/+8
| | | | | | | | | | The MachO toolchain has an isTargetIOSBased method, but it isn't virtual so it isn't very meaningful to call it. After thinking about this, I guess that putting this logic in the MachO class is a bit of a layering violation anyway. Do this more like how we handle AddLinkRuntimeLibArgs instead. llvm-svn: 237095
* Re-apply "Driver: Make profiling flags work with -nostdlib on Darwin"Justin Bogner2015-05-123-14/+30
| | | | | | | | This time without a stray "true" in an argument list. This reverts r237077, restoring r237074. llvm-svn: 237091
* Revert "Driver: Make profiling flags work with -nostdlib on Darwin"Justin Bogner2015-05-123-30/+14
| | | | | | This revert r237074. These tests are failing all over the place. llvm-svn: 237077
* Driver: Make profiling flags work with -nostdlib on DarwinJustin Bogner2015-05-123-14/+30
| | | | | | | | | | | | | Compiler-rt's Profiling library isn't part of the stdlib, so -nostdlib shouldn't prevent it from being linked. This makes Darwin behave like other toolchains, and link in the profile runtime irrespective of -nostdlib, since the resulting program can't be run unless you link this. I've also added a test to show that other toolchains already behave like this. llvm-svn: 237074
* Move sanitizer parser and group expander from Driver to Basic.Peter Collingbourne2015-05-111-34/+15
| | | | | | | | No functional change. Differential Revision: http://reviews.llvm.org/D9621 llvm-svn: 237056
* Unify sanitizer kind representation between the driver and the rest of the ↵Peter Collingbourne2015-05-111-125/+74
| | | | | | | | | | compiler. No functional change. Differential Revision: http://reviews.llvm.org/D9618 llvm-svn: 237055
* [Sparc] Add support for 'sparcel' to clang.Douglas Katzman2015-05-112-1/+12
| | | | | | Differential Revision: http://reviews.llvm.org/D8784 llvm-svn: 237001
* Factor out Hexagon code to build args.Ikhlas Ajbar2015-05-091-8/+21
| | | | | | | This patch factor out the code in hexagon::Link::ConstructJob to be reused in other functions. No functionality change intended. llvm-svn: 236926
* Using ARMTargetParser in ClangRenato Golin2015-05-082-44/+50
| | | | | | | | | | | | | | | | This is a starting point for using the TargetParser in Clang, in a simple enough part of the code that can be used without disrupting the crazy platform support that we need to be compatible with other toolchains. Also adding a few FIXME on obvious places that need replacing, but those cases will indeed break a few of the platform assumptions, as arch/cpu names change multiple times in the driver. Finally, I'm changing the "neon-vfpv3" behaviour to match standard NEON, since -mfpu=neon implies vfpv3 by default in both Clang and LLVM. That option string is still supported as an alias to "neon". llvm-svn: 236901
* Revert "Allow case-insensitive values for -mcpu for ARM and AArch64"Renato Golin2015-05-082-5/+4
| | | | | | | This reverts commit r236859, as it broke multiple builds. I'll investigate and reapply when safe. llvm-svn: 236869
* Allow case-insensitive values for -mcpu for ARM and AArch64Renato Golin2015-05-082-4/+5
| | | | | | | | | GCC allows case-insensitive values for -mcpu, -march and -mtune options. This patch implements the same behaviour for the -mcpu option. Patch by Gabor Ballabas. llvm-svn: 236859
* [ARM] Give an error on invalid -march valuesJohn Brawn2015-05-081-1/+14
| | | | | | | | | | llvm::Triple::getARMCPUForArch now returns nullptr for invalid -march values, instead of silently translating it to arm7tdmi. Use this to give an error message, which is consistent with how gcc behaves. Differential Revision: http://reviews.llvm.org/D9602 llvm-svn: 236846
* [SanitizerCoverage] Implement user-friendly -fsanitize-coverage= flags.Alexey Samsonov2015-05-071-15/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Possible coverage levels are: * -fsanitize-coverage=func - function-level coverage * -fsanitize-coverage=bb - basic-block-level coverage * -fsanitize-coverage=edge - edge-level coverage Extra features are: * -fsanitize-coverage=indirect-calls - coverage for indirect calls * -fsanitize-coverage=trace-bb - tracing for basic blocks * -fsanitize-coverage=trace-cmp - tracing for cmp instructions * -fsanitize-coverage=8bit-counters - frequency counters Levels and features can be combined in comma-separated list, and can be disabled by subsequent -fno-sanitize-coverage= flags, e.g.: -fsanitize-coverage=bb,trace-bb,8bit-counters -fno-sanitize-coverage=trace-bb is equivalient to: -fsanitize-coverage=bb,8bit-counters Original semantics of -fsanitize-coverage flag is preserved: * -fsanitize-coverage=0 disables the coverage * -fsanitize-coverage=1 is a synonym for -fsanitize-coverage=func * -fsanitize-coverage=2 is a synonym for -fsanitize-coverage=bb * -fsanitize-coverage=3 is a synonym for -fsanitize-coverage=edge * -fsanitize-coverage=4 is a synonym for -fsanitize-coverage=edge,indirect-calls Driver tries to diagnose invalid flag usage, in particular: * At most one level (func,bb,edge) must be specified. * "trace-bb" and "8bit-counters" features require some level to be specified. See test case for more examples. Test Plan: regression test suite Reviewers: kcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D9577 llvm-svn: 236790
* [SanitizerCoverage] Give clang-cc1 the power to precisly specify needed ↵Alexey Samsonov2015-05-071-3/+8
| | | | | | | | | | | | | | | | | | sanitizier coverage mode. Summary: The next step is to add user-friendly control over these options to driver via -fsanitize-coverage= option. Test Plan: regression test suite Reviewers: kcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D9545 llvm-svn: 236756
* [driver] Cosmetic change to use Input instead of Inputs[0].Artem Belevich2015-05-062-14/+14
| | | | | | Differential Revision: http://reviews.llvm.org/D9506 llvm-svn: 236621
* [SystemZ] Add support for z13 and its vector facilityUlrich Weigand2015-05-051-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the z13 architecture type. For compatibility with GCC, a pair of options -mvx / -mno-vx can be used to selectively enable/disable use of the vector facility. When the vector facility is present, we default to the new vector ABI. This is characterized by two major differences: - Vector types are passed/returned in vector registers (except for unnamed arguments of a variable-argument list function). - Vector types are at most 8-byte aligned. The reason for the choice of 8-byte vector alignment is that the hardware is able to efficiently load vectors at 8-byte alignment, and the ABI only guarantees 8-byte alignment of the stack pointer, so requiring any higher alignment for vectors would require dynamic stack re-alignment code. However, for compatibility with old code that may use vector types, when *not* using the vector facility, the old alignment rules (vector types are naturally aligned) remain in use. These alignment rules are not only implemented at the C language level, but also at the LLVM IR level. This is done by selecting a different DataLayout string depending on whether the vector ABI is in effect or not. Based on a patch by Richard Sandiford. llvm-svn: 236531
* InstrProf: Support for setting profile output from command lineJustin Bogner2015-04-302-3/+10
| | | | | | | | | | | | | | | | This change is the third of 3 patches to add support for specifying the profile output from the command line via -fprofile-instr-generate=<path>, where the specified output path/file will be overridden by the LLVM_PROFILE_FILE environment variable. This patch adds the necessary support to the clang frontend, and adds a new test. The compiler-rt and llvm parts are r236055 and r236288, respectively. Patch by Teresa Johnson. Thanks! llvm-svn: 236289
* Revert r236060, it caused PR23375.Nico Weber2015-04-291-1/+23
| | | | llvm-svn: 236159
* Stop emitting the soft-float and soft-float-abi target featuresEric Christopher2015-04-281-23/+1
| | | | | | | for ARM while the backend will only ignore them. No functional change intended. llvm-svn: 236060
* Allow UBSan+MSan and UBSan+TSan combinations (Clang part).Alexey Samsonov2015-04-281-4/+4
| | | | | | | | Embed UBSan runtime into TSan and MSan runtimes in the same as we do in ASan. Extend UBSan test suite to also run tests for these combinations. llvm-svn: 235953
* Introduce tsan_cxx and msan_cxx libraries (Clang part).Alexey Samsonov2015-04-271-2/+8
| | | | | | | | For now tsan_cxx and msan_cxx contain only operator new/delete replacements. In the future, when we add support for running UBSan+TSan and UBSan+MSan, they will also contain bits ubsan_cxx runtime. llvm-svn: 235924
* Revert "PR21000: pass -I options to assembler" as the test was failing on ↵Artem Belevich2015-04-271-4/+0
| | | | | | hexagon. llvm-svn: 235919
* PR21000: pass -I options to assemblerArtem Belevich2015-04-271-0/+4
| | | | | | | | | Pass -I options to assembly so it can find files included with .include. Differential Revision: http://reviews.llvm.org/D7472 llvm-svn: 235915
* Support generating NMake/Jom-style depfiles.Paul Robinson2015-04-271-0/+1
| | | | | | | | | | | | | | | NMake is a Make-like builder that comes with Microsoft Visual Studio. Jom (https://wiki.qt.io/Jom) is an NMake-compatible build tool. Dependency files for NMake/Jom need to use double-quotes to wrap filespecs containing special characters, instead of the backslash escapes that GNU Make wants. Adds the -MV option, which specifies to use double-quotes as needed instead of backslash escapes when writing the dependency file. Differential Revision: http://reviews.llvm.org/D9260 llvm-svn: 235903
* clang-cl: Don't look up absolute paths in %LIB%.Nico Weber2015-04-241-1/+2
| | | | | | | | | Before this patch, passing a non-existent absolute path to clang-cl would cause stat'ing of impossible paths. For example, `clang-cl -c d:\adsfasdf.txt` would cause a stat of C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\LIBd:\asdfadsf.cc llvm-svn: 235787
* [AArch64] Add v8.1a architectureVladimir Sukharev2015-04-161-1/+10
| | | | | | | | | | | | Add support for AArch64 v8.1 architecture. Briefly it is described on http://community.arm.com/groups/processors/blog/2014/12/02/the-armv8-a-architecture-and-its-ongoing-development Reviewers: jmolloy Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8493 llvm-svn: 235110
* uselistorder: -mllvm -preserve-bc-use-list-order => -emit-llvm-uselistsDuncan P. N. Exon Smith2015-04-151-4/+2
| | | | | | | | | | | | | | | Stop relying on `cl::opt` to pass along the driver's decision to preserve use-lists. Create a new `-cc1` option called `-emit-llvm-uselists` that does the right thing (when -emit-llvm-bc). Note that despite its generic name, it *doesn't* do the right thing when -emit-llvm (LLVM assembly) yet. I'll hook that up soon. This doesn't really change the behaviour of the driver. The default is still to preserve use-lists for `clang -emit-llvm` and `clang -save-temps`, and nothing else. But it stops relying on global state (and also is a nicer interface for hackers using `clang -cc1`). llvm-svn: 234962
* IR: Change clang to set -preserve-bc-uselistorderDuncan P. N. Exon Smith2015-04-141-0/+9
| | | | | | | | | | | | Change `clang` to set `-preserve-bc-uselistorder` for the driver options `-emit-llvm` and `-save-temps`. The former is useful for reproducing results from `clang` in `opt` or `llc`, while the latter prevents `-save-temps` from affecting the output. This is part of PR5680. `-preserve-bc-uselistorder=true` is currently on by default, but a follow-up commit in LLVM will reverse it. llvm-svn: 234920
* [Mips] Generate warning for invalid '-mnan' and '-march' combinationsPetar Jovanovic2015-04-142-5/+40
| | | | | | | | | | | | This patch generates a warning for invalid combination of '-mnan' and '-march' options, it properly sets NaN encoding for a given '-march', and it passes a proper NaN encoding to the assembler. Patch by Vladimir Radosavljevic. Differential Revision: http://reviews.llvm.org/D8170 llvm-svn: 234882
* Revert r234786, it contained a bunch of stuff I did not mean to commit.Nico Weber2015-04-131-2/+1
| | | | llvm-svn: 234787
* Revert r234613 (and follow-ups 234614, 234616, 234618), it caused PR23216.Nico Weber2015-04-131-1/+2
| | | | llvm-svn: 234786
* Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko2015-04-111-7/+6
| | | | | | | | | | | | | | | | | | | | Summary: The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix Reviewers: dblaikie Reviewed By: dblaikie Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D8926 llvm-svn: 234678
* [Driver] Properly support -mglobal-merge using explicit options.Ahmed Bougacha2015-04-111-6/+10
| | | | | | | | Follow-up to r234666. With this, the -m[no-]global-merge options have the expected behavior. Previously, -mglobal-merge was ignored, and there was no way of enabling the optimization. llvm-svn: 234668
OpenPOWER on IntegriCloud