summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Tools.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [Driver] Use Twine instead of itostr. NFC.Benjamin Kramer2015-10-081-1/+1
| | | | | | No need to construct temporary std::strings here. llvm-svn: 249676
* Use itostr(), not std::to_string() because of Android.Douglas Katzman2015-10-081-1/+1
| | | | llvm-svn: 249658
* Stop messing with the 'g' group of options in CompilerInvocation.Douglas Katzman2015-10-081-42/+113
| | | | | | | | | | | | | | | | With this change, most 'g' options are rejected by CompilerInvocation. They remain only as Driver options. The new way to request debug info from cc1 is with "-debug-info-kind={line-tables-only|limited|standalone}" and "-dwarf-version={2|3|4}". In the absence of a command-line option to specify Dwarf version, the Toolchain decides it, rather than placing Toolchain-specific logic in CompilerInvocation. Also fix a bug in the Windows compatibility argument parsing in which the "rightmost argument wins" principle failed. Differential Revision: http://reviews.llvm.org/D13221 llvm-svn: 249655
* [VFS] Port driver tool chains to VFS.Benjamin Kramer2015-10-071-2/+1
| | | | | | | There are still some loose ends here but it's sufficient so we can detect GCC headers that are inside of a VFS. llvm-svn: 249556
* The Driver does not set the +strict-align flag when targetingAlexandros Lamprineas2015-10-051-1/+2
| | | | | | | | [ARM] armv6m + netbsd. Tests are misssing for armv6m + darwin as well. Differential Revision: http://reviews.llvm.org/D13217 llvm-svn: 249308
* Remove support for the mips-mti-linux toolchain.Vasileios Kalintiris2015-10-051-45/+20
| | | | | | | There are two remaining buildbot failures that we'll have to investigate before submitting this again. llvm-svn: 249298
* Re-commit "Add support for the new mips-mti-linux toolchain."Vasileios Kalintiris2015-10-051-20/+45
| | | | | | | | | | | r249137 added support for the new mips-mti-linux toolchain. However, the new tests of that commit, broke some buildbots because they didn't use the correct regular expressions to capture the filename of Clang & LLD. This commit re-applies the changes of r249137 and fixes the tests in r249137 in order to match the filenames of the Clang and LLD executable. llvm-svn: 249294
* Add -f[no-]declspec to control recognition of __declspec as a keywordSaleem Abdulrasool2015-10-041-0/+7
| | | | | | | | | | | | | | | In versions of clang prior to r238238, __declspec was recognized as a keyword in all modes. It was then changed to only be enabled when Microsoft or Borland extensions were enabled (and for CUDA, as a temporary measure). There is a desire to support __declspec in Playstation code, and possibly other environments. This commit adds a command-line switch to allow explicit enabling/disabling of the recognition of __declspec as a keyword. Recognition is enabled by default in Microsoft, Borland, CUDA, and PS4 environments, and disabled in all other environments. Patch by Warren Ristow! llvm-svn: 249279
* Driver: follow WoA ABI recommendationsSaleem Abdulrasool2015-10-031-0/+4
| | | | | | | | | | The Windows on ARM ABI recommends that FPO be disabled. This is since the Windows on ARM ABI uses the FP for fast stack walking. By paying the slight cost of the loss of registers, a much faster backtrace is possible by using the frame pointer since the pdata need not be consulted. Furthermore, even if pdata is not available, you can still more easily reconstruct the stack. llvm-svn: 249227
* [Myriad]: Accept '-nostdlib' optionDouglas Katzman2015-10-021-17/+23
| | | | llvm-svn: 249166
* [DarwinDriver] Reapply: Use -lto_library to specify the path for libLTO.dylibBruno Cardoso Lopes2015-10-021-9/+28
| | | | | | | | | | | | | | | | | | | | | | Reapply r248935. Usually, when using LTO with a clang installation newer than the system's one, there's a libLTO.dylib version mismatch and LTO fails. One solution to this is to make ld point to the right libLTO.dylib by changing DYLD_LIBRARY_PATH. However, ld64 supports specifying the complete path to the desired libLTO.dylib through the -lto_library option. This commit adds support for the clang driver to use this option whenever it's capable of finding a libLTO.dylib in clang's installed library directory. This way, we don't need to rely on DYLD_LIBRARY_PATH nor get caught by version mismatches. Differential Revision: http://reviews.llvm.org/D13117 rdar://problem/7363476 llvm-svn: 249143
* Revert "Add support for the new mips-mti-linux toolchain."Vasileios Kalintiris2015-10-021-45/+20
| | | | | | | This reverts commit r249137 because it broke the Windows buildbots and a Linux buildbot for LLD. llvm-svn: 249141
* Fix bogus comment.Douglas Katzman2015-10-021-1/+1
| | | | llvm-svn: 249138
* Add support for the new mips-mti-linux toolchain.Vasileios Kalintiris2015-10-021-20/+45
| | | | | | | | | | | | | | | | | | | | Summary: This new toolchain uses primarily LLVM-based tools, eg. compiler-rt, lld, libcxx, etc. Because of this, it doesn't require neither an existing GCC installation nor a GNU environment. Ideally, in a follow-up patch we would like to add a new --{llvm|clang}-toolchain option (similar to --gcc-toolchain) in order to allow the use of this toolchain with independent Clang builds. For the time being, we use the --sysroot option just to test the correctness of the paths generated by the driver. Reviewers: atanasyan, dsanders, rsmith Subscribers: jfb, tberghammer, danalbert, srhines, dschuff, cfe-commits Differential Revision: http://reviews.llvm.org/D13340 llvm-svn: 249137
* Allow a ToolChain to compute the path of a compiler-rt's component.Vasileios Kalintiris2015-10-011-51/+2
| | | | | | | | | | | | | | | | Summary: This patch moves getCompilerRT() from the clang::driver::tools namespace to the ToolChain class. This is needed for multilib toolchains that need to place their libraries in Clang's resource directory with a layout that is different from the default one. Reviewers: atanasyan, rsmith Subscribers: tberghammer, danalbert, srhines, cfe-commits Differential Revision: http://reviews.llvm.org/D13339 llvm-svn: 249030
* Revert "[DarwinDriver] Use -lto_library to specify the path for libLTO.dylib"Bruno Cardoso Lopes2015-09-301-28/+9
| | | | | | Revert r248932. Bots complaining about new warnings where they shouldn't. llvm-svn: 248935
* [DarwinDriver] Use -lto_library to specify the path for libLTO.dylibBruno Cardoso Lopes2015-09-301-9/+28
| | | | | | | | | | | | | | | | | | | | Usually, when using LTO with a clang installation newer than the system's one, there's a libLTO.dylib version mismatch and LTO fails. One solution to this is to make ld point to the right libLTO.dylib by changing DYLD_LIBRARY_PATH. However, ld64 supports specifying the complete path to the desired libLTO.dylib through the -lto_library option. This commit adds support for the clang driver to use this option whenever it's capable of finding a libLTO.dylib in clang's installed library directory. This way, we don't need to rely on DYLD_LIBRARY_PATH nor get caught by version mismatches. Differential Revision: http://reviews.llvm.org/D13117 rdar://problem/7363476 llvm-svn: 248932
* Alias "-ggdbN" to "-gN" options, fixing some incompatibilities.Douglas Katzman2015-09-301-4/+2
| | | | | | | * assembling from a .s file mistook -ggdb0 for -g * -ggdb1 is supposed to mean basically -g1, not -gN for N>1 llvm-svn: 248912
* Driver: support ARM/HF on a single toolchainSaleem Abdulrasool2015-09-261-15/+28
| | | | | | | | | | | | | | | | | ARM EABI adds target attributes to the object file. Amongst the attributes that are emitted is the VFP argument passing (Hard vs Soft). The linker is responsible for checking these attributes and erroring on mismatches. This causes problems for the compiler-rt builtins when targeting both hard and soft. Because both of these options name the builtins compiler-rt component the same (libclang_rt.builtins-arm.a or libclang_rt.builtins-arm-android). GCC is able to get away with this as it does one target per toolchain. This changes the naming convention for the ARM compiler-rt builtins to differentiate between HF and Soft. Although this means that compiler-rt may be duplicated, it enables supporting both variants from a single toolchain. A similar approach is taken by the Darwin toolchain, naming the library to differentiate between the calling conventions. llvm-svn: 248649
* Revert "This patch adds missing pieces to clang, including the PS4 toolchain ↵Greg Bedwell2015-09-251-336/+7
| | | | | | | | definition, added warnings, PS4 defaults, and Driver changes needed for our compiler." This reverts commit r248546 to get our bot green again while we discuss the best way forward. llvm-svn: 248578
* This patch adds missing pieces to clang, including the PS4 toolchainEkaterina Romanova2015-09-241-7/+336
| | | | | | | | | | | definition, added warnings, PS4 defaults, and Driver changes needed for our compiler. A patch by Filipe Cabecinhas, Pierre Gousseau and Katya Romanova! Differential Revision: http://reviews.llvm.org/D11279 llvm-svn: 248546
* Drop useless const in for-range loops.Benjamin Kramer2015-09-241-2/+2
| | | | | | | | StringRefs always point to immutable memory so the const doesn't add value here. Also quiets clang's -Wrange-loop-analysis which warns about the implicit copying. llvm-svn: 248496
* [mips] Relax -mnan=2008 acceptance to permit MIPS32R2 and MIPS64R2.Daniel Sanders2015-09-241-2/+5
| | | | | | | | | | | | | | | Summary: Strictly speaking, the MIPS*R2 ISA's should not permit -mnan=2008 since this feature was added in MIPS*R3. However, other toolchains permit this and we should do the same. Reviewers: atanasyan Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D13057 llvm-svn: 248481
* [ARM] Follow-up to fix crash "-target arm -mcpu=generic", without "-march="Vladimir Sukharev2015-09-241-1/+1
| | | | | | | | | | | Fix of dangling StringRef after temporary std::string is destroyed Follow-up to: http://reviews.llvm.org/rL248479 Reviewers: alexfh Subscribers: cfe-commits llvm-svn: 248480
* [ARM] Follow-up to fix crash "-target arm -mcpu=generic", without "-march="Vladimir Sukharev2015-09-241-3/+3
| | | | | | | | | | | Fix of dangling StringRef after temporary std::string is destroyed Follow-up to: http://reviews.llvm.org/rL248370 Reviewers: alexfh Subscribers: cfe-commits llvm-svn: 248479
* Support linking against OpenMP runtime on NetBSD.Joerg Sonnenberger2015-09-231-0/+1
| | | | llvm-svn: 248426
* Push OpenMP linker flags after linker input on Darwin. Don't add anyJoerg Sonnenberger2015-09-231-2/+4
| | | | | | libraries if -nostdlib is specified. Test. llvm-svn: 248424
* Refactor library decision for -fopenmp support from Darwin into aJoerg Sonnenberger2015-09-231-17/+23
| | | | | | function for sharing with other platforms. llvm-svn: 248379
* Add -fplugin=name.so option to the driverJohn Brawn2015-09-231-0/+7
| | | | | | | | This translates to -load name.so in the cc1 command. We can't name the driver option -load, as that means "link against oad", so instead we follow GCC's lead and name the option -fplugin. llvm-svn: 248378
* [ARM] Fix crash "-target arm -mcpu=generic", without "-march="Vladimir Sukharev2015-09-231-9/+15
| | | | | | | | | | | | | | | | An assertion hit has been fixed for cmdlines like $ clang --target=arm-linux-gnueabi -mcpu=generic hello.c Related to: http://reviews.llvm.org/rL245445 Reviewers: rengolin Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D13013 llvm-svn: 248370
* [mips] Added support for using the command line options -Wa,-msoft-float and ↵Daniel Sanders2015-09-221-0/+6
| | | | | | | | | | | | | | -Wa,-mhard-float. Patch by Scott Egerton. Reviewers: vkalintiris, dsanders Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D12600 llvm-svn: 248276
* Don't pass StringRefs around by const reference. Pass by value instead per ↵Craig Topper2015-09-211-1/+1
| | | | | | coding standards. NFC llvm-svn: 248137
* Driver: alter the getARMFloatABI signatureSaleem Abdulrasool2015-09-191-19/+18
| | | | | | | | | | This changes getARMFloatABI to use the ToolChain and Args instead of Driver, Args, Triple. Although this pushes the Triple calculation/parsing into the function itself, it enables the use of the function for a future change. The reason to sink the triple calculation here is to avoid threading the Triple through multiple layers in a future change. llvm-svn: 248095
* Driver: tweak ARM target feature calculationSaleem Abdulrasool2015-09-191-10/+6
| | | | | | | | | Rather than using re-calculating the effective triple, thread the already calculated value down into AddARMTargetArgs. This avoids both recreating the triple, as well as re-parsing the triple as it was already done in the previous frame. llvm-svn: 248094
* Driver: avoid unnecessary string opsSaleem Abdulrasool2015-09-191-22/+25
| | | | | | | | Use an enumeration for the Floating Point ABIs supported on MIPS. This is replicating the ARM change to avoid string based tracking of the floating point ABI. NFC. llvm-svn: 248083
* Driver: avoid unnecessary string based operationsSaleem Abdulrasool2015-09-181-55/+58
| | | | | | | | Use an enumeration and change the use of the FloatABI from a string to the enumeration. This avoids the use of string values to represent an enumeration. NFC. llvm-svn: 247967
* [Shave]: Drive sparc-myriad-elf-ld directly rather than via gcc.Douglas Katzman2015-09-171-0/+78
| | | | | | Differential Revision: http://reviews.llvm.org/D12541 llvm-svn: 247924
* Emiting llvm.invariant.group.barrier when dynamic type changesPiotr Padlewski2015-09-151-0/+4
| | | | | | | | | For more goto: http://lists.llvm.org/pipermail/cfe-dev/2015-July/044227.html http://reviews.llvm.org/D12312 llvm-svn: 247723
* [Solaris] Default to -fno-cxa-finalize.Rafael Espindola2015-09-141-6/+3
| | | | | | | | | | | There is no __cxa_finalize symbol available on recent Solaris OS versions, so we need this flag to make non trivial C++ programs run. Also stop looking for cxa_finalize.o, since it won't be there. Patch by Xan López! llvm-svn: 247634
* [Static Analyzer] Turn on some nullability checks by default.Gabor Horvath2015-09-141-0/+5
| | | | | | Differential Revision: http://reviews.llvm.org/D12858 llvm-svn: 247614
* Driver should forward at most one gdwarf-N flag to cc1as.Douglas Katzman2015-09-141-14/+9
| | | | llvm-svn: 247611
* [Solaris] Add -lc also when linking shared librariesRafael Espindola2015-09-141-1/+1
| | | | | | | | | | This is actually needed, otherwise libc won't be added at all. For instance when building libclang.so all the libc symbols won't be found, with ld warning about libc being an "implicit dependency". Patch by Xan López! llvm-svn: 247603
* [Shave]: pass -isystem dirs and "-Wa," args to moviAsmDouglas Katzman2015-09-111-4/+5
| | | | llvm-svn: 247474
* Record function attribute "stackrealign" instead of using backend optionAkira Hatanaka2015-09-111-7/+1
| | | | | | | | | | | | -force-align-stack. Also, make changes to the driver so that -mno-stack-realign is no longer an option exposed to the end-user that disallows stack realignment in the backend. Differential Revision: http://reviews.llvm.org/D11815 llvm-svn: 247451
* [modules] Don't load files specified by -fmodule-file= when modules areRichard Smith2015-09-111-1/+4
| | | | | | disabled. (We still allow this via -cc1 / -Xclang, primarily for testing.) llvm-svn: 247384
* [Driver] Use UniversalCRT on Windows if availableReid Kleckner2015-09-111-0/+7
| | | | | | | | | | | | | | | | | | | | Summary: With Visual Studio 2015 release, a part of runtime library was extracted and now comes with Windows Kits. This patch enables clang to use Universal CRT library if %INCLUDE or %LIB environment varaibles are not specified. See also https://llvm.org/bugs/show_bug.cgi?id=24741 Patch by Igor Kudrin Reviewers: zturner, hans, rnk Subscribers: ruiu, cfe-commits Differential Revision: http://reviews.llvm.org/D12695 llvm-svn: 247362
* [OPENMP] Generate threadprivates as TLS variables by default.Alexey Bataev2015-09-101-4/+1
| | | | | | If target supports TLS all threadprivates are generated as TLS. If target does not support TLS, use runtime calls for proper codegen of threadprivate variables. llvm-svn: 247273
* [Shave]: add a -MT option to moviCompile if there wasn't oneDouglas Katzman2015-09-081-9/+21
| | | | | | Differential Revision: http://reviews.llvm.org/D12622 llvm-svn: 247052
* [WebAssembly] Initial WebAssembly support in clangDan Gohman2015-09-031-2/+55
| | | | | | | | | | This implements basic support for compiling (though not yet assembling or linking) for a WebAssembly target. Note that ABI details are not yet finalized, and may change. Differential Revision: http://reviews.llvm.org/D12002 llvm-svn: 246814
* [mips] Added support for choosing between traps and breaks in the integrated ↵Daniel Sanders2015-09-031-0/+6
| | | | | | | | | | | | | | | | assembler macros. Summary: The command line options for these are -Wa,--trap and -Wa,--break. Patch by Scott Egerton. Reviewers: vkalintiris, dsanders Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11676 llvm-svn: 246765
OpenPOWER on IntegriCloud