summaryrefslogtreecommitdiffstats
path: root/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
* fix a typoGabor Greif2012-04-171-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154920 91177308-0d34-0410-b5e6-96231b3b80d8
* Hexagon V5(Floating Point) support.Sirish Pande2012-04-161-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154828 91177308-0d34-0410-b5e6-96231b3b80d8
* use DEFAULT_SYSROOTSebastian Pop2012-04-163-9/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154792 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct indentationDavid Blaikie2012-04-151-22/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154774 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't link lib[std]c++ when -nostdlib is specified (Solaris driver).David Chisnall2012-04-101-2/+2
| | | | | | | | Patch by Dmitri Shubin! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154392 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass -march, -mcpu, -mfpu to linuxtools assembler.Evgeniy Stepanov2012-04-101-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154389 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an annoying little bug I found while debugging another LTO issue. GoldRafael Espindola2012-04-091-6/+9
| | | | | | | | | requires the -plugin to come before any -plugin-opt options, we were passing them the other way around. With this one can run (for example): clang -o foo foo.c -O4 -Wl,-plugin-opt=generate-api-file git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154357 91177308-0d34-0410-b5e6-96231b3b80d8
* objective-c: remove -fobjc-default-synthesize-properties from the driver.Fariborz Jahanian2012-04-091-2/+1
| | | | | | | | cc1 option remains though to invoke default property synthesis. // rdar://11209719 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154334 91177308-0d34-0410-b5e6-96231b3b80d8
* objective-c: Remove -fno-objc-default-synthesize-propertiesFariborz Jahanian2012-04-091-3/+2
| | | | | | | | as the driver option. // rdar://11209719 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154331 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r154321, pending more discussion.David Chisnall2012-04-091-4/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154327 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -fobjc-trace to emit a call before and after each Objective-C message sendDavid Chisnall2012-04-091-0/+4
| | | | | | | | for hooking in code flow visualisation applications. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154321 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor out ARM floating ABI determination to new routine Anton Korobeynikov2012-04-091-35/+44
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154318 91177308-0d34-0410-b5e6-96231b3b80d8
* Make a modern Objective-C runtime the default target for *BSD. Don't yet ↵David Chisnall2012-04-091-0/+30
| | | | | | change this on GNU/Linux, where the GCC runtime still tends to be used. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154315 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach Clang about PIE compilations. This is the first step of PR12380.Chandler Carruth2012-04-081-18/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First, this patch cleans up the parsing of the PIC and PIE family of options in the driver. The existing logic failed to claim arguments all over the place resulting in kludges that marked the options as unused. Instead actually walk all of the arguments and claim them properly. We now treat -f{,no-}{pic,PIC,pie,PIE} as a single set, accepting the last one on the commandline. Previously there were lots of ordering bugs that could creep in due to the nature of the parsing. Let me know if folks would like weird things such as "-fPIE -fno-pic" to turn on PIE, but disable full PIC. This doesn't make any sense to me, but we could in theory support it. Options that seem to have intentional "trump" status (-static, -mkernel, etc) continue to do so and are commented as such. Next, a -pie-level flag is threaded into the frontend, rigged to a language option, and handled preprocessor, setting up the appropriate defines. We'll now have the correct defines when compiling with -fpie. The one place outside of the preprocessor that was inspecting the PIC level (as opposed to the relocation model, which is set and handled separately, yay!) is in the GNU ObjC runtime. I changed it to exactly preserve existing behavior. If folks want to change its behavior in the face of PIE, they can do that in a separate patch. Essentially the only functionality changed here is the preprocessor defines and bug-fixes to the argument management. Tests have been updated and extended to test all of this a bit more thoroughly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154291 91177308-0d34-0410-b5e6-96231b3b80d8
* MIPS: Pass -mabi option to the assmbler when compile MIPS targets.Simon Atanasyan2012-04-071-10/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154270 91177308-0d34-0410-b5e6-96231b3b80d8
* MIPS: Move code calculates CPU and ABI names to the separate function to ↵Simon Atanasyan2012-04-071-13/+21
| | | | | | reuse this function later. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154269 91177308-0d34-0410-b5e6-96231b3b80d8
* [driver] In general, the driver claims redundant args and uses the last arg.Chad Rosier2012-04-071-0/+1
| | | | | | | | | However, the '-x' option has special handling and wasn't following this paradigm. Fix it to do so by claiming the arg as we parse the '-x' option. rdar://11203340 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154231 91177308-0d34-0410-b5e6-96231b3b80d8
* MIPS: Provide a correct path to the dynamic linker when build for MIPS ↵Simon Atanasyan2012-04-061-0/+3
| | | | | | 64-bit targets. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154200 91177308-0d34-0410-b5e6-96231b3b80d8
* MIPS: Pass -EB/-EL argument to the assembler according to selected endian ↵Simon Atanasyan2012-04-061-0/+6
| | | | | | when compile for MIPS targets. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154195 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix using Clang as a cross compiler installed on a host machine and notChandler Carruth2012-04-061-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | inside of a sysroot targeting a system+sysroot which is "similar" or "compatible" with the host system. This shows up when trying to build system images on largely compatible hardware as-if fully cross compiled. The problem is that previously we *perfectly* mimiced GCC here, and it turns out GCC has a bug that no one has really stumbled across. GCC will try to look in thy system prefix ('/usr/local' f.ex.) into which it is instaled to find libraries installed along side GCC that should be preferred to the base system libraries ('/usr' f.ex.). This seems not unreasonable, but it has a very unfortunate consequence when combined with a '--sysroot' which does *not* contain the GCC installation we're using to complete the toolchain. That results in some of the host system's library directories being searched during the link. Now, it so happens that most folks doing stuff like this use '--with-sysroot' and '--disable-multilib' when configuring GCC. Even better, they're usually not cross-compiling to a target that is similar to the host. As a result, searching the host for libraries doesn't really matter -- most of the time weird directories get appended that don't exist (no arm triple lib directory, etc). Even if you're cross-compiling from 32-bit to 64-bit x86 or vice-versa, disabling multilib makes it less likely that you'll actually find viable libraries on the host. But that's just luck. We shouldn't rely on this, and this patch disables looking in the system prefix containing the GCC installation if that system prefix is *outside* of the sysroot. For empty sysroots, this has no effect. Similarly, when using the GCC *inside* of the sysroot, we still track wherever it is installed within the sysroot and look there for libraries. But now we can use a cross compiler GCC installation outside the system root, and only look for the crtbegin.o in the GCC installation, and look for all the other libraries inside the system root. This should fix PR12478, allowing Clang to be used when building a ChromiumOS image without polluting the image with libraries from the host system. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154176 91177308-0d34-0410-b5e6-96231b3b80d8
* Honor -fno-pic, -fno-PIC, -fno-pie, -fno-PIE.Nico Weber2012-04-041-1/+5
| | | | | | | | Review at http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120402/055759.html git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154064 91177308-0d34-0410-b5e6-96231b3b80d8
* [driver] When using the -mfpmath= option, add an error message when trying to Chad Rosier2012-04-041-3/+9
| | | | | | | | enable neonfp on a CPU that doesn't support NEON. rdar://11108618 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154061 91177308-0d34-0410-b5e6-96231b3b80d8
* Test commit to check commit access.Simon Atanasyan2012-04-041-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154056 91177308-0d34-0410-b5e6-96231b3b80d8
* Whitespace.Chad Rosier2012-04-041-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154050 91177308-0d34-0410-b5e6-96231b3b80d8
* [driver] Add a static helper function for handling -mfpu= to remove some codeChad Rosier2012-04-041-76/+45
| | | | | | | duplication. No functional change intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154049 91177308-0d34-0410-b5e6-96231b3b80d8
* Reduce variable scope.David Blaikie2012-04-041-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154047 91177308-0d34-0410-b5e6-96231b3b80d8
* [driver] Create a new -mfpmath= option, which is used to control whether clangChad Rosier2012-04-041-0/+25
| | | | | | | | | | | | uses Neon instructions for single-precision FP. -mfpmath=neon is analogous to passing llc -mattr=+neonfp. -mfpmath=[vfp|vfp2|vfp3|vfp4] is analogous to passing llc -mattr=-neonfp. rdar://11108618 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154046 91177308-0d34-0410-b5e6-96231b3b80d8
* modern objc translator. Add moreFariborz Jahanian2012-04-041-4/+9
| | | | | | | | rewriter specific option to cc1 with -rewrite-objc. // rdar://11143173 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154037 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused argument.Fariborz Jahanian2012-04-041-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154035 91177308-0d34-0410-b5e6-96231b3b80d8
* Use -rewrite-legacy-objc as clang argument for translating Fariborz Jahanian2012-04-023-0/+6
| | | | | | | | objective-c's fragile abi, Use -rewrite-objc for translating objective-c's modern abi. // rdar://11143173 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153877 91177308-0d34-0410-b5e6-96231b3b80d8
* Ignore unused --serialize-diagnostics option when using llvm-gcc.Bob Wilson2012-04-011-0/+3
| | | | | | | | | llvm-gcc doesn't handle --serialize-diagnostics so when compiling i386 kernel/kext code with -Werror, you get an error about that option being unused. Claim the argument to prevent this from breaking builds. <rdar://problem/11161933> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153854 91177308-0d34-0410-b5e6-96231b3b80d8
* ARM backend knows about cortex-m4. The front end should too.Jim Grosbach2012-03-292-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153678 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the emission of strict enum range metadata behind a flag (the sameChandler Carruth2012-03-271-0/+3
| | | | | | | | | | | | | | | | | | | | | flag as GCC uses: -fstrict-enums). There is a *lot* of code making unwarranted assumptions about the underlying type of enums, and it doesn't seem entirely reasonable to eagerly break all of it. Much more importantly, the current state of affairs is *very* good at optimizing based upon this information, which causes failures that are very distant from the actual enum. Before we push for enabling this by default, I think we need to implement -fcatch-undefined-behavior support for instrumenting and trapping whenever we store or load a value outside of the range. That way we can track down the misbehaving code very quickly. I discussed this with Rafael, and currently the only important cases he is aware of are the bool range-based optimizations which are staying hard enabled. We've not seen any issue with those either, and they are much more important for performance. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153550 91177308-0d34-0410-b5e6-96231b3b80d8
* [driver] Fix unused argument warnings.Chad Rosier2012-03-261-11/+19
| | | | | | | | | | | | | 1. Don't short-circuit conditional statements that are checking flags. Otherwise, the driver emits warnings about unused arguments. 2. -mkernel and -fapple-kext imply no exceptions, so claim exception related arguments now to avoid warnings about unused arguments. rdar://11120518 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153478 91177308-0d34-0410-b5e6-96231b3b80d8
* [driver] -mkernel implies -fno-common, so claim the arg to avoid an unusedChad Rosier2012-03-261-0/+1
| | | | | | | | argument warning. Part of rdar://11120518 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153470 91177308-0d34-0410-b5e6-96231b3b80d8
* [driver] -mkernel implies -fno-builtin, so claim the arg to avoid an unusedChad Rosier2012-03-261-0/+1
| | | | | | | | argument warning. Part of rdar://11120518 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153469 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for MIPS' floating ABIs (hard, soft and single) to clang driver.Akira Hatanaka2012-03-231-9/+35
| | | | | | | | Patch by Simon Atanasyan. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153348 91177308-0d34-0410-b5e6-96231b3b80d8
* Duplicated code is bad. At least make it consistent.Bob Wilson2012-03-212-71/+40
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153202 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153197 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a regression where ':' in CPLUS_INCLUDE_PATH and friends would no longer ↵Nico Weber2012-03-191-2/+2
| | | | | | | | | | separate paths. This regressed in r152583. Also add a test to make sure it doesn't regress again. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153034 91177308-0d34-0410-b5e6-96231b3b80d8
* [frontend] Fix how the frontend handles -fno-inline. AFAIK clang now matchesChad Rosier2012-03-151-0/+3
| | | | | | | | the behavior of gcc with respect to the -fno-inline and -fno-inline-functions flags. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152861 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r152745 (reverted in 152765) now that compiler-rt is fixed.David Blaikie2012-03-151-0/+1
| | | | | | | | | | | | | | | | | Original commit message: Provide -Wnull-conversion separately from -Wconversion. Like GCC, provide a NULL conversion to non-pointer conversion as a separate flag, on by default. GCC's flag is "conversion-null" which we provide for cross compatibility, but in the interests of consistency (with -Wint-conversion, -Wbool-conversion, etc) the canonical Clang flag is called -Wnull-conversion. Patch by Lubos Lunak. Review feedback by myself, Chandler Carruth, and Chad Rosier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152774 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r152745 as it's breaking the internal buildbots.Chad Rosier2012-03-151-1/+0
| | | | | | | | Abbreviated commit message: Provide -Wnull-conversion separately from -Wconversion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152765 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide -Wnull-conversion separately from -Wconversion.David Blaikie2012-03-141-0/+1
| | | | | | | | | | | | | Like GCC, provide a NULL conversion to non-pointer conversion as a separate flag, on by default. GCC's flag is "conversion-null" which we provide for cross compatibility, but in the interests of consistency (with -Wint-conversion, -Wbool-conversion, etc) the canonical Clang flag is called -Wnull-conversion. Patch by Lubos Lunak. Review feedback by myself, Chandler Carruth, and Chad Rosier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152745 91177308-0d34-0410-b5e6-96231b3b80d8
* [driver] Clang should report an error for -faltivec on non-ppc.Chad Rosier2012-03-131-0/+8
| | | | | | | rdar://10963572 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152684 91177308-0d34-0410-b5e6-96231b3b80d8
* [driver] Parse diagnostic args in the driver.Chad Rosier2012-03-131-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, only diagnostics thrown by the cc1 process were actually honoring the diagnostic options given on the command line, like -Werror. Reuse the existing code in Frontend currently used for cc1, adjusting it to not interpret -Wl, linker flags as warnings. Also fix a faulty test exposed by this change. It wasn't actually testing anything, and was giving this warning: clang-3: warning: argument unused during compilation: '-verify' Which -Werror didn't turn into an error because it was output by the driver, not the cc1 process, and diagnostic options weren't parsed by the driver. And you couldn't see the warning when running the test suite. Fixes PR12181. Patch by Dylan Noblesmith <nobled@dreamwidth.org>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152660 91177308-0d34-0410-b5e6-96231b3b80d8
* Tweak linkage order for solaris.David Chisnall2012-03-131-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152627 91177308-0d34-0410-b5e6-96231b3b80d8
* [msvc] Honor %INCLUDE%. It should know essential search paths with ↵NAKAMURA Takumi2012-03-131-1/+17
| | | | | | | | | | | | | | | | | | | | | | vcvarsall.bat. FYI, On VS10, %INCLUDE% contains; (VS10)\VC\INCLUDE (VS10)\VC\ATLMFC\INCLUDE (SDK70A)\include On VS11, (VS11)\VC\INCLUDE (VS11)\VC\ATLMFC\INCLUDE (SDK80)\include\shared (SDK80)\include\um (SDK80)\include\winrt FIXME: It may be enabled also on mingw. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152589 91177308-0d34-0410-b5e6-96231b3b80d8
* Address some of the concerns by Chandler.Bill Wendling2012-03-121-14/+11
| | | | | | | | | * s/AddDirectoryList/addDirectoryList/ * Move the call to ::getenv into the function. * FileCheck-ize the testcase. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152583 91177308-0d34-0410-b5e6-96231b3b80d8
* Update FIXME.Bill Wendling2012-03-121-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152579 91177308-0d34-0410-b5e6-96231b3b80d8