summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Tools.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Simplify ARMTargetParser::parseArch(ARMTargetParser::getCanonical()), ↵Artyom Skrobov2015-06-041-7/+3
| | | | | | | | | | | | | | following r239099 Reviewers: rengolin Reviewed By: rengolin Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D10256 llvm-svn: 239101
* Allow case-insensitive values for -mcpu for ARMGabor Ballabas2015-06-041-5/+5
| | | | | | | GCC allows case-insensitive values for -mcpu, -march and -mtune options. This patch implements the same behaviour for the -mcpu option. llvm-svn: 239059
* Use the appropriate PIE level for OpenBSD/sparc.Brad Smith2015-06-041-1/+1
| | | | llvm-svn: 239028
* Save getArch() in a local var instead of calling it 20 times, etc.Douglas Katzman2015-06-041-80/+74
| | | | | | Differential Revision: http://reviews.llvm.org/D10224 llvm-svn: 238992
* Revert "add the -mrecip driver flag and process its options (2nd try)"Rafael Espindola2015-06-031-134/+0
| | | | | | | | This reverts commit r238851. It depends on a llvm commit that was reverted. llvm-svn: 238904
* add the -mrecip driver flag and process its options (2nd try)Sanjay Patel2015-06-021-0/+134
| | | | | | | | | | | | | | | | | | | The first try to land this (r238055) was reverted due to bot failures caused by the LLVM part of the patch. That was hopefully fixed by r238788, and the LLVM patch was resubmitted at r238842. This is the front-end counterpart to D8982. 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: 238851
* Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial typesBenjamin Kramer2015-05-291-1/+1
| | | | | | | | | | | | | | | | | | | | If the type isn't trivially moveable emplace can skip a potentially expensive move. It also saves a couple of characters. Call sites were found with the ASTMatcher + some semi-automated cleanup. memberCallExpr( argumentCountIs(1), callee(methodDecl(hasName("push_back"))), on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))), hasArgument(0, bindTemporaryExpr( hasType(recordDecl(hasNonTrivialDestructor())), has(constructExpr()))), unless(isInTemplateInstantiation())) No functional change intended. llvm-svn: 238601
* [ARM] Adjust -march checkingJohn Brawn2015-05-291-4/+5
| | | | | | | | | | getCanonicalArchName can return an empty string for an architecture that is well-formed but meaningless. Use parseArch to determine if it's actually valid or not. Differential Revision: http://reviews.llvm.org/D10120 llvm-svn: 238553
* [omp] Fix a typo in a comment and a line I forgot to clang-format thatChandler Carruth2015-05-281-2/+3
| | | | | | Justin pointed out in post-commit review. llvm-svn: 238498
* [ARMTargetParser] FIXME on getLLVMArchSuffixForARM. NFCRenato Golin2015-05-281-33/+7
| | | | llvm-svn: 238430
* [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
* [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
* [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-141-31/+11
| | | | | | This patch factors out SmallDataThreshold code. llvm-svn: 237364
* [ARM] Add v8.1a architectureVladimir Sukharev2015-05-141-10/+32
| | | | | | | | | | | | | | 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
* Re-apply "Driver: Make profiling flags work with -nostdlib on Darwin"Justin Bogner2015-05-121-0/+5
| | | | | | | | 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-121-5/+0
| | | | | | 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-121-0/+5
| | | | | | | | | | | | | 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
* [Sparc] Add support for 'sparcel' to clang.Douglas Katzman2015-05-111-1/+11
| | | | | | 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-081-44/+48
| | | | | | | | | | | | | | | | 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-081-4/+3
| | | | | | | 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-081-3/+4
| | | | | | | | | 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
* [driver] Cosmetic change to use Input instead of Inputs[0].Artem Belevich2015-05-061-13/+13
| | | | | | 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-301-3/+9
| | | | | | | | | | | | | | | | 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
* 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
* [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-141-5/+35
| | | | | | | | | | | | 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
* [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
* NaCl ARM: fix assembler float abi flagsDerek Schuff2015-04-101-1/+2
| | | | | | | | | | | | | | | | | | Summary: tools::arm::getARMFloatABI() was falling back to guessing soft-float because it wasn't seeing the GNUEABIHF environment from ComputeEffectivClangTriple when it was called from gnutools::Assemble::ConstructJob. Fix by using the effective clang triple in gnutools::Assemble, which now matches the -triple flag used by cc1 and ClangAs jobs. Reviewers: jvoung Subscribers: rengolin, jfb, aemerson, cfe-commits Differential Revision: http://reviews.llvm.org/D8902 llvm-svn: 234661
* Process the -freciprocal-math optimization flag (PR20912)Sanjay Patel2015-04-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | The driver currently accepts but ignores the -freciprocal-math flag. This patch passes the flag through and enables 'arcp' fast-math-flag generation in IR. Note that this change does not actually enable the optimization for any target. The reassociation optimization that this flag specifies was implemented by http://reviews.llvm.org/D6334 : http://llvm.org/viewvc/llvm-project?view=revision&revision=222510 Because the optimization is done in the backend rather than IR, the backend must be modified to understand instruction-level fast-math-flags or a new function-level attribute must be created. Also note that -freciprocal-math is independent of any target-specific usage of reciprocal estimate hardware instructions. That requires its own flag ('-mrecip'). https://llvm.org/bugs/show_bug.cgi?id=20912 llvm-svn: 234493
OpenPOWER on IntegriCloud