summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
* Teach the Linux toolchain about more modern Gentoo installations of GCCChandler Carruth2013-08-262-8/+15
| | | | | | | | which add another wrinkle to the installation of the libstdc++ headers. Add at least some basic testing of the weirdnesses of Gentoo's layout. llvm-svn: 189212
* Produce an error when trying to link with -emit-llvm.Rafael Espindola2013-08-251-0/+4
| | | | llvm-svn: 189193
* Add gcc ARM flags -munaligned-access / -mno-unaligned-accessRenato Golin2013-08-241-3/+8
| | | | | | | | | | | | | | | | clang already had a mstrict-align which mentiones "Force all memory accesses to be aligned (ARM only)". On gcc arm this is controlled by -munaligned-access / -mno-unaligned-access. Add the gcc versions to the frontend and make -mstrict-align and alias to -mno-unaligned-access and only show it in clang -cc1 -help. Since the default value for unaligned accesses / strict alignment depends on the tripple, both the enable and disable flags are added. If both are set, the no-unaligned-access is used. Patch by Jeroen Hofstee. llvm-svn: 189175
* Add the -ffixed-r9 flag for ARM.Renato Golin2013-08-241-0/+8
| | | | | | | | | | | | This patch adds the -ffixed-r9 flag to clang to instruct llvm to globally preserve the contents of r9. The flag is added to the newly created ARM specific group. While at it, also place marm / mno-thumb in that group. Patch by Jeroen Hofstee. llvm-svn: 189174
* Don't imply -flto with -O4.Rafael Espindola2013-08-231-4/+0
| | | | | | We now saturate at -O3. llvm-svn: 189149
* Driver::IsUsingLTO() no longer return true when seeing -emit-llvm.Shuxin Yang2013-08-231-3/+5
| | | | | | | | | | One step toward differentiating following two commands: clang -O3 -flto a.c -c, and clang -O3 -emit-llvm a.c Thanks many awesome folks for clarifying things. llvm-svn: 189148
* Move -mfpmath handling to -cc1 and implement it for x86.Rafael Espindola2013-08-211-28/+5
| | | | | | | | | | | | | | | | | | | | | | | The original idea was to implement it all on the driver, but to do that the driver needs to know the sse level and to do that it has to know the default features of a cpu. Benjamin Kramer pointed out that if one day we decide to implement support for ' __attribute__ ((__target__ ("arch=core2")))', then the frontend needs to keep its knowledge of default features of a cpu. To avoid duplicating which part of clang handles default cpu features, it is probably better to handle -mfpmath in the frontend. For ARM this patch is just a small improvement. Instead of a cpu list, we check if neon is enabled, which allows us to reject things like -mcpu=cortex-a9 -mfpu=vfp -mfpmath=neon For X86, since LLVM doesn't support an independent ssefp feature, we just make sure the selected -mfpmath matches the sse level. llvm-svn: 188939
* Move the logic for selecting the last feature in the command line to the driver.Rafael Espindola2013-08-211-4/+19
| | | | | | | This is a partial revert of r188817 now that the driver handles -target-feature in a single place. llvm-svn: 188910
* Centralize the handling of -target-feature.Rafael Espindola2013-08-212-186/+178
| | | | | | | No functionality change other than changing the order of -target-feature relative to other -cc1 command line arguments. llvm-svn: 188906
* Centralize the handling of -target-cpu (-cc1, -cc1as) and -mcpu (gold plugin).Rafael Espindola2013-08-202-105/+87
| | | | llvm-svn: 188837
* Centralize the logic for handling -m* options and fix pr16943.Rafael Espindola2013-08-201-19/+2
| | | | | | | | | This moves the logic for handling -mfoo -mno-foo from the driver to -cc1. It also changes -cc1 to apply the options in order, fixing pr16943. The handling of -mno-mmx -msse is now an explicit special case. llvm-svn: 188817
* ARM: default to arm1176jzf-s for hard-float platforms.Tim Northover2013-08-201-2/+10
| | | | | | | | | | | | It makes no sense to try and compile for arm7tdmi when we're targeting something like gnueabihf. Although not strictly the most basic hardware conceivable, I believe arm1176jzf-s is a reasonable compromise (that can always be overridden explicitly if needed) since it's still in reasonably common use unlike earlier cores. Patch by Stephen Kelly. llvm-svn: 188796
* Re-apply r188666Alexey Samsonov2013-08-192-3/+14
| | | | llvm-svn: 188675
* clang/Driver: [PR12920] Don't forward any -W arguments to gcc-as and gcc-ld.NAKAMURA Takumi2013-08-191-0/+5
| | | | | | | | AFAIK, there are no -W options for gcc-as and gcc-ld. It caused failure to build clang with gcc-4.7 on cygwin. FIXME: Could we recategorize Options for gcc-as and gcc-ld? llvm-svn: 188668
* Revert r188666: it breaks the buildbotsAlexey Samsonov2013-08-191-13/+3
| | | | llvm-svn: 188667
* Fix PR16768: properly report malformed sanitizer blacklist file contentsAlexey Samsonov2013-08-191-3/+13
| | | | llvm-svn: 188666
* Move SanitizerArgs to the clang DriverAlexey Samsonov2013-08-197-147/+22
| | | | | | | | | | | | | | | | Summary: This change turns SanitizerArgs into high-level options stored in the Driver, which are parsed lazily. This fixes an issue of multiple copies of the same diagnostic message produced by sanitizer arguments parser. Reviewers: rsmith Reviewed By: rsmith CC: chandlerc, eugenis, cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1341 llvm-svn: 188660
* Windows ToolChain: add VS bin dir to PogramPathsHans Wennborg2013-08-161-37/+42
| | | | | | | | | | | | | We have a lot of fancy logic to find Visual Studio, which is currently used to set the system header include paths. Use the same code to set the ProgramPaths, which is used for finding programs such as link.exe. Previously, Clang would just search PATH for link.exe, but now it should find it if it's able to find Visual Studio. Differential Revision: http://llvm-reviews.chandlerc.com/D1417 llvm-svn: 188531
* make arm-use-movt available for all ARMRenato Golin2013-08-151-1/+1
| | | | | | | | | | | | This updates clang according to a pending patch for llvm to rename of the -arm-darwin-use-movt to arm-use-movt to make it available for all of ARM. note: please apply this close to the llvm change. Patch by Jeroen Hofstee. llvm-svn: 188488
* Build unwind tables by default on NetBSD.Joerg Sonnenberger2013-08-151-0/+3
| | | | llvm-svn: 188463
* Use the integrated assembler on NetBSD/powerpc by default.Joerg Sonnenberger2013-08-151-0/+5
| | | | llvm-svn: 188462
* Add support for -fsanitize-blacklist and default blacklists for DFSan.Peter Collingbourne2013-08-141-0/+3
| | | | | | | | Also add some documentation. Differential Revision: http://llvm-reviews.chandlerc.com/D1346 llvm-svn: 188403
* Enhance the clang -v gcc debug printing to skip obviously bad and duplicate ↵Benjamin Kramer2013-08-142-4/+6
| | | | | | | | | | | | | | | paths. Otherwise it lists all files (e.g. shared libraries) that happen to be in the same paths the GCC installations usually reside in. On a x86_64 Debian 7 system with i386 multilibs. before: clang -v 2>&1|wc -l 3059 after: clang -v 2>&1|wc -l 10 llvm-svn: 188400
* revert 188352Shuxin Yang2013-08-141-5/+3
| | | | llvm-svn: 188353
* Driver::IsUsingLTO() no longer return true when seeing -emit-llvm.Shuxin Yang2013-08-141-3/+5
| | | | | | | | | | The rationale for this change is to differentiate following two situations: 1) clang -c -emit-llvm a.c 2) clang -c -flto a.c Reviewed by Eric Christopher. Thanks a lot! llvm-svn: 188352
* Driver: Forward -Wl, and -Xlink arguments when using windows linkerHans Wennborg2013-08-141-1/+2
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D1394 llvm-svn: 188346
* clang-cl: Support /link option and set target to win32Hans Wennborg2013-08-132-0/+8
| | | | | | | | | | | | | This adds support for the /link option, which forwards subsequent arguments to the linker. The test for this will only work when targetting win32. Since that's the only target where clang-cl makes sense, use that target by default. Differential Revision: http://llvm-reviews.chandlerc.com/D1388 llvm-svn: 188331
* Link in the ubsan runtime when building shared objects.Nick Lewycky2013-08-131-3/+0
| | | | llvm-svn: 188325
* Handle "--" explicitly in the driverHans Wennborg2013-08-131-9/+17
| | | | | | | | | | Anything that comes after -- is treated as an input file. This used to be handled automagically by the option parsing library, but after LLVM r188314, we should handle it ourselves. No functionality change. llvm-svn: 188316
* Move logic to enable the vectorizer to clangArnold Schwaighofer2013-08-131-6/+37
| | | | | | | | | | | | | | | | | We used to decide whether to really vectorize depending on the optimization level in PassManagerBuilder. This patch moves this decision to the clang driver. We look at the optimization level and whether the f(no-)vectorize is set and decide whether to vectorize. This allows us to simplify the logic in PassManagerBuilder to just a check for whether the vectorizer should run or not. We now do the right thing for: $ clang -O1 -fvectorize $ clang -fno-vectorize -O3 llvm-svn: 188280
* Add XCore targetRobert Lytton2013-08-131-1/+18
| | | | llvm-svn: 188258
* clang-cl: Sink /Fe and /Fo diagnostic code into BuildActionsHans Wennborg2013-08-121-27/+28
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D1370 llvm-svn: 188226
* clang-cl: Support the /Fe optionHans Wennborg2013-08-122-27/+69
| | | | | | | | This is used to name the linked output file. Differential Revision: http://llvm-reviews.chandlerc.com/D1344 llvm-svn: 188210
* clang-cl: Expand warning about /TC and /TP override, and expand testHans Wennborg2013-08-121-14/+16
| | | | llvm-svn: 188190
* [Mips] MSA frontend option supportJack Carter2013-08-121-0/+3
| | | | | | | | | | | This patch adds -mmsa and -mno-msa to the options supported by clang to enable and disable support for MSA. When MSA is enabled, a predefined macro '__mips_msa' is defined to 1. Patch by Daniel Sanders llvm-svn: 188184
* Simplify now that llvm::sys::current_path checks $PWD.Rafael Espindola2013-08-101-23/+5
| | | | llvm-svn: 188128
* clang-cl: Don't pass /defaultlib to the linkerHans Wennborg2013-08-091-1/+2
| | | | | | | Since r187945, clang-cl will add the runtime library dependency to the .obj file. llvm-svn: 188086
* Add a convenient way to compare GCCVersions without creating temporary objects.Benjamin Kramer2013-08-092-16/+21
| | | | | | No functionality change. llvm-svn: 188084
* Fixup for r188058: assume hasAsanZeroBaseShadow() is false if ASan is not neededAlexey Samsonov2013-08-091-0/+2
| | | | llvm-svn: 188068
* Make SanitizerArgs parsing toolchain-independentAlexey Samsonov2013-08-094-35/+51
| | | | llvm-svn: 188058
* clang-cl: Support /showIncludesHans Wennborg2013-08-091-0/+3
| | | | | | | | | | This option prints information about #included files to stderr. Clang could already do it, this patch just teaches the existing code about the /showIncludes style and adds the flag. Differential Revision: http://llvm-reviews.chandlerc.com/D1333 llvm-svn: 188037
* clang-cl: use MS C++ ABIHans Wennborg2013-08-081-0/+4
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D1329 llvm-svn: 188000
* Revert "clang-cl: Hook up /Za to prevent adding oldnames.lib dependency"Reid Kleckner2013-08-081-5/+4
| | | | | | | | This reverts commit r187991 and adjusts the comment. /Za is much more involved, and we don't want to give anyone the impression we actually support it. llvm-svn: 187998
* clang-cl: Hook up /Za to prevent adding oldnames.lib dependencyHans Wennborg2013-08-081-4/+5
| | | | | | | | The /Za flag should probably do more, but let's start with this. Differential Revision: http://llvm-reviews.chandlerc.com/D1320 llvm-svn: 187991
* Factor out parsing sanitizer arguments to a separate functionAlexey Samsonov2013-08-082-6/+22
| | | | llvm-svn: 187977
* Move SanitizerArgs implementation from .h to .cppAlexey Samsonov2013-08-084-262/+308
| | | | llvm-svn: 187972
* The only useful loop unrolling flag to give realistically isChandler Carruth2013-08-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | '-fno-unroll-loops'. The option to the backend is even called 'DisableUnrollLoops'. This is precisely the form that Clang *didn't* support. We didn't recognize the flag, we didn't pass it to the CC1 layer, and even if we did we wouldn't use it. Clang only inspected the positive form of the flag, and only did so to enable loop unrolling when the optimization level wasn't high enough. This only occurs for an optimization level that even has a chance of running the loop unroller when optimizing for size. This commit wires up the 'no' variant, and switches the code to actually follow the standard flag pattern of using the last flag and allowing a flag in either direction to override the default. I think this is still wrong. I don't know why we disable the loop unroller entirely *from Clang* when optimizing for size, as the loop unrolling pass *already has special logic* for the case where the function is attributed as optimized for size! We should really be trusting that. Maybe in a follow-up patch, I don't really want to change behavior here. llvm-svn: 187969
* clang-cl: Support the run-time selection options (/MD, /MT et al.)Hans Wennborg2013-08-082-0/+48
| | | | | | | | | | | | These flags set some preprocessor macros and injects a dependency on the runtime library into the object file, which later is picked up by the linker. This also adds a new CC1 flag for adding a dependent library. Differential Revision: http://llvm-reviews.chandlerc.com/D1315 llvm-svn: 187945
* DataFlowSanitizer; Clang changes.Peter Collingbourne2013-08-072-1/+11
| | | | | | | | | | | | | DataFlowSanitizer is a generalised dynamic data flow analysis. Unlike other Sanitizer tools, this tool is not designed to detect a specific class of bugs on its own. Instead, it provides a generic dynamic data flow analysis framework to be used by clients to help detect application-specific issues within their own code. Differential Revision: http://llvm-reviews.chandlerc.com/D966 llvm-svn: 187925
* clang-cl: Use .obj as object file extension instead of .oHans Wennborg2013-08-072-5/+9
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D1302 llvm-svn: 187840
OpenPOWER on IntegriCloud