summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Tools.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [driver] Don't warn about an unused -flto option.Chad Rosier2012-12-121-0/+4
| | | | | | rdar://12851905 llvm-svn: 170010
* Add -fslp-vectorize to enable bb-vectorizeHal Finkel2012-12-111-0/+7
| | | | | | | | | | | Add -fslp-vectorize (with -ftree-slp-vectorize as an alias for gcc compatibility) to provide a way to enable the basic-block vectorization pass. This uses the same acronym as gcc, superword-level parallelism (SLP), also common in the literature, to refer to basic-block vectorization. Nadav suggested this as a follow-up to the adding of -fvectorize. llvm-svn: 169909
* [driver] Add the -fvectorize flag to enable the loop vectorization passes.Chad Rosier2012-12-111-0/+7
| | | | | | rdar://12839978 llvm-svn: 169885
* Add support to Darwin for the -export_dynamic' flag to the linker.Bill Wendling2012-12-101-0/+3
| | | | llvm-svn: 169775
* Hexagon TC: forward appropriate args to assemblerMatthew Curtis2012-12-071-0/+4
| | | | llvm-svn: 169611
* Hexagon TC: add cc1 defaults for hexagon-gccMatthew Curtis2012-12-071-3/+2
| | | | | | compatibility llvm-svn: 169599
* Hexagon TC: Add/improve support for small dataMatthew Curtis2012-12-061-6/+40
| | | | | | threshold, pic, pie llvm-svn: 169517
* Hexagon TC: Reimplement Link::ConstructJob to callMatthew Curtis2012-12-061-46/+136
| | | | | | | | linker directly Rather than calling gcc. llvm-svn: 169512
* Hexagon TC: Move getHexagonTargetCPU from Tools.cpp toMatthew Curtis2012-12-061-52/+6
| | | | | | | | | | | | ToolChains.cpp This is in anticipation of forthcoming library path changes. Also ... - Fixes some inconsistencies in how the arch is passed to tools. - Add test cases for various forms of arch flags llvm-svn: 169505
* Hexagon TC: Update toolchain to add appropriate includeMatthew Curtis2012-12-061-1/+0
| | | | | | | | | | paths - Inherit from Linux rather than ToolChain - Override AddClangSystemIncludeArgs and AddClangCXXStdlibIncludeArgs to properly set include paths. llvm-svn: 169495
* [driver, ms-inline asm] MS-Style inline assembly is controlled by theChad Rosier2012-12-051-3/+4
| | | | | | | -fasm-blocks flag, not the -fms-extensions flag. rdar://12808010 llvm-svn: 169422
* Reuse an existing diagnostic for tsan/msan needing -pie error.Evgeniy Stepanov2012-12-051-4/+13
| | | | | | | Add a diagnosting for -fsanitize=memory conflicting with other sanitizers. Extend tests. llvm-svn: 169380
* Add -whole-archive around the ASan runtime archive in the link command.Chandler Carruth2012-12-041-2/+8
| | | | | | | | | | | This ensures that even though it comes first, we pick up its .o files. Note that if we can use this (or something similar / equivalent) on other platforms, we could potentially remove ReplaceOperatorsNewAndDelete from the ASan runtimes. We should probably do something similar for TSan and MSan as well. llvm-svn: 169328
* Currently, with -fsanitize=address, the driver appends libclang_rt.asan.a toMatt Beaumont-Gay2012-12-041-2/+6
| | | | | | | | | | | | | | | | the link command. This all works fine when the driver is also responsible for adding -lstdc++ to the link command. But, if -lstdc++ (or libstdc++.a, etc) is passed explicitly to the driver, the ASan runtime will appear in the link command after the standard library, leading to multiple-definition errors for the global 'operator new' and 'operator delete'. Fix this in a painfully simple way, by inserting libclang_rt.asan.a at the start of the link command instead of the end. If we need to do something more clever, we can walk the link command looking for something that resembles libstdc++ and insert libclang_rt.asan.a as late as possible, but the simple solution works for now. llvm-svn: 169310
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-10/+7
| | | | | | | | | | | | | 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
* Add Clang flags -fsanitize-blacklist and -fno-sanitize-blacklist. Make this ↵Alexey Samsonov2012-12-031-0/+13
| | | | | | flag usable for ASan. Blacklisting can be used to disable sanitizer checks for particular file/function/object. llvm-svn: 169144
* Add -fsanitize=memory.Evgeniy Stepanov2012-12-031-0/+26
| | | | llvm-svn: 169124
* [MIPS] Add -mxgot/-mno-xgot command line optionsSimon Atanasyan2012-12-011-0/+7
| | | | | | to enable/disable support of GOT larger than 64k. llvm-svn: 169098
* Remove restriction on combining ubsan with asan or tsan. This has worked for ↵Richard Smith2012-12-011-5/+4
| | | | | | a while. llvm-svn: 169066
* Add ARM cortex-a5 subtargetQuentin Colombet2012-11-291-2/+2
| | | | llvm-svn: 168958
* Revert commit revision r168953, to change the commit message, which was emptyQuentin Colombet2012-11-291-2/+2
| | | | llvm-svn: 168956
* (no commit message)Quentin Colombet2012-11-291-2/+2
| | | | llvm-svn: 168953
* This patch exposes to Clang users three more sanitizers are experimental ↵Alexey Samsonov2012-11-291-0/+7
| | | | | | | | | | | | | | features of ASan: 1) init-order sanitizer: initialization-order checker. Status: usable, but may produce false positives w/o proper blacklisting. 2) use-after-return sanitizer Status: implemented, but heavily understed. Should be optional, as it significanlty slows program down. 3) use-after-scope sanitizer Status: in progress. llvm-svn: 168950
* Make sure that we put the rest of the sanitizer libraries on the link lineEric Christopher2012-11-291-7/+5
| | | | | | before libstdc++ like we do with ubsan. llvm-svn: 168918
* [driver] -mkernel implies -mstrict-align; don't add the redundant option.Chad Rosier2012-11-291-1/+2
| | | | | | rdar://12771737 llvm-svn: 168841
* Refactor -fsanitize, -f*-sanitizer arguments parsing. Provide a more careful ↵Alexey Samsonov2012-11-281-44/+4
| | | | | | diagnostic for invalid sets of sanitizers llvm-svn: 168794
* PR14306: Move -fbounds-checking to -fsanitize=bounds.Joey Gouly2012-11-231-8/+4
| | | | llvm-svn: 168510
* Reapply a subset of r167567 to clean up Darwin-specific code for invoking gcc.Bob Wilson2012-11-231-612/+10
| | | | | | | | | | | 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-211-1/+1
| | | | | | | | | | | | | | | | | | 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
* 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
* Completely re-work how the Clang driver interprets PIC and PIE options.Chandler Carruth2012-11-191-67/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* UBSan: enable proper linking with UBsan runtime on Darwin. Turn on building ↵Alexey Samsonov2012-11-161-4/+5
| | | | | | 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-151-0/+5
| | | | | | | | 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
* Revert r167567, restoring the ability of clang to run gcc in cases where itNick Lewycky2012-11-151-10/+612
| | | | | | 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
* 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
* Rip out a bunch of code for invoking gcc from clang.Bob Wilson2012-11-081-612/+10
| | | | llvm-svn: 167567
* 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-061-113/+26
| | | | | | 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-011-60/+60
| | | | llvm-svn: 167211
* getArchTypeForDarwinArchName is only used in the clang driver, copy it there.Rafael Espindola2012-10-311-0/+31
| | | | | | I will remove it from llvm in the next commit. llvm-svn: 167156
* [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
OpenPOWER on IntegriCloud