summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Action.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [CUDA] Invoke ptxas and fatbinary during compilation.Justin Lebar2016-01-141-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: Previously we compiled CUDA device code to PTX assembly and embedded that asm as text in our host binary. Now we compile to PTX assembly and then invoke ptxas to assemble the PTX into a cubin file. We gather the ptx and cubin files for each of our --cuda-gpu-archs and combine them using fatbinary, and then embed that into the host binary. Adds two new command-line flags, -Xcuda_ptxas and -Xcuda_fatbinary, which pass args down to the external tools. Reviewers: tra, echristo Subscribers: cfe-commits, jhen Differential Revision: http://reviews.llvm.org/D16082 llvm-svn: 257809
* [CUDA] Add explicit mapping from sm_XX to compute_YY.Justin Lebar2016-01-121-2/+24
| | | | | | | | | | | | Summary: This is used by D16082 when it invokes fatbinary. Reviewers: tra Subscribers: cfe-commits, jhen, echristo Differential Revision: http://reviews.llvm.org/D16097 llvm-svn: 257530
* [CUDA] Reject values for --cuda-gpu-arch that are not of the form /sm_\d+/.Justin Lebar2016-01-111-1/+9
| | | | | | | | | | Reviewers: tra Subscribers: cfe-commits, jhen, echristo Differential Revision: http://reviews.llvm.org/D16079 llvm-svn: 257413
* Move ownership of Action objects into Compilation.Justin Lebar2016-01-111-53/+32
| | | | | | | | | | | | | | | | Summary: This makes constructing Action graphs which are DAGs much simpler. It also just simplifies in general the ownership semantics of Actions. Depends on D15910. Reviewers: echristo Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D15911 llvm-svn: 257407
* [CUDA] use -aux-triple to pass target triple of opposite side of compilationArtem Belevich2015-11-171-7/+4
| | | | | | | | | | | | | | | | 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
* Augmented CudaHostAction to carry device-side triple.Artem Belevich2015-09-221-2/+4
| | | | | | Differential Revision: http://reviews.llvm.org/D12893 llvm-svn: 248298
* [CUDA] Moved device-side triple calculation to buildCudaActions().Artem Belevich2015-07-201-2/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D11310 llvm-svn: 242718
* Fixed style issues pointed out by Justin Bogner.Artem Belevich2015-07-201-5/+4
| | | | | | Differential Revision: http://reviews.llvm.org/D11273 llvm-svn: 242698
* Driver: Delete dead codeJustin Bogner2015-07-141-7/+0
| | | | | | VerifyJobActions never have multiple inputs. llvm-svn: 242223
* [cuda] Driver changes to compile and stitch together host and device-side ↵Artem Belevich2015-07-131-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-21/+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
* [cuda] Driver changes to compile and stitch together host and device-side ↵Artem Belevich2015-07-131-0/+21
| | | | | | | | | | | | | | | | | | | | | | | 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
* Reapply "Change -save-temps to emit unoptimized bitcode files."Bob Wilson2014-12-211-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | This reapplies r224503 along with a fix for compiling Fortran by having the clang driver invoke gcc (see r224546, where it was reverted). I have added a testcase for that as well. Original commit message: It is often convenient to use -save-temps to collect the intermediate results of a compilation, e.g., when triaging a bug report. Besides the temporary files for preprocessed source and assembly code, this adds the unoptimized bitcode files as well. This adds a new BackendJobAction, which is mostly mechanical, to run after the CompileJobAction. When not using -save-temps, the BackendJobAction is combined into one job with the CompileJobAction, similar to the way the integrated assembler is handled. I've implemented this entirely as a driver change, so under the hood, it is just using -disable-llvm-optzns to get the unoptimized bitcode. Based in part on a patch by Steven Wu. rdar://problem/18909437 llvm-svn: 224688
* Revert "Change -save-temps to emit unoptimized bitcode files."Reid Kleckner2014-12-181-7/+0
| | | | | | | | | | This reverts commit r224503. It broke compilation of fortran through the Clang driver. Previously `clang -c t.f` would invoke `gcc t.f` and `clang -cc1as`, but now it tries to call `clang -cc1 t.f` which fails for obvious reasons. llvm-svn: 224546
* Change -save-temps to emit unoptimized bitcode files.Bob Wilson2014-12-181-0/+7
| | | | | | | | | | | | | | | | | | | It is often convenient to use -save-temps to collect the intermediate results of a compilation, e.g., when triaging a bug report. Besides the temporary files for preprocessed source and assembly code, this adds the unoptimized bitcode files as well. This adds a new BackendJobAction, which is mostly mechanical, to run after the CompileJobAction. When not using -save-temps, the BackendJobAction is combined into one job with the CompileJobAction, similar to the way the integrated assembler is handled. I've implemented this entirely as a driver change, so under the hood, it is just using -disable-llvm-optzns to get the unoptimized bitcode. Based in part on a patch by Steven Wu. rdar://problem/18909437 llvm-svn: 224503
* unique_ptrify Driver Action handlingDavid Blaikie2014-08-291-34/+33
| | | | | | | | | | | | It hits a limit when we reach ActionList, which is used for dynamic conditional ownership, so we lose type safety there. This did expose at least one caller "lying" about ownership (passing ownership to an Action, then updating the Action to specify that it doesn't actually own the thing that was passed) - changing this to unique_ptr just makes that oddity more obvious. llvm-svn: 216713
* Move -verify-pch to use VerifyJobActionBen Langmuir2014-02-061-3/+27
| | | | | | | | | Use the verify hook rather than the compile hook to represent the -verify-pch action, and move the exising --verify-debug-info action into its own subclass of VerifyJobAction. Incidentally change the name printed by -ccc-print-phases for --verify-debug-info. llvm-svn: 200938
* [Driver] Refactor clang driver to use LLVM's Option libraryReid Kleckner2013-06-141-0/+1
| | | | | | | | | | | | | | | | | | The big changes are: - Deleting Driver/(Arg|Opt)* - Rewriting includes to llvm/Option/ and re-sorting - 'using namespace llvm::opt' in clang::driver - Fixing the autoconf build by adding option everywhere As discussed in the review, this change includes using directives in header files. I'll make follow up changes to remove those in favor of name specifiers. Reviewers: espindola Differential Revision: http://llvm-reviews.chandlerc.com/D975 llvm-svn: 183989
* Remove the SplitDebug action and replace with a set of commandsEric Christopher2013-02-211-7/+0
| | | | | | | in the compilation setup. Note that this doesn't currently work for -no-integrated-as. llvm-svn: 175813
* Driver and option support for -gsplit-dwarf. This is a part ofEric Christopher2013-02-051-0/+7
| | | | | | the DWARF5 split dwarf proposal. llvm-svn: 174349
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-1/+0
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Add new code migrator support for migrating existing Objective-C code to useTed Kremenek2012-03-061-0/+7
| | | | | | | | | | | the new Objective-C NSArray/NSDictionary/NSNumber literal syntax. This introduces a new library, libEdit, which provides a new way to support migration of code that improves on the original ARC migrator. We now believe that most of its functionality can be refactored into the existing libraries, and thus this new library may shortly disappear. llvm-svn: 152141
* Unweaken vtables as per ↵David Blaikie2011-12-201-0/+24
| | | | | | http://llvm.org/docs/CodingStandards.html#ll_virtual_anch llvm-svn: 146959
* Removing a bunch of dead returns/breaks after llvm_unreachables.David Blaikie2011-09-231-1/+0
| | | | llvm-svn: 140407
* More missing header inclusions from llvm_unreachable migration.David Blaikie2011-09-231-0/+1
| | | | llvm-svn: 140369
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-1/+1
| | | | llvm-svn: 140367
* Add support for a verifier to the driver. Currently only verifies debugEric Christopher2011-08-231-0/+5
| | | | | | | | | | | output on darwin so is hard coded there. As a note this will need a little bit of refactoring in the class hierarchy to separate it out for different verifiers based on input type. Fixes rdar://8256258. llvm-svn: 138343
* Remove stray emacs mode markers in all these files that was causing emacs toNick Lewycky2010-12-311-1/+1
| | | | | | | open them in fundamental-mode instead of c++-mode. Also twiddle whitespace for consistency in ToolChains.cpp. llvm-svn: 122646
* Driver: Add an explicit dsymutil action.Daniel Dunbar2010-06-041-0/+5
| | | | llvm-svn: 105474
* Driver: Free Action objects.Daniel Dunbar2010-03-111-2/+4
| | | | llvm-svn: 98263
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-6/+6
| | | | llvm-svn: 81346
* Driver: I was too hasty in free'ing Actions, we sometimes shareDaniel Dunbar2009-03-181-3/+2
| | | | | | | Actions so a simple tree traversal isn't quite good enough. Leaving a FIXME for now. llvm-svn: 67161
* Driver: Move actions into Compilation, and construct the compilationDaniel Dunbar2009-03-181-1/+5
| | | | | | | | | | | earlier. - This gives us a simple ownership model, and allows clients access to more information should they ever want it. - We now free Actions correctly. llvm-svn: 67158
* Driver: Action vtables were still hungry.Daniel Dunbar2009-03-131-1/+1
| | | | llvm-svn: 66980
* Driver: Provide food and shelter for Action vtables.Daniel Dunbar2009-03-131-0/+44
| | | | llvm-svn: 66978
* ccc/Driver: Normalize phase spelling in -ccc-print-phases.Daniel Dunbar2009-03-131-6/+6
| | | | llvm-svn: 66912
* Driver: Add cast<> support for Action, and some other accessors.Daniel Dunbar2009-03-131-0/+17
| | | | llvm-svn: 66887
* Driver: Add majority of driver-driver implementation.Daniel Dunbar2009-03-121-0/+15
- Compare to driverdriver.c if bored; not completely fair since the driver gets a bit more code in other places to handle binding archs (for Xarch) but not completely unfair either. Fear not, extra Action classes will have a happy home for their vtables soon. llvm-svn: 66817
OpenPOWER on IntegriCloud