summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChain.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix indentation from r197490 plus some typosAlp Toker2013-12-171-8/+7
| | | | llvm-svn: 197507
* LIBRARY_PATH environment variable should only be supported on a native compiler.Richard Barton2013-12-171-0/+14
| | | | llvm-svn: 197490
* Refactor duplicate functionsBernard Ogden2013-12-121-114/+3
| | | | | | | | | | getARMCPU and getLLVMArchSuffixForARM existed as very similar functions in both ToolChain.cpp and Tools.cpp. Create a single implementation of each in Tools.cpp, eliminate the duplicate and share via Tools.h. Creates an 'arm' namespace in Tools.h to be used by any ARM-targetting tools. llvm-svn: 197153
* Make thumb the default instruction set for v7m and v7emBernard Ogden2013-12-121-1/+2
| | | | llvm-svn: 197152
* Fix -mthumb resetting of target cpuBernard Ogden2013-12-121-1/+15
| | | | | | | | Passing -mthumb with no explicit CPU on the command line resulted in target CPU changing from the architecture default to arm7tdmi. Now it does not. llvm-svn: 197151
* Added support for mcpu kraitAna Pazos2013-12-061-1/+1
| | | | | | | | | | | | - krait processor currently modeled with the same features as A9. - Krait processor additionally has VFP4 (fused multiply add/sub) and hardware division features enabled. - krait has currently the same Schedule model as A9 - krait cpu flag is not recognized by the GNU assembler yet, it is replaced with march=armv7-a to avoid a lower march from being used. llvm-svn: 196618
* For NetBSD, use arm1176jzf-s as default CPU for ARMv6.Joerg Sonnenberger2013-12-051-0/+5
| | | | llvm-svn: 196538
* X86: Make specifying avx2 simpler on Darwin with '-arch'Jim Grosbach2013-11-161-1/+15
| | | | | | | | Teach the '-arch' command line option to enable the compiler-friendly features of core-avx2 CPUs on Darwin. Pass the information along in the target triple like Darwin+ARM does. llvm-svn: 194907
* This reverts commit r194330, r194329 and r194328.Rafael Espindola2013-11-091-22/+0
| | | | | | The test was still failing on OS X and mingw. llvm-svn: 194334
* Add support for -fuse-ld=.David Chisnall2013-11-091-0/+22
| | | | llvm-svn: 194328
* SanitizerArgs: add ability to filter/diagnose unsupported sanitizers.Peter Collingbourne2013-11-011-1/+4
| | | | | | | | | | | | The thread, memory, dataflow and function sanitizers are now diagnosed if enabled explicitly on an unsupported platform. Unsupported sanitizers which are enabled implicitly (as part of a larger group) are silently disabled. As a side effect, this makes SanitizerArgs parsing toolchain-dependent (and thus essentially reverts r188058), and moves SanitizerArgs ownership to ToolChain. Differential Revision: http://llvm-reviews.chandlerc.com/D1990 llvm-svn: 193875
* Teach clang driver about Cortex-A53 and Cortex-A57.Bernard Ogden2013-10-241-1/+1
| | | | | | | | | | | Adds some Cortex-A53 strings where they were missing before. Cortex-A57 is entirely new to clang. Doesn't touch code only used by Darwin, in consequence of which one of the A53 lines has been removed. Change-Id: I5edb58f6eae93947334787e26a8772c736de6483 llvm-svn: 193364
* Add more Cortex CPUs and testsRenato Golin2013-09-131-2/+2
| | | | llvm-svn: 190703
* ARM: default to arm1176jzf-s for hard-float platforms.Tim Northover2013-08-201-2/+10
| | | | | | | | | | | | It makes no sense to try and compile for arm7tdmi when we're targeting something like gnueabihf. Although not strictly the most basic hardware conceivable, I believe arm1176jzf-s is a reasonable compromise (that can always be overridden explicitly if needed) since it's still in reasonably common use unlike earlier cores. Patch by Stephen Kelly. llvm-svn: 188796
* Move SanitizerArgs to the clang DriverAlexey Samsonov2013-08-191-0/+4
| | | | | | | | | | | | | | | | Summary: This change turns SanitizerArgs into high-level options stored in the Driver, which are parsed lazily. This fixes an issue of multiple copies of the same diagnostic message produced by sanitizer arguments parser. Reviewers: rsmith Reviewed By: rsmith CC: chandlerc, eugenis, cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1341 llvm-svn: 188660
* [PowerPC] Support powerpc64le as a syntax-checking target.Bill Schmidt2013-07-261-0/+2
| | | | | | | | | | | | | | | | | | | This patch provides basic support for powerpc64le as an LLVM target. However, use of this target will not actually generate little-endian code. Instead, use of the target will cause the correct little-endian built-in defines to be generated, so that code that tests for __LITTLE_ENDIAN__, for example, will be correctly parsed for syntax-only testing. Code generation will otherwise be the same as powerpc64 (big-endian), for now. The patch leaves open the possibility of creating a little-endian PowerPC64 back end, but there is no immediate intent to create such a thing. The new test case variant ensures that correct built-in defines for little-endian code are generated. llvm-svn: 187180
* Add support for passing '-target armv8' through the Driver.Joey Gouly2013-06-261-0/+2
| | | | llvm-svn: 184970
* [Driver] Refactor clang driver to use LLVM's Option libraryReid Kleckner2013-06-141-4/+5
| | | | | | | | | | | | | | | | | | 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
* Teach clang about the armv4/armv4t distinctionTim Northover2013-06-131-2/+5
| | | | | | | | | When choosing a default CPU, clang used to pick ARM7TDMI (which has Thumb) even when the more restrictive armv4 triple was specified. This should fix that. Patch by Jeroen Hofstee. llvm-svn: 183905
* Supports Sourcery CodeBench Mips toolchain directories tree.Simon Atanasyan2013-04-201-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sourcery CodeBench and modern FSF Mips toolchains require a bit more complicated algorithm to calculate headers, libraries and sysroot paths than implemented by Clang driver now. The main problem is that all these paths depend on a set of command line arguments additionally to a target triple value. For example, let $TC is a toolchain installation directory. If we compile big-endian 32-bit mips code, crtbegin.o is in the $TC/lib/gcc/mips-linux-gnu/4.7.2 folder and the toolchain's linker requires --sysroot=$TC/mips-linux-gnu/libc argument. If we compile little-endian 32-bit soft-float mips code, crtbegin.o is in the $TC/lib/gcc/mips-linux-gnu/4.7.2/soft-float/el folder and the toolchain's linker requires --sysroot=$TC/mips-linux-gnu/libc/soft-float/el argument. 1. Calculate MultiarchSuffix using all necessary command line options and use this MultiarchSuffix to detect crtbegin.o location in the GCCInstallationDetector::ScanLibDirForGCCTriple() routine. 2. If a user does not provide --sysroot argument to the driver explicitly, calculate new sysroot value based on command line options. Then use this calculated sysroot path: a. To populate a file search paths list in the Linux::Linux() constructor. b. To find Mips toolchain specific include headers directories in the Linux::AddClangSystemIncludeArgs() routine. c. To provide -–sysroot argument for a linker. Note: - The FSF's tree slightly differs (folder names) and is not supported yet. - New addExternCSystemIncludeIfExits() routine is a temporary solution. I plan to move path existence check to the addExternCSystemInclude() routine by a separate commit. The patch reviewed by Rafael Espindola. http://llvm-reviews.chandlerc.com/D644 llvm-svn: 179934
* Reject -no-integrated-as on windows.Rafael Espindola2013-03-241-4/+4
| | | | llvm-svn: 177840
* Avoid warnings from compilers that think you can drop off the end of a fully ↵Benjamin Kramer2013-03-211-0/+2
| | | | | | covered switch. llvm-svn: 177656
* Remove the Tools DensMap from the toolchain.Rafael Espindola2013-03-201-25/+45
| | | | | | | | | | Each toolchain has a set of tools, but they are all of known types. It can have a linker, an assembler, a "clang" (compile, analyze, ...) a non-clang compiler, etc. Instead of keeping a map, just have member variable for each type of tool. llvm-svn: 177479
* Finish refactoring the tool selection logic.Rafael Espindola2013-03-191-0/+20
| | | | | | | | | The general pattern now is that Foobar::constructTool only creates tools defined in the tools::foobar namespace and then delegates to the parent. The remaining duplicated code is now in the tools themselves. llvm-svn: 177368
* Centralize the logic for using the integrated assembler.Rafael Espindola2013-03-181-0/+2
| | | | llvm-svn: 177360
* Centralize the recording of which tools have been constructed.Rafael Espindola2013-03-181-0/+24
| | | | llvm-svn: 177319
* Pass an ArgList to every toolchain constructor. Remove the useIntegratedAsRafael Espindola2013-03-181-3/+4
| | | | | | argument. llvm-svn: 177301
* Refactor a bit of duplicated code to useIntegratedAs.Rafael Espindola2013-03-181-0/+6
| | | | llvm-svn: 177299
* Add ARM v6m, v7m, and v7em architectures for Cortex-M series processors.Bob Wilson2013-03-041-4/+6
| | | | | | <rdar://problem/11314476> llvm-svn: 176458
* Tidy up lists of Cortex-A series processors, adding entries for A7.Bob Wilson2013-03-041-1/+3
| | | | | | Also fix a missing entry for cortex-r5 in one copy of getLLVMArchSuffixForARM. llvm-svn: 176457
* Fix confused use of llvm::StringSwitch for armv7r architecture.Bob Wilson2013-03-041-1/+1
| | | | | | | | | svn 170909 added support for cortex-r5 but in this case it was done incorrectly. The last argument to StringSwitch.Cases() is the replacement value, so by adding "cortex-r5" it changed the default cpu for armv7r to cortex-r5 instead of cortex-r4. llvm-svn: 176456
* Adding armv7l default to cortex-a8Renato Golin2013-02-051-0/+1
| | | | llvm-svn: 174466
* Add ARM cortex-r5 subtarget as available mcpuQuentin Colombet2012-12-211-1/+1
| | | | llvm-svn: 170909
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-2/+1
| | | | | | | | | | | | | 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
* Fix the '-fuse-init-array' option to actually be an option.Chandler Carruth2012-11-211-1/+2
| | | | | | | | | | | | | | | | | | Previously, this flag to CC1 was never exposed at the clang driver layer, and if you happened to enable it (by being on Android or GCC 4.7 platform), you couldn't *disable* it, because there was no 'no' variant. The whole thing was confusingly implemented. Now, the target-specific flag processing gets the driver arg list, and we use standard hasFlag with a default based on the GCC version and/or Android platform. The user can still pass the 'no-' variant to forcibly disable the flag, or pass the positive variant to clang itself to enable the flag. The test has also been substantially cleaned up and extended to cover these use cases. llvm-svn: 168473
* Driver/Darwin: The -arch argument values aren't exactly the arch names from aDaniel Dunbar2012-11-081-0/+15
| | | | | | | | triple. - Translate the special case of powerpc to its expected -arch name. llvm-svn: 167571
* Remove first argument from Arg::getValue; it's been unused since r105760.Richard Smith2012-11-011-4/+4
| | | | llvm-svn: 167211
* Driver: Link crtfastmath.o if it's available and -ffast-math is specified.Benjamin Kramer2012-10-041-0/+22
| | | | | | | | | | | | crtfastmath.o contains routines to set the floating point flags to a faster, unsafe mode. Linking it in speeds up code dealing with denormals significantly (PR14024). For now this is only enabled on linux where I can test it and crtfastmath.o is widely available. We may want to provide a similar file with compiler-rt eventually and/or enable it on other platforms too. llvm-svn: 165240
* Remove useless parameter "WantFile" from Driver::GetProgramPath().Simon Atanasyan2012-10-031-2/+2
| | | | | | | | | This parameter is useless because nowhere used explicitly and always gets its default value - "false". The patch reviewed by Rafael Espindola. llvm-svn: 165149
* Add armv7s and some other arm variants supported by Mach-O files.Bob Wilson2012-09-291-1/+5
| | | | llvm-svn: 164905
* Implement ToolChain::IsUnwindTablesDefault to reduce code duplication a bit.Rafael Espindola2012-09-231-0/+4
| | | | llvm-svn: 164473
* This patch introduces A15 as a target in Clang.Silviu Baranga2012-09-131-1/+1
| | | | llvm-svn: 163804
* Rename the GCC Objective-C runtime to gcc from gnu-fragile and the GNUstepDavid Chisnall2012-07-031-1/+1
| | | | | | runtime to gnustep from gnu. Fix EH for the GCC runtime. llvm-svn: 159684
* Restructure how the driver communicates information about theJohn McCall2012-06-201-20/+4
| | | | | | | | | | | | | | | | | | | | | | | | target Objective-C runtime down to the frontend: break this down into a single target runtime kind and version, and compute all the relevant information from that. This makes it relatively painless to add support for new runtimes to the compiler. Make the new -cc1 flag, -fobjc-runtime=blah-x.y.z, available at the driver level as a better and more general alternative to -fgnu-runtime and -fnext-runtime. This new concept of an Objective-C runtime also encompasses what we were previously separating out as the "Objective-C ABI", so fragile vs. non-fragile runtimes are now really modelled as different kinds of runtime, paving the way for better overall differentiation. As a sort of special case, continue to accept the -cc1 flag -fobjc-runtime-has-weak, as a sop to PLCompatibilityWeak. I won't go so far as to say "no functionality change", even ignoring the new driver flag, but subtle changes in driver semantics are almost certainly not intended. llvm-svn: 158793
* Add a -fuse-init-array option to cc1 and map to the UseInitArray targetRafael Espindola2012-06-191-0/+3
| | | | | | | | | option. On the driver, check if we are using libraries from gcc 4.7 or newer and if so pass -fuse-init-array to the frontend. The crtbegin*.o files in gcc 4.7 no longer call the constructors listed in .ctors, so we have to use .init_array. llvm-svn: 158694
* ARM backend knows about cortex-m4. The front end should too.Jim Grosbach2012-03-291-0/+1
| | | | llvm-svn: 153678
* Duplicated code is bad. At least make it consistent.Bob Wilson2012-03-211-71/+38
| | | | | | | | | | The getARMTargetCPU and getLLVMArchSuffixForARM functions exist in both Toolchain.cpp and Tools.cpp. This stuff needs a thorough overhaul. In the meantime, this patch at least makes them consistent. One version had been converted to use StringSwitch, and the other version had new Cortex M-series processors added. llvm-svn: 153202
* For Darwin, do not let -mcpu override the -arch option. <rdar://11059238>Bob Wilson2012-03-211-5/+9
| | | | | | | | | | | | On Darwin the architecture and the corresponding Mach-O slice is typically specified with -arch. If not, it defaults to the current host architecture. Do not use -mcpu to override the -arch value. This is only an issue when people need to use specialized code for a non-default CPU (hopefully guarded by run-time checks to detect the current processor). The -mcpu option is still used for the -target-cpu option to clang, but this patch causes it to not be used to set the architecture in the target triple. llvm-svn: 153197
* Add new code migrator support for migrating existing Objective-C code to useTed Kremenek2012-03-061-0/+2
| | | | | | | | | | | 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
* Revert r149083 which is not the direction we're going in the ClangChandler Carruth2012-01-311-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | driver based on discussions with Doug Gregor. There are several issues: 1) The patch was not reviewed prior to commit and there were review comments. 2) The design of the functionality (triple-prefixed tool invocation) isn't the design we want for Clang going forward: it focuses on the "user triple" rather than on the "toolchain triple", and forces that bit of state into the API of every single toolchain instead of handling it automatically in the common base classes. 3) The tests provided are not stable. They fail on a few Linux variants (Gentoo among them) and on mingw32 and some other environments. I *am* interested in the Clang driver being able to invoke triple-prefixed tools, but we need to design that feature the right way. This patch just extends the previous hack without fixing the underlying problems with it. I'm working on a new design for this that I will mail for review by tomorrow. I am aware that this removes functionality that NetBSD relies on, but this is ToT, not a release. This functionality hasn't been properly designed, implemented, and tested yet. We can't "regress" until we get something that really works, both with the immediate use cases and with long term maintenance of the Clang driver. For reference, the original commit log: Keep track of the original target the user specified before normalization. This used to be captured in DefaultTargetTriple and is used for the (optional) $triple-$tool lookup for cross-compilation. Do this properly by making it an attribute of the toolchain and use it in combination with the computed triple as index for the toolchain lookup. llvm-svn: 149337
OpenPOWER on IntegriCloud