summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
...
* Reapply a subset of r167567 to clean up Darwin-specific code for invoking gcc.Bob Wilson2012-11-233-672/+18
| | | | | | | | | | | Unlike my previous attempt at this, this patch leaves intact the check for whether clang can handle the input file type, and for non-Darwin toolchains it will invoke gcc for things it cannot handle. For Darwin toolchains, the behavior reported in pr14338 still occurs with this patch, but that is a definite improvement from what happens currently, where it just crashes with an assertion failure. llvm-svn: 168505
* Fix the '-fuse-init-array' option to actually be an option.Chandler Carruth2012-11-214-6/+13
| | | | | | | | | | | | | | | | | | 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
* Test commit: Remove blank line.Joey Gouly2012-11-211-1/+1
| | | | llvm-svn: 168436
* [Sanitizer] force linking with static sanitizer runtimes on Darwin even if ↵Alexey Samsonov2012-11-212-8/+11
| | | | | | they are not found in resource directory. Add test checking sanitizer linker flags on Darwin. llvm-svn: 168428
* Add -ldl for non-static libgcc in Android.Logan Chien2012-11-191-3/+11
| | | | | | | | | | | According to Android ABI, we have to link with libdl.so, if we are linking with non-static libgcc. Besides, this also fixes MIPS link error of undefined references to `_Unwind_Find_FDE' and `dl_iterate_phdr'. llvm-svn: 168310
* Enable -fuse-init-array for Android X86/MIPS.Logan Chien2012-11-191-1/+2
| | | | | | | | | | | | The dynamic linker of Android does not support .ctors/.dtors. We should emit .init_array and .fini_array regardless the gcc version. NOTE: This patch does not affect the ARM backend, because it is required to generate .init_array and .fini_array for program targeting ARM AAPCS and AEABI. llvm-svn: 168309
* Completely re-work how the Clang driver interprets PIC and PIE options.Chandler Carruth2012-11-194-104/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were numerous issues here that were all entangled, and so I've tried to do a general simplification of the logic. 1) The logic was mimicing actual GCC bugs, rather than "features". These have been fixed in trunk GCC, and this fixes Clang as well. Notably, the logic was always intended to be last-match-wins like any other flag. 2) The logic for handling '-mdynamic-no-pic' was preposterously unclear. It also allowed the use of this flag on non-Darwin platforms where it has no actual meaning. Now this option is handled directly based on tests of how llvm-gcc behaves, and it is only supported on Darwin. 3) The APIs for the Driver's ToolChains had the implementation ugliness of dynamic-no-pic leaking through them. They also had the implementation details of the LLVM relocation model flag names leaking through. 4) The actual results of passing these flags was incorrect on Darwin in many cases. For example, Darwin *always* uses PIC level 2 if it uses in PIC level, and Darwin *always* uses PIC on 64-bit regardless of the flags specified, including -fPIE. Darwin never compiles in PIE mode, but it can *link* in PIE mode. 5) Also, PIC was not always being enabled even when PIE was. This isn't a supported mode at all and may have caused some fallout in builds with complex PIC and PIE interactions. The result is (I hope) cleaner and clearer for readers. I've also left comments and tests about some of the truly strage behavior that is observed on Darwin platforms. We have no real testing of Windows platforms and PIC, but I don't have the tools handy to figure that out. Hopefully others can beef up our testing here. Unfortunately, I can't test this for every platform. =/ If folks have dependencies on these flags that aren't covered by tests, they may break. I've audited and ensured that all the changes in behavior of the existing tests are intentional and good. In particular I've tried to make sure the Darwin behavior (which is more suprising than the Linux behavior) also matches that of 'gcc' on my mac. llvm-svn: 168297
* Revert r167799. It's not really correct, and it doesn't fix the problem that ↵Bill Wendling2012-11-161-16/+9
| | | | | | it was intended to fix. llvm-svn: 168217
* [driver] Add the missing TY_PP_ObjCXX_Alias case to the isCXX function.Chad Rosier2012-11-161-1/+1
| | | | | | | | | This was causing different behavior when using -x objective-c++-cpp-output as compared to -x objc++-cpp-output. Specifically, the driver was not adding the -fcxx-exceptions flag in the latter case. rdar://12680312 llvm-svn: 168212
* UBSan: enable proper linking with UBsan runtime on Darwin. Turn on building ↵Alexey Samsonov2012-11-162-6/+24
| | | | | | ubsan on OS X in 'make' build system. Patch by Jean-Daniel Dupas. llvm-svn: 168168
* block extended signatur option. Change previous optionFariborz Jahanian2012-11-152-0/+9
| | | | | | | | to a cc1 -fencode-extended-block-signature and pass it to cc1 and recognize this option to produce extended block type signature. // rdar://12109031 llvm-svn: 168063
* Use empty parens for empty function parameter list instead of '(void)'.Dmitri Gribenko2012-11-151-2/+2
| | | | llvm-svn: 168041
* Revert r167567, restoring the ability of clang to run gcc in cases where itNick Lewycky2012-11-156-35/+796
| | | | | | can't handle the input file type. This resulted in PR14338. llvm-svn: 168024
* This patch makes the behavior of clang consistent with the behavior of gcc ↵Benjamin Kramer2012-11-131-7/+19
| | | | | | | | | | | | | 4.6 in cases where both -fPIC and -fPIE is used. - Separately check if -fPIE was specified in the command line and define both __PIC__ and __PIE__ when -fPIE is used. We need to check this separately because -fPIE will infer -fPIC even if its not explicitly used. - Fixed existing tests. - Added new tests for cases where both -fPIC and -fPIE is used. Author: Tareq A. Siraj <tareq.a.siraj@intel.com> Fixes: PR13221 Review: http://llvm-reviews.chandlerc.com/D94 llvm-svn: 167846
* Disable accelerator tables when compiling with LTO.Bill Wendling2012-11-131-9/+16
| | | | | | | | LTO doesn't generate correct accelerator tables. This is due to the general lack correct of debug info for LTO. Disable it when using LTO. <rdar://problem/12401423> llvm-svn: 167799
* PR14303: Add a NoDriverOption flag to those options which are not accepted byRichard Smith2012-11-092-7/+7
| | | | | | | the driver (the options defined in CC1Options.td) and exclude their help from "clang --help". llvm-svn: 167638
* Implement -mstrict-align using '-backend-option -arm-strict-align' as this savesChad Rosier2012-11-091-1/+2
| | | | | | us from having to make any backend changes. llvm-svn: 167623
* [driver] Add a -mstrict-align compiler option for ARM targets.Chad Rosier2012-11-091-0/+3
| | | | | | rdar://12340498 llvm-svn: 167619
* Remove old driver code to grab the iOS simulator version from the -D option.Bob Wilson2012-11-092-81/+7
| | | | | | | We can now rely on the -mios-simulator-version-min command line option and remove the awful hack. <rdar://problem/10304510> llvm-svn: 167603
* Remove more code related to invoking llvm-gcc. <rdar://problem/11991320>Bob Wilson2012-11-082-27/+0
| | | | llvm-svn: 167598
* Driver/Darwin: The -arch argument values aren't exactly the arch names from aDaniel Dunbar2012-11-082-1/+16
| | | | | | | | triple. - Translate the special case of powerpc to its expected -arch name. llvm-svn: 167571
* Rip out a bunch of code for invoking gcc from clang.Bob Wilson2012-11-086-796/+35
| | | | llvm-svn: 167567
* Remove code to fall back to llvm-gcc for i386 kexts.Bob Wilson2012-11-082-16/+3
| | | | | | More cleanups to follow in separate commits.... llvm-svn: 167566
* [Driver] Fix -Wp,-MMD pr13959Michael J. Spencer2012-11-071-3/+3
| | | | llvm-svn: 167559
* clang/lib/Driver/Tools.cpp: Fix abuse of StringRef.NAKAMURA Takumi2012-11-061-1/+1
| | | | llvm-svn: 167494
* Follow-up for r167411 to un-break ASan on Mac. Move SanitizerArgs to a ↵Alexey Samsonov2012-11-063-116/+138
| | | | | | header file and use it on Darwin toolchain. llvm-svn: 167460
* Per discussion on cfe-commits, treat -faddress-sanitizer,Richard Smith2012-11-061-13/+27
| | | | | | | | | -fno-address-sanitizer, -fthread-sanitizer, -fno-thread-sanitizer, and -fcatch-undefined-behavior as deprecated: produce a warning if they are used pointing to the corresponding -fsanitize= option. In passing add the missing '-' to some diagnostics. llvm-svn: 167429
* Use the individual -fsanitize=<...> arguments to control which of the UBSanRichard Smith2012-11-051-6/+0
| | | | | | | checks to enable. Remove frontend support for -fcatch-undefined-behavior, -faddress-sanitizer and -fthread-sanitizer now that they don't do anything. llvm-svn: 167413
* Add -fsanitize=<sanitizers> argument to driver and frontend, and addRichard Smith2012-11-051-21/+162
| | | | | | | | | | | | -fno-sanitize=<sanitizers> argument to driver. These allow ASan, TSan, and the various UBSan checks to be enabled and disabled separately. Right now, the different modes can't be combined, but the intention is that combining UBSan and the other sanitizers will be permitted in the near future. Currently, the UBSan checks will all be enabled if any of them is; that will be fixed by the next patch. llvm-svn: 167411
* Improve x86 android support:Rafael Espindola2012-11-021-5/+8
| | | | | | | | * -Bsymbolic must be added for x86 as well. * Default CPU name also set to 'core2' for x86 android. Patch by Edwin Vane. llvm-svn: 167307
* Add -lpthread when building with Ubsan on Linux, in preparation for making ↵Richard Smith2012-11-021-0/+1
| | | | | | libclang-rt.ubsan pull in sanitizer_common, which in turn depends on pthreads. llvm-svn: 167305
* Remove first argument from Arg::getValue; it's been unused since r105760.Richard Smith2012-11-016-121/+121
| | | | llvm-svn: 167211
* [driver] Remove an extra space with the -iprefix option, so thatChad Rosier2012-10-311-1/+1
| | | | | | | matching works correctly. Part of rdar://12329974 llvm-svn: 167173
* [driver] Remove an extra space with the -internal-externc-isystem option, soChad Rosier2012-10-311-1/+1
| | | | | | | that matching works correctly. Part of rdar://12329974 llvm-svn: 167161
* getArchTypeForDarwinArchName is only used in the clang driver, copy it there.Rafael Espindola2012-10-314-5/+38
| | | | | | I will remove it from llvm in the next commit. llvm-svn: 167156
* [driver] Completely rework how superfluous options are stripped out of the crashChad Rosier2012-10-312-53/+102
| | | | | | | | | | | | diagnostics script. This addresses the FIXME pertaining to quoted arguments. We also delineate between those flags that have an argument (e.g., -D macro, -MF file) and those that do not (e.g., -M, -MM, -MG). Finally, we add the -dwarf-debug-flags to the list of flags to be removed. rdar://12329974 llvm-svn: 167152
* Fix if-else braces layout accordingly to the style guide.Simon Atanasyan2012-10-311-2/+1
| | | | llvm-svn: 167118
* Extend -Bprefix functionality and make it closer to gcc. If the "prefix"Simon Atanasyan2012-10-311-6/+13
| | | | | | | | | | is not a directory, Driver::GetProgramPath() routine does not try to append the program name as a "path component" to it. It just joins the "prefix" with the program name and checks the resulting path existence. The patch reviewed by Rafael Espindola. llvm-svn: 167114
* Remove the -ccc-no-clang option.Rafael Espindola2012-10-311-3/+1
| | | | llvm-svn: 167093
* Remove ccc-no-clang-cpp, which is also dead now.Rafael Espindola2012-10-301-8/+3
| | | | llvm-svn: 167062
* [driver] Older versions of ld expect '-L<dir>' not '-L <dir>'. In Xcode4 andChad Rosier2012-10-301-8/+30
| | | | | | | | later, '-L <dir>' is allowed, but rewrite these in the driver as '-L<dir>' to maintain backward compatibility. The same is true for the -I option. rdar://12366753 llvm-svn: 167054
* In the past "production" clang builds would not be used for c++, andRafael Espindola2012-10-301-10/+1
| | | | | | | | | we had the -ccc-clang-cxx and -ccc-no-clang-cxx options to force them on or off for testing. Clang c++ support is now production quality and these options are dead. llvm-svn: 166986
* Remove a bit of dead code.Rafael Espindola2012-10-292-20/+0
| | | | llvm-svn: 166983
* Reverted back the changes made in 166868 and in 166869Mahesha S2012-10-271-1/+0
| | | | llvm-svn: 166871
* -------------------------------------------------Mahesha S2012-10-271-0/+2
| | | | | | | | | | | | | | | | | | | | Feature: OpenMP support in CLANG: Sub-Feature: Support for option -fopenmp Files Changed/Added: * include/clang/Driver/Options.td (C) * include/clang/Basic/LangOptions.def (C) * lib/Driver/Tools.cpp (C) * lib/Frontend/CompilerInvocation.cpp (C) Test Cases Changed/Added: * test/Driver/clang_fopenmp_opt.c (A) ------------------------------------------------- llvm-svn: 166868
* [driver] Before applying the working directory check if the input pathArgyrios Kyrtzidis2012-10-261-2/+2
| | | | | | is absolute. llvm-svn: 166808
* [options] Fix mishandling of aliased options that was introduced in r166444.Argyrios Kyrtzidis2012-10-261-8/+18
| | | | llvm-svn: 166801
* -fcatch-undefined-behavior checking for appropriate vptr value: Clang ↵Richard Smith2012-10-251-1/+3
| | | | | | CodeGen side. llvm-svn: 166661
* Handle -pthread, -pg and -shared correctly on bitrig.Rafael Espindola2012-10-231-2/+8
| | | | | | Patch by David Hill. llvm-svn: 166483
* [Options] Add prefixes to options.Michael J. Spencer2012-10-228-51/+135
| | | | | | | | | | | | | | Each option has a set of prefixes. When matching an argument such as -funroll-loops. First the leading - is removed as it is a prefix. Then a lower_bound search for "funroll-loops" is done against the option table by option name. From there each option prefix + option name combination is tested against the argument. This allows us to support Microsoft style options where both / and - are valid prefixes. It also simplifies the cases we already have where options come in both - and -- forms. Almost every option for gnu-ld happens to have this form. llvm-svn: 166444
OpenPOWER on IntegriCloud