summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Tools.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [ARMv8] Change the naming of some options to be more consistent.Joey Gouly2013-09-131-2/+2
| | | | | | Clang side changes for LLVM r190692. llvm-svn: 190693
* clang-cl: Warn about overriding /MD with /MT etc.Hans Wennborg2013-09-111-4/+12
| | | | | | | This also bakes the /M options into a separate option group to make them easier to refer to from the code. llvm-svn: 190529
* Fix the ASan dll_thunk pathTimur Iskhodzhanov2013-09-111-2/+1
| | | | llvm-svn: 190516
* Add -fansi-escape-codes optionNico Rieck2013-09-111-0/+3
| | | | | | | | | | | | | Some build systems use pipes for stdin/stderr. On nix-ish platforms colored output can be forced by -fcolor-diagnostics. On Windows this option has no effect in these cases because LLVM uses the console API (which only operates on the console buffer) even if a console wrapper capable of interpreting ANSI escape codes is used. The -fansi-escape-codes option allows switching from the console API to ANSI escape codes. It has no effect on other platforms. llvm-svn: 190464
* clang-cl: Support building DLLs (PR17083)Hans Wennborg2013-09-101-3/+28
| | | | | | | | This adds driver support for building DLLs (the /LD and /LDd flags). It basically does two things: runtime selection and passing -dll and -implib to the linker. llvm-svn: 190428
* clang-cl: use -fdiagnostics-format=msvc by defaultHans Wennborg2013-09-101-0/+5
| | | | | | | This allows for navigating to errors within the MSVC IDE by clicking on the diagnostics. llvm-svn: 190378
* Tweak implementation of -Wwrite-strings to better match the behavior of ↵Richard Smith2013-09-041-7/+18
| | | | | | | | | | | | | | | | current GCCs: * In C, as before, if the "warning flag" is enabled, warnings are produced by forcing string literals to have const-qualified types (the produced warnings are *not* -Wwrite-strings warnings). However, more recent GCCs (at least 4.4 onwards) now take -w into account here, so we now do the same. * In C++, this flag is entirely sane: it behaves just like any other warning flag. Stop triggering -fconst-strings here. This is a bit cleaner, but there's no real functionality change except in the case where -Xclang -fno-const-strings is also specified. llvm-svn: 190006
* Remove the -fuse-gold-plugin driver option.Rafael Espindola2013-09-041-5/+2
| | | | | | | | * It was redundant with -flto. * It was confusing since -uAnythingElse is a different option. * GCC uses -fuse-linker-plugin, so it was not even a compatibility option. llvm-svn: 189976
* clang-cl: Pass -incremental:no to linker when using ASanHans Wennborg2013-08-301-0/+1
| | | | llvm-svn: 189664
* use the last passed -munaligned-access / -mno-unaligned-accessRenato Golin2013-08-281-6/+9
| | | | | | | | | | | | | | | Passing inconsistent munaligned-access / mno-unaligned-access flags, intentionally resulted in a warning and the flag no-unaligned-access being used. Gcc does, at least in practice, use the last flag in such a case. This patch updates clang behaviour accordingly; use the last flag or base alignment behaviour on the target (which llvm will do if no flag is explicitly passed) Patch by Jeroen Hofstee. llvm-svn: 189542
* clang-cl: Pass -debug to the linker when using -fsanitize=addressHans Wennborg2013-08-281-0/+1
| | | | llvm-svn: 189496
* Revert r189440 - Disable loop vectorizer unrolling when no unrolling requestedHal Finkel2013-08-281-11/+1
| | | | | | | | | | | | | | | | | | | | | As Chandler pointed out, we should not be using -backend-option because this will cause crashes for users of the tooling interface, etc. A better way to fix this will be to provide the unrolling pass-manager flag to the loop vectorizer directly. Original commit message: Disable loop vectorizer unrolling when no unrolling requested In addition to the regular loop unrolling transformation, the loop vectorizer can also unroll loops. If no unrolling has specifically been requested (by -fno-unroll-loops), and the loop vectorizer will be used, then add the backend option to (also) prevent the loop vectorizer from unrolling loops. I confirmed with Nadav (off list) that disabling vectorizer loop unrolling when -fno-unroll-loops is provided is the desired behavior. llvm-svn: 189441
* Disable loop vectorizer unrolling when no unrolling requestedHal Finkel2013-08-281-1/+11
| | | | | | | | | | | | In addition to the regular loop unrolling transformation, the loop vectorizer can also unroll loops. If no unrolling has specifically been requested (by -fno-unroll-loops), and the loop vectorizer will be used, then add the backend option to (also) prevent the loop vectorizer from unrolling loops. I confirmed with Nadav (off list) that disabling vectorizer loop unrolling when -fno-unroll-loops is provided is the desired behavior. llvm-svn: 189440
* clang-cl: Support -fsanitize=addressHans Wennborg2013-08-271-0/+8
| | | | | | | | | This exposes the -fsanitize=address option and adds the runtime library to the link command. Differential Revision: http://llvm-reviews.chandlerc.com/D1526 llvm-svn: 189389
* Warn that -O4 is the same as -O3.Rafael Espindola2013-08-271-3/+11
| | | | | | | We error on -O5 and higher. While it is tempting to do the same for -O4, I agree with Jordan Rose: we should warn for a release at least first. llvm-svn: 189369
* Simplify now that -O4 just maps to -O3 and -O is an alias of -O2.Rafael Espindola2013-08-261-11/+5
| | | | llvm-svn: 189218
* 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
* 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-211-179/+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-201-103/+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
* 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
* Move SanitizerArgs to the clang DriverAlexey Samsonov2013-08-191-4/+5
| | | | | | | | | | | | | | | | 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
* 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
* 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-131-0/+2
| | | | | | | | | | | | | 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
* 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
* [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
* Make SanitizerArgs parsing toolchain-independentAlexey Samsonov2013-08-091-5/+5
| | | | 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
* Move SanitizerArgs implementation from .h to .cppAlexey Samsonov2013-08-081-124/+0
| | | | 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-081-0/+45
| | | | | | | | | | | | 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-071-0/+8
| | | | | | | | | | | | | 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
* Add option to disable module loading.Daniel Jasper2013-08-051-0/+7
| | | | | | | This patch was created by Lawrence Crowl and reviewed in: http://llvm-reviews.chandlerc.com/D963 llvm-svn: 187738
* Only use the Darwin linker's -export_dynamic option with supported versions.Bob Wilson2013-08-021-3/+3
| | | | | | Related to <rdar://problem/14578094>. llvm-svn: 187680
* Re-commit r187637: "clang-cl: add more options"Hans Wennborg2013-08-021-0/+3
| | | | | | | | | | | | | | > This adds a bunch of options to clang-cl. Notably, this includes > all the options that get passed when doing a default build of a > command-line project with msbuild.exe in Debug and Release modes, > and I believe all flags from Reid's original patch. The original commit was reverted in r187640 after it broke the Mac build. This should now be fixed, by Clang r187668, LLVM r187675, and putting a -- before %s in the test. llvm-svn: 187679
* Convert last use of st_dev in clang.Rafael Espindola2013-08-021-6/+4
| | | | llvm-svn: 187654
* Revert r187537 "clang-cl: add more options"Hans Wennborg2013-08-021-3/+0
| | | | | | | | | It broke the "phase1 - sanity" buildbot. Reverting until we can figure out what's going on. And Eric says it broke all current Mac builds actually. llvm-svn: 187640
* clang-cl: add more optionsHans Wennborg2013-08-021-0/+3
| | | | | | | | | | | This adds a bunch of options to clang-cl. Notably, this includes all the options that get passed when doing a default build of a command-line project with msbuild.exe in Debug and Release modes, and I believe all flags from Reid's original patch. Differential Revision: http://llvm-reviews.chandlerc.com/D1264 llvm-svn: 187637
* Revert "If -fslp-vectorize or -fno-slp-vectorize are given, honor this ↵Rafael Espindola2013-08-011-17/+3
| | | | | | | | | | selection. If no flag is given, enable it for -O3." This reverts commit r187630. Looks like it is breaking the bots. llvm-svn: 187633
OpenPOWER on IntegriCloud