summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChain.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [cfi] Enable cfi-icall on ARM and AArch64.Evgeniy Stepanov2016-11-111-0/+2
| | | | llvm-svn: 286613
* [Driver][OpenMP] Add support to create jobs for bundling actions.Samuel Antao2016-10-271-2/+7
| | | | | | | | | | | | Summary: This patch adds the support to create a job for the `OffloadBundlingAction` which will invoke the `clang-offload-bundler` tool. Reviewers: echristo, tra, jlebar, ABataev, hfinkel Subscribers: whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin Differential Revision: https://reviews.llvm.org/D21856 llvm-svn: 285325
* [Driver][OpenMP] Update actions builder to create unbundling action when ↵Samuel Antao2016-10-271-0/+1
| | | | | | | | | | | | | | | | | necessary. Summary: Each time that offloading support is requested by the user and the input file is not a source file, an action `OffloadUnbundlingAction` is created to signal that the input file may contain bundles, so that the proper tool is then invoked to attempt to extract the components of the bundle. This patch adds the logic to create that action in offload action builder. The job creation for the new action will be proposed in a separate patch. Reviewers: echristo, tra, jlebar, ABataev, hfinkel Subscribers: whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin Differential Revision: https://reviews.llvm.org/D21853 llvm-svn: 285324
* [Driver][OpenMP] Update actions builder to create bundling action when ↵Samuel Antao2016-10-271-0/+4
| | | | | | | | | | | | | | | | | necessary. Summary: In order to save the user from dealing with multiple output files (for host and device) while using separate compilation, a new action `OffloadBundlingAction` is used when the last phase is not linking. This action will then result in a job that uses the proposed bundling tool to create a single preprocessed/IR/ASM/Object file from multiple ones. The job creation for the new action will be proposed in a separate patch. Reviewers: echristo, tra, jlebar, ABataev, hfinkel Subscribers: whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin Differential Revision: https://reviews.llvm.org/D21852 llvm-svn: 285323
* Driver: use StringRef instead of raw pointer in lookupTypeForExtension() (NFC)Mehdi Amini2016-10-071-1/+1
| | | | llvm-svn: 283611
* Revert "Driver: use the canonical static library naming"Saleem Abdulrasool2016-08-311-3/+3
| | | | | | | | This breaks chromium and its unclear if this is actually a modern convention. This reverts SVN r280169. llvm-svn: 280281
* Driver: use the canonical static library namingSaleem Abdulrasool2016-08-301-3/+3
| | | | | | | | | | On Windows, static libraries are named lib<name>.lib while import libraries are named <name>.lib. Use the appropriate naming on itanium and msvc environments. This is setup properly so that if a dynamic builtins is used on Windows, it would do the right thing, although this is not currently wired through the driver (i.e. there is no equivalent to -{shared,static}-gcc). llvm-svn: 280169
* [Driver] Enable CFI for WebAssemblyDerek Schuff2016-08-081-1/+3
| | | | | | | | | | | Since CFI support has landed in the WebAssembly backend, enable it in the frontend driver. Patch by Dominic Chen Differential Revision: https://reviews.llvm.org/D23244 llvm-svn: 278051
* Retry: [Driver] Compute effective target triples once per job (NFCI)Vedant Kumar2016-07-271-1/+2
| | | | | | | | | | | | | | | | Compute an effective triple once per job. Cache the triple in the prevailing ToolChain for the duration of the job. Clients which need effective triples now look them up in the ToolChain. This eliminates wasteful re-computation of effective triples (e.g in getARMFloatABI()). While we're at it, delete MachO::ComputeEffectiveClangTriple. It was a no-op override. Differential Revision: https://reviews.llvm.org/D22596 llvm-svn: 276937
* Revert "[Driver] Compute effective target triples once per job (NFCI)"Vedant Kumar2016-07-271-30/+22
| | | | | | | This reverts commit r275895 in order to address some post-commit review feedback from Eric Christopher (see: the list thread for r275895). llvm-svn: 276936
* [ARM] Pass thumb as architecture to the underlying tools, when targeting windowsRenato Golin2016-07-271-1/+3
| | | | | | | | This makes sure that the thumb section flag gets set by the assembler. Patch by Martin Storsjö. llvm-svn: 276869
* Support setting default value for -rtlib at build timeJonas Hahnfeld2016-07-271-9/+13
| | | | | | | | | | | | | | | | | This patch introduces a new cmake variable: CLANG_DEFAULT_RTLIB, thru which we can specify a default value for -rtlib (libgcc or compiler-rt) at build time, just like how we set the default C++ stdlib thru CLANG_DEFAULT_CXX_STDLIB. With these two options, we can configure clang to build binaries on Linux that have no runtime dependence on any gcc libs (libstdc++ or libgcc_s). Patch by Lei Zhang! Differential Revision: https://reviews.llvm.org/D22663 llvm-svn: 276848
* Update description for CLANG_DEFAULT_CXX_STDLIB and add comment. NFCJonas Hahnfeld2016-07-251-0/+2
| | | | | | | We agreed to call it "platform default" instead of "architecture default". (see D17286) llvm-svn: 276618
* [Driver] Compute effective target triples once per job (NFCI)Vedant Kumar2016-07-181-22/+30
| | | | | | | | | | Compute an effective target triple exactly once in ConstructJob(), and then simply pass around references to it. This eliminates wasteful re-computation of effective triples (e.g in getARMFloatABI()). Differential Revision: https://reviews.llvm.org/D22290 llvm-svn: 275895
* [NFC] Header cleanupMehdi Amini2016-07-181-3/+3
| | | | | | | | | | Summary: Removed unused headers, replaced some headers with forward class declarations Patch by: Eugene <claprix@yandex.ru> Differential Revision: https://reviews.llvm.org/D20100 llvm-svn: 275882
* [CUDA][OpenMP] Create generic offload actionSamuel Antao2016-07-151-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch replaces the CUDA specific action by a generic offload action. The offload action may have multiple dependences classier in “host” and “device”. The way this generic offloading action is used is very similar to what is done today by the CUDA implementation: it is used to set a specific toolchain and architecture to its dependences during the generation of jobs. This patch also proposes propagating the offloading information through the action graph so that that information can be easily retrieved at any time during the generation of commands. This allows e.g. the "clang tool” to evaluate whether CUDA should be supported for the device or host and ptas to easily retrieve the target architecture. This is an example of how the action graphs would look like (compilation of a single CUDA file with two GPU architectures) ``` 0: input, "cudatests.cu", cuda, (host-cuda) 1: preprocessor, {0}, cuda-cpp-output, (host-cuda) 2: compiler, {1}, ir, (host-cuda) 3: input, "cudatests.cu", cuda, (device-cuda, sm_35) 4: preprocessor, {3}, cuda-cpp-output, (device-cuda, sm_35) 5: compiler, {4}, ir, (device-cuda, sm_35) 6: backend, {5}, assembler, (device-cuda, sm_35) 7: assembler, {6}, object, (device-cuda, sm_35) 8: offload, "device-cuda (nvptx64-nvidia-cuda:sm_35)" {7}, object 9: offload, "device-cuda (nvptx64-nvidia-cuda:sm_35)" {6}, assembler 10: input, "cudatests.cu", cuda, (device-cuda, sm_37) 11: preprocessor, {10}, cuda-cpp-output, (device-cuda, sm_37) 12: compiler, {11}, ir, (device-cuda, sm_37) 13: backend, {12}, assembler, (device-cuda, sm_37) 14: assembler, {13}, object, (device-cuda, sm_37) 15: offload, "device-cuda (nvptx64-nvidia-cuda:sm_37)" {14}, object 16: offload, "device-cuda (nvptx64-nvidia-cuda:sm_37)" {13}, assembler 17: linker, {8, 9, 15, 16}, cuda-fatbin, (device-cuda) 18: offload, "host-cuda (powerpc64le-unknown-linux-gnu)" {2}, "device-cuda (nvptx64-nvidia-cuda)" {17}, ir 19: backend, {18}, assembler 20: assembler, {19}, object 21: input, "cuda", object 22: input, "cudart", object 23: linker, {20, 21, 22}, image ``` The changes in this patch pass the existent regression tests (keeps the existent functionality) and resulting binaries execute correctly in a Power8+K40 machine. Reviewers: echristo, hfinkel, jlebar, ABataev, tra Subscribers: guansong, andreybokhanko, tcramer, mkuron, cfe-commits, arpith-jacob, carlo.bertolli, caomhin Differential Revision: https://reviews.llvm.org/D18171 llvm-svn: 275645
* Compilation for Intel MCU (Part 2/3)Andrey Turetskiy2016-06-161-0/+3
| | | | | | | | | | | | This is the second patch required to support compilation for Intel MCU target (e.g. Intel(R) Quark(TM) micro controller D 2000). When IAMCU triple is used: * Recognize and use IAMCU GCC toolchain * Set up include paths * Forbid C++ Differential Revision: http://reviews.llvm.org/D19274 llvm-svn: 272883
* Make FreeBSD and NetBSD use CLANG_DEFAULT_CXX_STDLIBJonas Hahnfeld2016-03-141-3/+10
| | | | | | | | | Also introduce -stdlib=platform to override the configured value and use it to make the tests always pass. Differential Revision: http://reviews.llvm.org/D17286 llvm-svn: 263434
* Accept absolute paths in the -fuse-ld option.Peter Zotov2016-03-091-13/+20
| | | | | | | | | | | | | | | | | | | | | | | | This patch extends the -fuse-ld option to accept a full path to an executable and use it verbatim to invoke the linker. There are generally two reasons to desire this. The first reason relates to the sad truth is that Clang is retargetable, Binutils are not. While any Clang from a binary distribution is sufficient to compile code for a wide range of architectures and prefixed BFD linkers (e.g. installed as /usr/bin/arm-none-linux-gnueabi-ld) as well as cross-compiled libc's (for non-bare-metal targets) are widely available, including on all Debian derivatives, it is impossible to use them together because the -fuse-ld= option allows to specify neither a linker prefix nor a full path to one. The second reason is linker development, both when porting existing linkers to new architectures and when working on a new linker such as LLD. Differential Revision: http://reviews.llvm.org/D17952 llvm-svn: 262996
* Fix remaining Clang-tidy readability-redundant-control-flow warnings; other ↵Eugene Zelenko2016-02-121-1/+0
| | | | | | | | minor fixes. Differential revision: http://reviews.llvm.org/D17218 llvm-svn: 260757
* [CMake] Add option to switch default C++ stdlibJonas Hahnfeld2016-02-121-9/+26
| | | | | | | | | With this option one can optionally override the architecture dependent default library to use if no -stdlib= is provided on compiler invocation. Differential Revision: http://reviews.llvm.org/D15920 llvm-svn: 260662
* Driver: protect from empty -L argsMartell Malone2015-11-261-1/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D12466 llvm-svn: 254117
* Driver: Defer computation of linker path until it is needed.Peter Collingbourne2015-11-201-1/+1
| | | | | | | This allows us to construct Linux toolchains without a valid linker. This is needed for example to build a CUDA device toolchain after r253385. llvm-svn: 253707
* [CUDA] added include paths for both sides of CUDA compilation.Artem Belevich2015-11-171-0/+3
| | | | | | | | | | | | | | | | | | | | | In order to compile a CUDA file clang must be able to find include files for both both host and device. This patch passes AuxToolchain to AddPreprocessingOptions and uses it to add include paths for the opposite side of compilation. We also must be able to find CUDA include files. If the driver found CUDA installation, it adds appropriate include path to CUDA headers. This can be disabled with '-nocudainc'. - Added include paths for the opposite side of compilation. - Added include paths to detected CUDA installation. - Added -nocudainc to prevent adding CUDA include path. - Added test cases to verify new functionality. Differential Revision: http://reviews.llvm.org/D13170 llvm-svn: 253386
* Add trivial utility to append -L arguments to linker step. NFCDouglas Katzman2015-11-171-0/+6
| | | | llvm-svn: 253350
* Re-recommit: Add support for the new mips-mti-linux toolchain.Vasileios Kalintiris2015-11-121-1/+0
| | | | | | | | Last time, this caused two Windows buildbots and a single ARM buildbot to fail. I XFAIL'd the failing test on win32,win64 machines in order to see if the ARM buildbot complains again. llvm-svn: 252901
* [ARM] Clang gives unintended warning message for 'mthumb' + M-profiles:Alexandros Lamprineas2015-11-051-3/+2
| | | | | | | | | $ clang --target=armv7m-none-eabi -mthumb -march=armv7-m -c test.c clang-3.8: warning: argument unused during compilation: '-mthumb' Differential Revision: http://reviews.llvm.org/D14384 llvm-svn: 252175
* Revert "[mips] Add support for the new mips-mti-linux toolchain."Vasileios Kalintiris2015-10-301-0/+1
| | | | | | | This reverts commits r251633. I'll investigate the test failure off trunk in order to keep the buildbots clean. llvm-svn: 251698
* [mips] Add support for the new mips-mti-linux toolchain.Vasileios Kalintiris2015-10-291-1/+0
| | | | | | | | | | The original commit in r249137 added the mips-mti-linux toolchain. However, the newly added tests of that commit failed in few buildbots. This commit re-applies the original changes but XFAILs the test file which caused the buildbot failures. This will allow us to examine what's going wrong without having to commit/revert large changes. llvm-svn: 251633
* When running clang with an arm triple such as '--target=thumbv7m-none-eabi'Alexandros Lamprineas2015-10-281-6/+8
| | | | | | | | | | | | that has a thumb only CPU by default (cortex-m3), and when using the assembler, the default thumb state of the CPU does not get passed via the triple to LLVM: $ clang -target thumbv7m-none-eabi -c -v test.s clang -cc1as ... -triple armv7m-none--eabi ... test.s Differential Revision: http://reviews.llvm.org/D14121 llvm-svn: 251507
* clang driver toolchain refactoringXinliang David Li2015-10-221-4/+30
| | | | | | | | | | | | | | In this patch, the file static method addProfileRT is moved to be a virtual member function of base ToolChain class. This allows derived toolchain to override the default behavior easily and make it consistent with Darwin toolchain (a TODO was added for this refactoring - now removed). A new helper method is also introduced to test if instrumentation profile option is turned on or not. Differential Revision: http://reviews.llvm.org/D13326 llvm-svn: 250994
* Roll-back r250822.Angel Garcia Gomez2015-10-201-1/+2
| | | | | | | | | | Summary: It breaks the build for the ASTMatchers Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D13893 llvm-svn: 250827
* Apply modernize-use-default to clang.Angel Garcia Gomez2015-10-201-2/+1
| | | | | | | | | | | | Summary: Replace empty bodies of default constructors and destructors with '= default'. Reviewers: bkramer, klimek Subscribers: klimek, alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13890 llvm-svn: 250822
* Use Triple.isAndroid() where possible.Evgeniy Stepanov2015-10-081-2/+1
| | | | llvm-svn: 249751
* [VFS] Port driver tool chains to VFS.Benjamin Kramer2015-10-071-3/+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
* Remove support for the mips-mti-linux toolchain.Vasileios Kalintiris2015-10-051-0/+1
| | | | | | | 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-1/+0
| | | | | | | | | | | 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
* Revert "Add support for the new mips-mti-linux toolchain."Vasileios Kalintiris2015-10-021-0/+1
| | | | | | | This reverts commit r249137 because it broke the Windows buildbots and a Linux buildbot for LLD. llvm-svn: 249141
* Add support for the new mips-mti-linux toolchain.Vasileios Kalintiris2015-10-021-1/+0
| | | | | | | | | | | | | | | | | | | | 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-1/+39
| | | | | | | | | | | | | | | | 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
* The Clang gcc-compatible driver (clang/tools/driver/driver.cpp) has someEric Christopher2015-09-251-0/+94
| | | | | | | | | | | | | | | | | | | | | | | logic to select an alternate target based on the executable it was called as. For instance, if you symlink i686-linux-android-gcc to clang and invoke it, the driver will act as though it were called with another argument ("-target i686-linux-android"). This leads to visible effects even in syntax-only compilations (like the ANDROID preprocessor symbol being defined). This behavior is not replicated for tool invocations--for instance, clang::createInvocationFromCommandLine will not choose an alternate target based on ArgList[0]. This means that configurations stored in compilation databases aren't accurately replayed. This patch separates the logic for selecting a mode flag and target from the executable name into a new member function on ToolChain. It should have no functional effects (but will allow other code to reuse the target/mode selection logic). Patch by Luke Zarko! llvm-svn: 248592
* [ARM] Fix crash "-target arm -mcpu=generic", without "-march="Vladimir Sukharev2015-09-231-2/+1
| | | | | | | | | | | | | | | | 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
* Driver: Support cfi-icall on all OSs when targeting x86/x86_64.Peter Collingbourne2015-09-101-3/+7
| | | | llvm-svn: 247324
* CFI: Introduce -fsanitize=cfi-icall flag.Peter Collingbourne2015-09-101-1/+1
| | | | | | | | | | This flag causes the compiler to emit bit set entries for functions as well as runtime bitset checks at indirect call sites. Depends on the new function bitset mechanism. Differential Revision: http://reviews.llvm.org/D11857 llvm-svn: 247238
* [WebAssembly] Initial WebAssembly support in clangDan Gohman2015-09-031-2/+4
| | | | | | | | | | 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
* Update for several APIs in LLVM that now use StringRefs rather thanChandler Carruth2015-08-301-3/+4
| | | | | | | | const char pointers. In turn, push this through Clang APIs as well, simplifying a number of bits of code that was handling the oddities of nullptrs. llvm-svn: 246375
* Range-forify a loop, delete trailing whitespace. NFCDouglas Katzman2015-08-061-6/+4
| | | | llvm-svn: 244290
* [ARM] Changes to Arch/CPU handling to help with -Wa,-mfpu etc. (nfc)Renato Golin2015-07-271-3/+8
| | | | | | | | | | | | To be able to handle -Wa, options in the assembler (ClangAs), we need to make the handling of options based on the value of the options, not direct Arguments from the list, since the list is immutable. No functional change in this patch, but this allows validating of -Wa,-mfpu and friends in the same way we validate -mfpu and friends, *just* for the assembler. llvm-svn: 243352
* [cuda] Driver changes to compile and stitch together host and device-side ↵Artem Belevich2015-07-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | CUDA code. NOTE: reverts r242077 to reinstate r242058, r242065, 242067 and includes fix for OS X test failures. - Changed driver pipeline to compile host and device side of CUDA files and incorporate results of device-side compilation into host object file. - Added a test for cuda pipeline creation in clang driver. New clang options: --cuda-host-only - Do host-side compilation only. --cuda-device-only - Do device-side compilation only. --cuda-gpu-arch=<ARCH> - specify GPU architecture for device-side compilation. E.g. sm_35, sm_30. Default is sm_20. May be used more than once in which case one device-compilation will be done per unique specified GPU architecture. Differential Revision: http://reviews.llvm.org/D9509 llvm-svn: 242085
* This reverts commit r242058, r242065, r242067.Rafael Espindola2015-07-131-2/+0
| | | | | | | | | | The tests were failing on OS X. Revert "[cuda] Driver changes to compile and stitch together host and device-side CUDA code." Revert "Fixed regex to properly match '64' in the test case." Revert "clang/test/Driver/cuda-options.cu REQUIRES clang-driver, at least." llvm-svn: 242077
OpenPOWER on IntegriCloud