summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Driver.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [CUDA] use -aux-triple to pass target triple of opposite side of compilationArtem Belevich2015-11-171-34/+38
| | | | | | | | | | | | | | | | Clang needs to know target triple for both sides of compilation so that preprocessor macros and target builtins from both sides are available. This change augments Compilation class to carry information about toolchains used during different CUDA compilation passes and refactors BuildActions to use it when it constructs CUDA jobs. Removed DeviceTriple from CudaHostAction/CudaDeviceAction as it's no longer needed. Differential Revision: http://reviews.llvm.org/D13144 llvm-svn: 253385
* Re-recommit: Add support for the new mips-mti-linux toolchain.Vasileios Kalintiris2015-11-121-0/+8
| | | | | | | | 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
* Clang format a few prior patches (NFC)Teresa Johnson2015-11-021-1/+2
| | | | | | | I had clang formatted my earlier patches using the wrong style. Reformatted with the LLVM style. llvm-svn: 251813
* Support watchOS and tvOS driver optionsTim Northover2015-10-301-0/+2
| | | | | | | | This patch should add support for almost all command-line options and driver tinkering necessary to produce a correct "clang -cc1" invocation for watchOS and tvOS. llvm-svn: 251706
* Revert "[mips] Add support for the new mips-mti-linux toolchain."Vasileios Kalintiris2015-10-301-8/+0
| | | | | | | 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-0/+8
| | | | | | | | | | 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
* Recommit "Clang support for -flto=thin."Teresa Johnson2015-10-151-6/+30
| | | | | | | | | This recommits r250398 with fixes to the tests for bot failures. Add "-target x86_64-unknown-linux" to the clang invocations that check for the gold plugin. llvm-svn: 250455
* Revert "Clang support for -flto=thin." (bot failures)Teresa Johnson2015-10-151-30/+6
| | | | | | | | | | | Rolling this back for now since there are a couple of bot failures on the new tests I added, and I won't have a chance to look at them in detail until later this afternoon. I think the new tests need some restrictions on having the gold plugin available. This reverts commit r250398. llvm-svn: 250402
* Clang support for -flto=thin.Teresa Johnson2015-10-151-6/+30
| | | | | | | | | | | | | | | | | | | Summary: Add clang support for -flto=thin option, which is used to set the EmitFunctionSummary code gen option on compiles. Add -flto=full as an alias to the existing -flto. Add tests to check for proper overriding of -flto variants on the command line, and convert grep tests to FileCheck. Reviewers: dexonsmith, joker.eph Subscribers: davidxl, cfe-commits Differential Revision: http://reviews.llvm.org/D11908 llvm-svn: 250398
* Bring back r250262: PS4 toolchainFilipe Cabecinhas2015-10-141-0/+3
| | | | | | | | | | | | | | There was a minor problem with a test. Sorry for the noise yesterday. This patch adds missing pieces to clang, including the PS4 toolchain 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/D13482 llvm-svn: 250293
* Revert-to-green r250262 (PS4 toolchain patch)Sean Silva2015-10-141-3/+0
| | | | | | | It is breaking llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast e.g. http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/1362 llvm-svn: 250273
* I took care of the build problem in the commit 250252.Ekaterina Romanova2015-10-141-0/+3
| | | | | | | | | | | | | | Resubmitting the patch. This patch adds missing pieces to clang, including the PS4 toolchain 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/D13482 llvm-svn: 250262
* reverting my patch, cause build problemsEkaterina Romanova2015-10-141-3/+0
| | | | llvm-svn: 250257
* This patch adds missing pieces to clang, including the PS4 toolchainEkaterina Romanova2015-10-131-0/+3
| | | | | | | | | | | 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/D13482 llvm-svn: 250252
* [Driver] Use the parent_path of the clang executable as the default InstalledDirBenjamin Kramer2015-10-131-0/+1
| | | | | | | | This is what most people want anyways. Clang -cc1's main() will override this but for other tools this is the most sensible default and avoids some work. llvm-svn: 250164
* [VFS] Port driver tool chains to VFS.Benjamin Kramer2015-10-071-2/+8
| | | | | | | 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-8/+0
| | | | | | | 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-0/+8
| | | | | | | | | | | 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-8/+0
| | | | | | | 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-0/+8
| | | | | | | | | | | | | | | | | | | | 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
* Revert "This patch adds missing pieces to clang, including the PS4 toolchain ↵Greg Bedwell2015-09-251-3/+0
| | | | | | | | 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-0/+3
| | | | | | | | | | | 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
* Augmented CudaHostAction to carry device-side triple.Artem Belevich2015-09-221-8/+7
| | | | | | Differential Revision: http://reviews.llvm.org/D12893 llvm-svn: 248298
* [CUDA] Fixes minor cuda-related issues in the driverArtem Belevich2015-09-221-13/+20
| | | | | | | | | | * Only the last of the --cuda-host-only/--cuda-device-only options has effect. * CudaHostAction always wraps host-side compilation now. * Fixed printing of empty action lists. Differential Revision: http://reviews.llvm.org/D12892 llvm-svn: 248297
* Convert two loops to range-based loops. No behavior change.Nico Weber2015-09-191-5/+3
| | | | llvm-svn: 248100
* clang-cl: Use 'pc' for the vendor field in the default tripleHans Wennborg2015-09-181-0/+1
| | | | | | | Leaving it unset can make the triple look confusing, especially when using -m32 or -m64. llvm-svn: 248005
* [Shave]: Drive sparc-myriad-elf-ld directly rather than via gcc.Douglas Katzman2015-09-171-4/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D12541 llvm-svn: 247924
* [WebAssembly] Initial WebAssembly support in clangDan Gohman2015-09-031-0/+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
* [CUDA] Improve CUDA compilation pipeline creation.Artem Belevich2015-08-271-36/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current implementation tries to guess which Action will result in a job which needs to incorporate device-side GPU binaries. The guessing was attempting to work around the fact that multiple actions may be combined into a single compiler invocation. If CudaHostAction ends up being combined (and thus bypassed during action list traversal) no device-side actions it pointed to were processed. The guessing worked for most of the usual cases, but fell apart when external assembler was used. This change removes the guessing and makes sure we create and pass device-side jobs regardless of how the jobs get combined. * CudaHostAction is always inserted either at Compile phase or the FinalPhase of current compilation, whichever happens first. * If selectToolForJob combines CudaHostAction with other actions, it passes info about CudaHostAction up to the caller * When it sees that CudaHostAction got combined with other actions (and hence will never be passed to BuildJobsForActions), BuildJobsForActions creates device-side jobs the same way they would be created if CudaHostAction was passed to BuildJobsForActions directly. * Added two more test cases to make sure GPU binaries are passed to correct jobs. Differential Revision: http://reviews.llvm.org/D11280 llvm-svn: 246174
* Don't compare getArchName() to "tce" as a string. NFC.Douglas Katzman2015-08-121-12/+19
| | | | llvm-svn: 244791
* Fix a tiny bug in -no-canonical-prefixes that somehow we have neverChandler Carruth2015-08-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | noticed until now. The code for setting up the driver's InstalledDir didn't respect -no-canonical-prefixes. Because of this, there are a few places in the driver where we would unexpectedly form absolute paths, notably when searching for and finding GCC installations to use, etc. The fix is straightforward, and I've added this path to '-v' both so we can test it sanely and so that it will be substantially more obvious the next time someone has to debug something here. Note that there is another bug that we don't actually *canonicalize* the installed directory! I don't really want to fix that because I don't have a realistic way to test the usage of this mode. I suspect that folks using the shared module cache would care about getting this right though, and so they might want to address it. I've left the appropriate FIXMEs so that it is clear what to change, and I've updated the test code to make it clear what is happening here. llvm-svn: 244065
* Silence unused argument warning for --cuda-host-only.Artem Belevich2015-07-281-0/+4
| | | | | | Differential Revision: http://reviews.llvm.org/D11575 llvm-svn: 243479
* --cuda-host-only should not disable linking phase.Artem Belevich2015-07-281-4/+2
| | | | | | | | | | | | Host-only cuda compilation does produce valid host object file and in some cases users do want to proceed on to the linking phase. The change removes special case that stopped compilation pipeline at the Assembly phase. Device-side compilation is still stopped early by the types::getCompilationPhases(). Differential Revision: http://reviews.llvm.org/D11573 llvm-svn: 243478
* Rename {Hexagon,NaCl}_TC to {Hexagon,NaCl}ToolChain respectively. NFCDouglas Katzman2015-07-271-4/+4
| | | | | | | | | Also rename XCore (the toolchain) to XCoreToolChain since XCore is also a namespace for its tools. Differential Revision: http://reviews.llvm.org/D10609 llvm-svn: 243279
* [CUDA] Moved device-side triple calculation to buildCudaActions().Artem Belevich2015-07-201-24/+23
| | | | | | Differential Revision: http://reviews.llvm.org/D11310 llvm-svn: 242718
* Fixed style issues pointed out by Justin Bogner.Artem Belevich2015-07-201-30/+29
| | | | | | Differential Revision: http://reviews.llvm.org/D11273 llvm-svn: 242698
* Silence the driver warnings, if we see "-w" on the Driver.Filipe Cabecinhas2015-07-181-0/+3
| | | | | | | | | | | | | | | | | | Summary: We can enable warnings after that -w, so the patch might not be 100% correct. The problem that triggered this is: we have some amount of tests that expect 0 warnings (including unit tests for -w), but -w ends up not fully silencing everything. Reviewers: echristo, chandlerc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11322 llvm-svn: 242606
* Driver: Add AMDGPU toolchainTom Stellard2015-07-181-0/+3
| | | | | | | | | | | | | | Summary: This is a minimal toolchain, which sets the integrated assembler as default, and uses lld for linking. Reviewers: arsenm, mcrosier Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D10700 llvm-svn: 242601
* [cuda] Driver changes to compile and stitch together host and device-side ↵Artem Belevich2015-07-131-5/+173
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-173/+5
| | | | | | | | | | 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
* [cuda] Driver changes to compile and stitch together host and device-side ↵Artem Belevich2015-07-131-5/+173
| | | | | | | | | | | | | | | | | | | | | | | CUDA code. - 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: 242058
* Changed Driver::getToolChain() to use Triple as an argument.Artem Belevich2015-07-101-82/+83
| | | | | | Differential Revision: http://reviews.llvm.org/D11105 llvm-svn: 241934
* Driver: Include the driver arguments in crash reportsJustin Bogner2015-07-091-1/+16
| | | | | | | Similarly to r231989, the driver arguments can be quite helpful in diagnosing a crash. llvm-svn: 241786
* [Driver] print-multi-os-directory is unsupported. Davide Italiano2015-07-081-8/+0
| | | | | | | | | Until somebody writes the code for it, be loud about the fact that it's not implemented yet. Differential Revision: http://reviews.llvm.org/D11020 llvm-svn: 241708
* [Driver] Use llvm::Triple methods to handle -EL and -EB.Benjamin Kramer2015-07-061-12/+6
| | | | | | Add a test for ppc64(le), which wasn't handled before. llvm-svn: 241528
* Driver: Remove the Job class. NFCJustin Bogner2015-07-021-17/+8
| | | | | | | | | | | We had a strange relationship here where we made a list of Jobs inherit from a single Job, but there weren't actually any places where this arbitrary nesting was used or needed. Simplify all of this by removing Job entirely and updating all of the users to either work with a JobList or a single Command. llvm-svn: 241310
* Support mingw-w64 and mingw.org toolchains at any install location.Yaron Keren2015-07-021-6/+1
| | | | | | | | | | | | | No more hardcoded paths: clang will use -sysroot as gcc root location if provided. Otherwise, it will search for gcc on the path. If not found it will use the driver installed location. http://reviews.llvm.org/D5268 Patch by Ruben Van Boxem, Martell Malone, Yaron Keren. Reviewed by Reid Kleckner. llvm-svn: 241241
* More range-based-for-loopification. NFCDouglas Katzman2015-06-301-13/+8
| | | | llvm-svn: 241106
* clang-format some of the files in lib/Driver. NFCDouglas Katzman2015-06-261-139/+130
| | | | | | | | | Nothing was hand edited afterward except a few literal strings and comments that were poorly broken. Differential Revision: http://reviews.llvm.org/D10689 llvm-svn: 240791
OpenPOWER on IntegriCloud