summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
* Pass down the -flto option to the -cc1 job, and from there into theTeresa Johnson2015-06-101-0/+4
| | | | | | | | | | | | CodeGenOptions and onto the PassManagerBuilder. This enables gating the new EliminateAvailableExternally module pass on whether we are preparing for LTO. If we are preparing for LTO (e.g. a -flto -c compile), the new pass is not included as we want to preserve available externally functions for possible link time inlining. llvm-svn: 239481
* clang-cl: Ignore the /o option when /P is specified.Greg Bedwell2015-06-091-2/+1
| | | | | | | | | This matches the cl.exe behavior (tested with 18.00.31101). In order to specify an output file for /P, use the /Fi option instead. Differential Revision: http://reviews.llvm.org/D10313 llvm-svn: 239393
* [Driver] Preserve the object file format in ComputeEffectiveClangTripleDavid Majnemer2015-06-091-2/+8
| | | | | | | | The object file format is sometimes overridden for MSVC targets to use ELF instead of COFF. Make sure we preserve this choice when setting the msvc version number in the triple. llvm-svn: 239388
* range-for'ify Args->filtered_begin(...) loopsSean Silva2015-06-093-72/+39
| | | | | | | We already have Args->filtered(...) which is a drop-in range-for replacement. llvm-svn: 239381
* [Driver] Inject the MSVC compatibility version into the tripleDavid Majnemer2015-06-084-30/+79
| | | | | | | Encoding the version into the triple will allow us to communicate to LLVM what functions it can expect to depend upon in the implementation. llvm-svn: 239273
* clang-cl: Implement /GL in terms of -flto.Peter Collingbourne2015-06-062-2/+2
| | | | | | | | No documentation yet; the linker needs more work. Differential Revision: http://reviews.llvm.org/D10270 llvm-svn: 239213
* [SPARC] Add multiarch include paths.James Y Knight2015-06-051-0/+10
| | | | | | | | | | | Adds tests verifying the proper dirs are found in the Debian 8/GCC4.9 layout for sparc (32bit), sparc (32bit) with lib64 multilib, and sparc64. The test cases added here also cover r239047, which fixed the linker paths. llvm-svn: 239154
* [ARM] Use TargetParser to determine FPU subtarget featuresJohn Brawn2015-06-051-74/+2
| | | | | | | | | | | | | | | The main effect of this is to fix anomalies where certain -mfpu options didn't disable everything that they should causing strange behaviour when combined with -mcpu or -march values that themselves enabled fpu subtarget features, e.g. -mfpu=fpv5-dp-d16 with -march=armv7em previously behaved the same as -mfpu=fpv5-sp-d16 due to fp-only-sp not being disabled. Invalid -mfpu options now also give an error, which is consistent with the handling of the .fpu directive. Differential Revision: http://reviews.llvm.org/D10239 llvm-svn: 239152
* 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-043-8/+8
| | | | | | | GCC allows case-insensitive values for -mcpu, -march and -mtune options. This patch implements the same behaviour for the -mcpu option. llvm-svn: 239059
* [SPARC] Fix multiarch path detection for sparc and sparcv9.James Y Knight2015-06-041-0/+8
| | | | llvm-svn: 239047
* Remove extraneous qualifiers due to "using namespace". NFCDouglas Katzman2015-06-042-10/+10
| | | | llvm-svn: 239038
* 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
* Change big 'if' statement into a switch. NFCDouglas Katzman2015-06-031-15/+20
| | | | | | Differential Revision: http://reviews.llvm.org/D10223 llvm-svn: 238955
* Fix misleading comment. NFCDouglas Katzman2015-06-031-1/+1
| | | | llvm-svn: 238938
* 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-292-3/+3
| | | | | | | | | | | | | | | | | | | | 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 MachO arch names. NFCRenato Golin2015-05-281-21/+26
| | | | llvm-svn: 238435
* [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
* 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
OpenPOWER on IntegriCloud