summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
...
* clang/lib/Driver/Driver.cpp: Split COMPILER_PATH according to ↵NAKAMURA Takumi2012-12-121-1/+2
| | | | | | | | llvm::sys::PathSeparator, that is ';' in Win32 hosts. Thanks to Bogon Kim! llvm-svn: 169964
* 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
* Driver/ToolChains.cpp: Add the name CentOS5 32bit gcc44 (aka ↵NAKAMURA Takumi2012-12-071-0/+1
| | | | | | | | i386-redhat-linux6E). Thanks to Bruce Stephens. llvm-svn: 169610
* Hexagon TC: add cc1 defaults for hexagon-gccMatthew Curtis2012-12-071-3/+2
| | | | | | compatibility llvm-svn: 169599
* Revert r169557. It seems that the test is too restrictedLogan Chien2012-12-061-1/+0
| | | | | | and will break the build on buildbot. llvm-svn: 169562
* Add i686-linux-android for gcc toolchain detection.Logan Chien2012-12-061-0/+1
| | | | | | | | | * Look for i686-linux-android under <sysroot>/lib/gcc. * This patch also slightly enhance the test suite for Android GCC toolchain detection. llvm-svn: 169557
* 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-063-47/+218
| | | | | | | | linker directly Rather than calling gcc. llvm-svn: 169512
* Hexagon TC: Move getHexagonTargetCPU from Tools.cpp toMatthew Curtis2012-12-063-52/+44
| | | | | | | | | | | | 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-064-26/+94
| | | | | | | | | | 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
* Driver.cpp: Restore clang/Config/config.h to be included at last not to ↵NAKAMURA Takumi2012-12-051-1/+4
| | | | | | | | prevent llvm-config.h. Or "llvm/Support/system_error.h" could not be compiled on mingw. llvm-svn: 169354
* 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
* ToolChains.cpp: Fixup r169260, clang/Config/config.h needs to be listed ↵NAKAMURA Takumi2012-12-041-4/+5
| | | | | | *last*, or llvm/Config/llvm-config.h could not be read in header files. llvm-svn: 169268
* Autotools has the same include guard for both Clang and LLVM's config.h.Chandler Carruth2012-12-041-1/+4
| | | | | | | | | | | | Shuffling order causes the wrong one to win. CMake didn't exhibit this problem because Clang's has *no* guards. I'll fix this properly tomorrow when Eric and I can check both build systems and get them to DTRT, but for now unbreak some bots by hoisting this header. llvm-svn: 169260
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-0418-61/+38
| | | | | | | | | | | | | 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-032-1/+20
| | | | | | 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-032-0/+28
| | | | 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-292-2/+9
| | | | | | | | | | | | | | 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-282-46/+66
| | | | | | diagnostic for invalid sets of sanitizers llvm-svn: 168794
* Remove an extra semicolon.Chad Rosier2012-11-271-1/+1
| | | | llvm-svn: 168707
* Remove some dead code. CLANG_IS_PRODUCTION is now just a build flag andRafael Espindola2012-11-271-1/+0
| | | | | | is not used in any #ifdef. llvm-svn: 168703
* Add -fsanitize=integer for reporting suspicious integer behaviors.Will Dietz2012-11-271-1/+1
| | | | | | Introduces new sanitizer "unsigned-integer-overflow". llvm-svn: 168701
* PR14306: Move -fbounds-checking to -fsanitize=bounds.Joey Gouly2012-11-232-9/+5
| | | | llvm-svn: 168510
* 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
OpenPOWER on IntegriCloud