aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Driver/Tools.cpp
AgeCommit message (Collapse)AuthorFilesLines
2015-10-13Always pass a -dwarf-version argument to integrated as.Douglas Katzman1-2/+3
This removes the default of 3 hidden in the assembler previously. Fixes breakage caused by r249655, reported by vsukharev. llvm-svn: 250173
2015-10-12Support Debug Info path remappingSaleem Abdulrasool1-0/+9
Add support for the `-fdebug-prefix-map=` option as in GCC. The syntax is `-fdebug-prefix-map=OLD=NEW`. When compiling files from a path beginning with OLD, change the debug info to indicate the path as start with NEW. This is particularly helpful if you are preprocessing in one path and compiling in another (e.g. for a build cluster with distcc). Note that the linearity of the implementation is not as terrible as it may seem. This is normally done once per file with an expectation that the map will be small (1-2) entries, making this roughly linear in the number of input paths. Addresses PR24619. llvm-svn: 250094
2015-10-09[Myriad]: put libstdc++ and libc in the right orderDouglas Katzman1-2/+2
llvm-svn: 249893
2015-10-08Use Triple.isAndroid() where possible.Evgeniy Stepanov1-12/+10
llvm-svn: 249751
2015-10-08[clang-cl] Make /EHs turn on C++ EH once againReid Kleckner1-4/+0
C++ exceptions are still off by default, which is similar to how C++ cleanups are off by default in MSVC. If you use clang instead of clang-cl, exceptions are also still off by default. In the future, when C++ EH is proven to be stable, we may flip the default for that driver to be consistent with other platforms. llvm-svn: 249704
2015-10-08[Driver] Use Twine instead of itostr. NFC.Benjamin Kramer1-1/+1
No need to construct temporary std::strings here. llvm-svn: 249676
2015-10-08Use itostr(), not std::to_string() because of Android.Douglas Katzman1-1/+1
llvm-svn: 249658
2015-10-08Stop messing with the 'g' group of options in CompilerInvocation.Douglas Katzman1-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
2015-10-07[VFS] Port driver tool chains to VFS.Benjamin Kramer1-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
2015-10-05The Driver does not set the +strict-align flag when targetingAlexandros Lamprineas1-1/+2
[ARM] armv6m + netbsd. Tests are misssing for armv6m + darwin as well. Differential Revision: http://reviews.llvm.org/D13217 llvm-svn: 249308
2015-10-05Remove support for the mips-mti-linux toolchain.Vasileios Kalintiris1-45/+20
There are two remaining buildbot failures that we'll have to investigate before submitting this again. llvm-svn: 249298
2015-10-05Re-commit "Add support for the new mips-mti-linux toolchain."Vasileios Kalintiris1-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
2015-10-04Add -f[no-]declspec to control recognition of __declspec as a keywordSaleem Abdulrasool1-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
2015-10-03Driver: follow WoA ABI recommendationsSaleem Abdulrasool1-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
2015-10-02[Myriad]: Accept '-nostdlib' optionDouglas Katzman1-17/+23
llvm-svn: 249166
2015-10-02[DarwinDriver] Reapply: Use -lto_library to specify the path for libLTO.dylibBruno Cardoso Lopes1-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
2015-10-02Revert "Add support for the new mips-mti-linux toolchain."Vasileios Kalintiris1-45/+20
This reverts commit r249137 because it broke the Windows buildbots and a Linux buildbot for LLD. llvm-svn: 249141
2015-10-02Fix bogus comment.Douglas Katzman1-1/+1
llvm-svn: 249138
2015-10-02Add support for the new mips-mti-linux toolchain.Vasileios Kalintiris1-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
2015-10-01Allow a ToolChain to compute the path of a compiler-rt's component.Vasileios Kalintiris1-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
2015-09-30Revert "[DarwinDriver] Use -lto_library to specify the path for libLTO.dylib"Bruno Cardoso Lopes1-28/+9
Revert r248932. Bots complaining about new warnings where they shouldn't. llvm-svn: 248935
2015-09-30[DarwinDriver] Use -lto_library to specify the path for libLTO.dylibBruno Cardoso Lopes1-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
2015-09-30Alias "-ggdbN" to "-gN" options, fixing some incompatibilities.Douglas Katzman1-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
2015-09-26Driver: support ARM/HF on a single toolchainSaleem Abdulrasool1-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
2015-09-25Revert "This patch adds missing pieces to clang, including the PS4 toolchain ↵Greg Bedwell1-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
2015-09-24This patch adds missing pieces to clang, including the PS4 toolchainEkaterina Romanova1-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
2015-09-24Drop useless const in for-range loops.Benjamin Kramer1-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
2015-09-24[mips] Relax -mnan=2008 acceptance to permit MIPS32R2 and MIPS64R2.Daniel Sanders1-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
2015-09-24[ARM] Follow-up to fix crash "-target arm -mcpu=generic", without "-march="Vladimir Sukharev1-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
2015-09-24[ARM] Follow-up to fix crash "-target arm -mcpu=generic", without "-march="Vladimir Sukharev1-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
2015-09-23Support linking against OpenMP runtime on NetBSD.Joerg Sonnenberger1-0/+1
llvm-svn: 248426
2015-09-23Push OpenMP linker flags after linker input on Darwin. Don't add anyJoerg Sonnenberger1-2/+4
libraries if -nostdlib is specified. Test. llvm-svn: 248424
2015-09-23Refactor library decision for -fopenmp support from Darwin into aJoerg Sonnenberger1-17/+23
function for sharing with other platforms. llvm-svn: 248379
2015-09-23Add -fplugin=name.so option to the driverJohn Brawn1-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
2015-09-23[ARM] Fix crash "-target arm -mcpu=generic", without "-march="Vladimir Sukharev1-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
2015-09-22[mips] Added support for using the command line options -Wa,-msoft-float and ↵Daniel Sanders1-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
2015-09-21Don't pass StringRefs around by const reference. Pass by value instead per ↵Craig Topper1-1/+1
coding standards. NFC llvm-svn: 248137
2015-09-19Driver: alter the getARMFloatABI signatureSaleem Abdulrasool1-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
2015-09-19Driver: tweak ARM target feature calculationSaleem Abdulrasool1-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
2015-09-19Driver: avoid unnecessary string opsSaleem Abdulrasool1-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
2015-09-18Driver: avoid unnecessary string based operationsSaleem Abdulrasool1-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
2015-09-17[Shave]: Drive sparc-myriad-elf-ld directly rather than via gcc.Douglas Katzman1-0/+78
Differential Revision: http://reviews.llvm.org/D12541 llvm-svn: 247924
2015-09-15Emiting llvm.invariant.group.barrier when dynamic type changesPiotr Padlewski1-0/+4
For more goto: http://lists.llvm.org/pipermail/cfe-dev/2015-July/044227.html http://reviews.llvm.org/D12312 llvm-svn: 247723
2015-09-14[Solaris] Default to -fno-cxa-finalize.Rafael Espindola1-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
2015-09-14[Static Analyzer] Turn on some nullability checks by default.Gabor Horvath1-0/+5
Differential Revision: http://reviews.llvm.org/D12858 llvm-svn: 247614
2015-09-14Driver should forward at most one gdwarf-N flag to cc1as.Douglas Katzman1-14/+9
llvm-svn: 247611
2015-09-14[Solaris] Add -lc also when linking shared librariesRafael Espindola1-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
2015-09-11[Shave]: pass -isystem dirs and "-Wa," args to moviAsmDouglas Katzman1-4/+5
llvm-svn: 247474
2015-09-11Record function attribute "stackrealign" instead of using backend optionAkira Hatanaka1-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
2015-09-11[modules] Don't load files specified by -fmodule-file= when modules areRichard Smith1-1/+4
disabled. (We still allow this via -cc1 / -Xclang, primarily for testing.) llvm-svn: 247384