summaryrefslogtreecommitdiffstats
path: root/lib/Driver/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
* Add support for Ananas platformEd Schouten2017-06-251-0/+1
| | | | | | | | | | | | | | | | | | Ananas is a home-brew operating system, mainly for amd64 machines. After using GCC for quite some time, it has switched to clang and never looked back - yet, having to manually patch things is annoying, so it'd be much nicer if this was in the official tree. More information: https://github.com/zhmu/ananas/ https://rink.nu/projects/ananas.html Submitted by: Rink Springer Differential Revision: https://reviews.llvm.org/D32936 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306239 91177308-0d34-0410-b5e6-96231b3b80d8
* Update libdeps to add BinaryFormat, introduced in r304864.NAKAMURA Takumi2017-06-071-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304869 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't defer to the GCC driver for linking arm-baremetalJonathan Roelofs2017-05-251-0/+1
| | | | | | | | | | | | | | | Also comes with a cmake cache for building the runtime bits: $ cmake <normal cmake flags> \ -DBAREMETAL_ARMV6M_SYSROOT=/path/to/sysroot \ -DBAREMETAL_ARMV7M_SYSROOT=/path/to/sysroot \ -DBAREMETAL_ARMV7EM_SYSROOT=/path/to/sysroot \ -C /path/to/clang/cmake/caches/BaremetalARM.cmake \ /path/to/llvm https://reviews.llvm.org/D33259 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303873 91177308-0d34-0410-b5e6-96231b3b80d8
* [XRay] Add -fxray-{always,never}-instrument= flags to clangDean Michael Berris2017-03-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: The -fxray-always-instrument= and -fxray-never-instrument= flags take filenames that are used to imbue the XRay instrumentation attributes using a whitelist mechanism (similar to the sanitizer special cases list). We use the same syntax and semantics as the sanitizer blacklists files in the implementation. As implemented, we respect the attributes that are already defined in the source file (i.e. those that have the [[clang::xray_{always,never}_instrument]] attributes) before applying the always/never instrument lists. Reviewers: rsmith, chandlerc Subscribers: jfb, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D30388 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299041 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver/ToolChains: Mips -> MipsLinuxKonstantin Zhuravlyov2017-03-081-1/+1
| | | | | | | | | | - Mips is architecture, not a toolchain - Might help eliminate the confusion in the future by not having header files with the same name Differential Revision: https://reviews.llvm.org/D30753 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297312 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Consolidate tools and toolchains by target platform. (NFC)David L. Jones2017-03-081-12/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: (This is a move-only refactoring patch. There are no functionality changes.) This patch splits apart the Clang driver's tool and toolchain implementation files. Each target platform toolchain is moved to its own file, along with the closest-related tools. Each target platform toolchain has separate headers and implementation files, so the hierarchy of classes is unchanged. There are some remaining shared free functions, mostly from Tools.cpp. Several of these move to their own architecture-specific files, similar to r296056. Some of them are only used by a single target platform; since the tools and toolchains are now together, some helpers now live in a platform-specific file. The balance are helpers related to manipulating argument lists, so they are now in a new file pair, CommonArgs.h and .cpp. I've tried to cluster the code logically, which is fairly straightforward for most of the target platforms and shared architectures. I think I've made reasonable choices for these, as well as the various shared helpers; but of course, I'm happy to hear feedback in the review. There are some particular things I don't like about this patch, but haven't been able to find a better overall solution. The first is the proliferation of files: there are several files that are tiny because the toolchain is not very different from its base (usually the Gnu tools/toolchain). I think this is mostly a reflection of the true complexity, though, so it may not be "fixable" in any reasonable sense. The second thing I don't like are the includes like "../Something.h". I've avoided this largely by clustering into the current file structure. However, a few of these includes remain, and in those cases it doesn't make sense to me to sink an existing file any deeper. Reviewers: rsmith, mehdi_amini, compnerd, rnk, javed.absar Subscribers: emaste, jfb, danalbert, srhines, dschuff, jyknight, nemanjai, nhaehnle, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D30372 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297250 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Move architecture-specific free helper functions to their own files.David L. Jones2017-02-241-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves helper functions that are CPU-specific out of Driver.cpp and to separate implementation files. The new files are named for the architecture, e.g. ARMArch.cpp. The next step after this will be to move OS-specific code, which I expect will include many of the tool implementations, to similarly separate files. Some CPU-specific functions are not being moved just yet. In cases where the only caller is the platform-specific tools, I plan to move them together. An example is Hexagon, where the only caller of the architecture-specific functions are the tools themselves. (I'm happy to revise this choice, it just seems like less churn to me.) This does mean that some functions which were previously static are now exposed through the library header Driver.h. Reviewers: rsmith, javed.absar Subscribers: aemerson, danalbert, srhines, dschuff, jyknight, nemanjai, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D30315 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296056 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Refactor distro detection & classification as a separate APIMichal Gorny2016-11-281-0/+1
| | | | | | | | | | | | Refactor the Distro enum along with helper functions into a full-fledged Distro class, inspired by llvm::Triple, and make it a public API. The new class wraps the enum with necessary comparison operators, adding the convenience Is*() methods and a constructor performing the detection. The public API is needed to run the unit tests (D25869). Differential Revision: https://reviews.llvm.org/D25949 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288060 91177308-0d34-0410-b5e6-96231b3b80d8
* MSVCToolChain.cpp: Make version.dll generic for win32.NAKAMURA Takumi2016-05-141-0/+6
| | | | | | | We may consider msvc features may be capable on mingw host, if it can. Consider --host=mingw --target=msvc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269557 91177308-0d34-0410-b5e6-96231b3b80d8
* Support mingw-w64 and mingw.org toolchains at any install location.Yaron Keren2015-07-021-0/+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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241241 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver: add CrossWindowsToolChainSaleem Abdulrasool2014-10-241-0/+1
| | | | | | | | | | | | | | | | | | | | This is a very basic toolchain. It supports cross-compiling Windows (primarily inspired by the WoA target). It is meant to use clang with the LLVM IAS and a binutils ld-compatible interface for the linker (eventually to be lld). It does not perform any "standard" GCC lookup, nor does it perform any special adjustments given that it is expected to be used in an environment where the user is using MSVCRT (and as such Visual Studio headers) and the Windows SDK. The primary runtime library is expected to be compiler-rt and the C++ implementation to be libc++. It also expects that a sysroot has been setup given the usual Unix semantics (standard C headers in /usr/include, all the import libraries available in /usr/lib). It also expects that an entry point stub is present in /usr/lib (crtbegin.obj for executables, crtbeginS.obj for shared libraries). The entry point stub is responsible for running any GNU constructors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220546 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver: rename Windows to MSVCToolChainSaleem Abdulrasool2014-10-221-1/+1
| | | | | | | | This renames the Windows toolchain to MSVCToolChain. This is a preparatory step for adding a CrossWindowsToolChain which uses clang/libc++/(ld/lld) without the standard GCC toolchain lookup. NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220362 91177308-0d34-0410-b5e6-96231b3b80d8
* Decouple llvm::SpecialCaseList text representation and its LLVM IR semantics.Alexey Samsonov2014-07-091-1/+0
| | | | | | | | | | | | | | | | | Turn llvm::SpecialCaseList into a simple class that parses text files in a specified format and knows nothing about LLVM IR. Move this class into LLVMSupport library. Implement two users of this class: * DFSanABIList in DFSan instrumentation pass. * SanitizerBlacklist in Clang CodeGen library. The latter will be modified to use actual source-level information from frontend (source file names) instead of unstable LLVM IR things (LLVM Module identifier). Remove dependency edge from ClangCodeGen/ClangDriver to LLVMTransformUtils. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212643 91177308-0d34-0410-b5e6-96231b3b80d8
* cc1as: consolidate option flags with cc1 and eliminate duplicationAlp Toker2014-07-091-2/+0
| | | | | | | | | | The clang -cc1as options are nearly a strict subset of -cc1. Instead of duplicating the definitions and documentation, let's go ahead and share the definitions in a similar way the current handling of combined driver and frontend flags, eliminating some of the vestigial legacy surrounding the assembler subcommand. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212620 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Use LINK_LIBS instead of target_link_libraries().NAKAMURA Takumi2014-02-261-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202238 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Get rid of explicit dependencies to include/clang/*.inc and ↵NAKAMURA Takumi2014-02-211-5/+1
| | | | | | | | | | | | | | | | | | | introduce CLANG_TABLEGEN_TARGETS. This does; - clang_tablegen() adds each tblgen'd target to global property CLANG_TABLEGEN_TARGETS as list. - List of targets is added to LLVM_COMMON_DEPENDS. - all clang libraries and targets depend on generated headers. You might wonder this would be regression, but in fact, this is little loss. - Almost all of clang libraries depend on tblgen'd files and clang-tblgen. - clang-tblgen may cause short stall-out but doesn't cause unconditional rebuild. - Each library's dependencies to tblgen'd files might vary along headers' structure. It made hard to track and update *really optimal* dependencies. Each dependency to intrinsics_gen and ClangSACheckers is left as DEPENDS. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201842 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Multilib selection machineryJonathan Roelofs2014-02-121-0/+1
| | | | | | | | | | | | | | This patch improves the support for picking Multilibs from gcc installations. It also provides a better approximation for the flags '-print-multi-directory' and '-print-multi-lib'. This reverts r201203 (i.e. re-applying r201202 with small fixes in unittests/CMakeLists.txtto make the build bots happy). review: http://llvm-reviews.chandlerc.com/D2538 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201205 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 201202Jonathan Roelofs2014-02-121-1/+0
| | | | | | | Breaks cmake configure of new unit tests directory git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201203 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Multilib selection machineryJonathan Roelofs2014-02-121-0/+1
| | | | | | | | | | | This patch improves the support for picking Multilibs from gcc installations. It also provides a better approximation for the flags '-print-multi-directory' and '-print-multi-lib'. review: http://llvm-reviews.chandlerc.com/D2538 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201202 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] clangDriver: Move LLVM stuff in target_link_library to ↵NAKAMURA Takumi2013-12-091-2/+6
| | | | | | LLVM_LINK_COMPONENTS. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196798 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-apply r188666Alexey Samsonov2013-08-191-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188675 91177308-0d34-0410-b5e6-96231b3b80d8
* Move SanitizerArgs implementation from .h to .cppAlexey Samsonov2013-08-081-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187972 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Refactor clang driver to use LLVM's Option libraryReid Kleckner2013-06-141-4/+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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183989 91177308-0d34-0410-b5e6-96231b3b80d8
* clang/lib: [CMake] Update tblgen'd dependencies.NAKAMURA Takumi2012-07-271-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160851 91177308-0d34-0410-b5e6-96231b3b80d8
* clang/lib: [CMake] Reformat, alphabetize lists.NAKAMURA Takumi2012-07-271-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160850 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a goofy CMake hack and use the standard CMake facilities toChandler Carruth2012-06-211-4/+9
| | | | | | | | | express library-level dependencies within Clang. This is no more verbose really, and plays nicer with the rest of the CMake facilities. It should also have no change in functionality. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158888 91177308-0d34-0410-b5e6-96231b3b80d8
* Zap the /Za compiler switch from MSVC projects, the option is considered ↵Francois Pichet2012-06-061-7/+0
| | | | | | | | harmful even by Microsoft people and clang won't build using the MSVC 2012 RC if not removed. Only 1 minor code change was necessary: can't use cdecl as variable name anymore. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158063 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove AST and Parse from Driver's dependencies.Jordan Rose2012-06-041-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157933 91177308-0d34-0410-b5e6-96231b3b80d8
* Speculatively fix windows cmake builders.Andrew Trick2012-05-021-1/+1
| | | | | | Really just a wild stab in the dark. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155974 91177308-0d34-0410-b5e6-96231b3b80d8
* Unify Options.td and CC1Options.td, in a first step towards unifying the ↵James Molloy2012-05-011-1/+0
| | | | | | | | | | serialization logic in Frontend and Driver. Reviewed by Eric, Doug and Chandler, and here: http://llvm.org/reviews/r/7/ git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155916 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete the driver's HostInfo class. This abstraction just never reallyChandler Carruth2012-01-251-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | did anything. The two big pieces of functionality it tried to provide was to cache the ToolChain objects for each target, and to figure out the exact target based on the flag set coming in to an invocation. However, it had a lot of flaws even with those goals: - Neither of these have anything to do with the host, or its info. - The HostInfo class was setup as a full blown class *hierarchy* with a separate implementation for each "host" OS. This required dispatching just to create the objects in the first place. - The hierarchy claimed to represent the host, when in fact it was based on the target OS. - Each leaf in the hierarchy was responsible for implementing the flag processing and caching, resulting in a *lot* of copy-paste code and quite a few bugs. - The caching was consistently done based on architecture alone, even though *any* aspect of the targeted triple might change the behavior of the configured toolchain. - Flag processing was already being done in the Driver proper, separating the flag handling even more than it already is. Instead of this, we can simply have the dispatch logic in the Driver which previously created a HostInfo object create the ToolChain objects. Adding caching in the Driver layer is a tiny amount of code. Finally, pulling the flag processing into the Driver puts it where it belongs and consolidates it in one location. The result is that two functions, and maybe 100 lines of new code replace over 10 classes and 800 lines of code. Woot. This also paves the way to introduce more detailed ToolChain objects for various OSes without threading through a new HostInfo type as well, and the accompanying boiler plate. That, of course, was the yak I started to shave that began this entire refactoring escapade. Wheee! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148950 91177308-0d34-0410-b5e6-96231b3b80d8
* Split the Windows toolchain definition into its own file. This isChandler Carruth2011-12-171-0/+1
| | | | | | | | | | | | | | | especially nice as the Windows toolchain needs the windows header files, and has lots of platform specific hooks in it. To facilitate the split, hoist a bunch of file-level static helpers into class-level static helpers. Spiff up their doxygen comments while there as they're now more likely to be looked up via docs. Hopefully, this will be followed by further breaking apart of the toolchain definitions. Most of the large and complex ones should likely live on their own. I'm looking at you Darwin. ;] git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146840 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix MSVC build.Michael J. Spencer2011-11-051-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143770 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: LLVM_NO_RTTI must be obsolete now!NAKAMURA Takumi2011-02-101-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125275 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "CMake: Update to use standard CMake dependency tracking facilities ↵Michael J. Spencer2010-09-131-13/+4
| | | | | | | | | | | | | instead" This reverts commit r113631 Conflicts: CMakeLists.txt lib/CodeGen/CMakeLists.txt git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113817 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: Update to use standard CMake dependency tracking facilities insteadMichael J. Spencer2010-09-101-4/+13
| | | | | | of whatever we were using before... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113631 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up CMake dependenciesDouglas Gregor2010-09-091-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113489 91177308-0d34-0410-b5e6-96231b3b80d8
* Update CMake build for new attribute changes.Sean Hunt2010-06-171-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106188 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver/MC: Add 'clang -cc1as' integrated assembler tool, currently accepts ↵Daniel Dunbar2010-05-201-1/+3
| | | | | | approximately the same interface as 'llvm-mc'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104239 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort calls to add_clang_library()Kovarththanan Rajaratnam2010-03-221-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99191 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing dependency for CMake.Daniel Dunbar2009-11-191-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89332 91177308-0d34-0410-b5e6-96231b3b80d8
* Sketch .td file and build system goop for OptTable based clang-cc options.Daniel Dunbar2009-11-191-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89330 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver: Switch to using TableGen'erated Options.inc instead of Options.def file.Daniel Dunbar2009-11-191-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89288 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver: Split OptTable out into OptTable.{h,cpp}Daniel Dunbar2009-11-191-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89283 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some TableGen-related dependencies for the Clang CMake buildDouglas Gregor2009-06-231-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73976 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some missing CMake dependenciesDouglas Gregor2009-06-181-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73700 91177308-0d34-0410-b5e6-96231b3b80d8
* Really fix cmake style builds.Mike Stump2009-03-241-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67633 91177308-0d34-0410-b5e6-96231b3b80d8
* support cmakeGabor Greif2009-03-131-0/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66884 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename lib/Driver (etc) to lib/Frontend in prep for the *actual*Daniel Dunbar2009-03-021-10/+0
| | | | | | | driver taking lib/Driver. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65811 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor update to CMake build system.Eli Friedman2008-11-301-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60269 91177308-0d34-0410-b5e6-96231b3b80d8