summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
* Don't link lib[std]c++ when -nostdlib is specified (Solaris driver).David Chisnall2012-04-101-2/+2
| | | | | | Patch by Dmitri Shubin! llvm-svn: 154392
* Pass -march, -mcpu, -mfpu to linuxtools assembler.Evgeniy Stepanov2012-04-101-0/+4
| | | | llvm-svn: 154389
* 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 llvm-svn: 154357
* 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 llvm-svn: 154334
* objective-c: Remove -fno-objc-default-synthesize-propertiesFariborz Jahanian2012-04-091-3/+2
| | | | | | | as the driver option. // rdar://11209719 llvm-svn: 154331
* Revert r154321, pending more discussion.David Chisnall2012-04-091-4/+0
| | | | llvm-svn: 154327
* 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. llvm-svn: 154321
* Factor out ARM floating ABI determination to new routine Anton Korobeynikov2012-04-091-35/+44
| | | | llvm-svn: 154318
* 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. llvm-svn: 154315
* 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. llvm-svn: 154291
* MIPS: Pass -mabi option to the assmbler when compile MIPS targets.Simon Atanasyan2012-04-071-10/+14
| | | | llvm-svn: 154270
* MIPS: Move code calculates CPU and ABI names to the separate function to ↵Simon Atanasyan2012-04-071-13/+21
| | | | | | reuse this function later. llvm-svn: 154269
* [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 llvm-svn: 154231
* MIPS: Provide a correct path to the dynamic linker when build for MIPS ↵Simon Atanasyan2012-04-061-0/+3
| | | | | | 64-bit targets. llvm-svn: 154200
* MIPS: Pass -EB/-EL argument to the assembler according to selected endian ↵Simon Atanasyan2012-04-061-0/+6
| | | | | | when compile for MIPS targets. llvm-svn: 154195
* 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. llvm-svn: 154176
* 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 llvm-svn: 154064
* [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 llvm-svn: 154061
* Test commit to check commit access.Simon Atanasyan2012-04-041-1/+0
| | | | llvm-svn: 154056
* Whitespace.Chad Rosier2012-04-041-2/+2
| | | | llvm-svn: 154050
* [driver] Add a static helper function for handling -mfpu= to remove some codeChad Rosier2012-04-041-76/+45
| | | | | | duplication. No functional change intended. llvm-svn: 154049
* Reduce variable scope.David Blaikie2012-04-041-2/+1
| | | | llvm-svn: 154047
* [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 llvm-svn: 154046
* modern objc translator. Add moreFariborz Jahanian2012-04-041-4/+9
| | | | | | | rewriter specific option to cc1 with -rewrite-objc. // rdar://11143173 llvm-svn: 154037
* Remove unused argument.Fariborz Jahanian2012-04-041-2/+2
| | | | llvm-svn: 154035
* 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 llvm-svn: 153877
* 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> llvm-svn: 153854
* ARM backend knows about cortex-m4. The front end should too.Jim Grosbach2012-03-292-0/+2
| | | | llvm-svn: 153678
* 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. llvm-svn: 153550
* [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 llvm-svn: 153478
* [driver] -mkernel implies -fno-common, so claim the arg to avoid an unusedChad Rosier2012-03-261-0/+1
| | | | | | | argument warning. Part of rdar://11120518 llvm-svn: 153470
* [driver] -mkernel implies -fno-builtin, so claim the arg to avoid an unusedChad Rosier2012-03-261-0/+1
| | | | | | | argument warning. Part of rdar://11120518 llvm-svn: 153469
* Add support for MIPS' floating ABIs (hard, soft and single) to clang driver.Akira Hatanaka2012-03-231-9/+35
| | | | | | Patch by Simon Atanasyan. llvm-svn: 153348
* 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. 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
* 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. llvm-svn: 153034
* [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. llvm-svn: 152861
* 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. llvm-svn: 152774
* Revert r152745 as it's breaking the internal buildbots.Chad Rosier2012-03-151-1/+0
| | | | | | | Abbreviated commit message: Provide -Wnull-conversion separately from -Wconversion. llvm-svn: 152765
* 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. llvm-svn: 152745
* [driver] Clang should report an error for -faltivec on non-ppc.Chad Rosier2012-03-131-0/+8
| | | | | | rdar://10963572 llvm-svn: 152684
* [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>. llvm-svn: 152660
* Tweak linkage order for solaris.David Chisnall2012-03-131-1/+2
| | | | llvm-svn: 152627
* [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. llvm-svn: 152589
* 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. llvm-svn: 152583
* Update FIXME.Bill Wendling2012-03-121-1/+1
| | | | llvm-svn: 152579
* Have clang pay attention to the LIBRARY_PATH environment variable.Bill Wendling2012-03-121-41/+44
| | | | | | | | The LIBRARY_PATH environment variable should be honored by clang. Have the driver pass the directories to the linker. <rdar://problem/9743567> and PR10296. llvm-svn: 152578
* Use VersionTuple to manage macosx versions in the driver. No functionality ↵Benjamin Kramer2012-03-103-34/+13
| | | | | | change. llvm-svn: 152504
* Update comment after r152140. Clarify a bit too.Nico Weber2012-03-091-1/+2
| | | | llvm-svn: 152441
* [analyzer] Rework inlining related command line options.Anna Zaks2012-03-081-1/+1
| | | | | | | | | - Remove -analyzer-inline-call. - Add -analyzer-ipa=[none|inlining] - Add -analyzer-inlining-mode to allow experimentation for different performance tuning methods. llvm-svn: 152351
OpenPOWER on IntegriCloud