summaryrefslogtreecommitdiff
path: root/lib/Driver/Tools.cpp
Commit message (Collapse)AuthorAge
...
* Add the -ffixed-r9 flag for ARM.Renato Golin2013-08-24
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189174 91177308-0d34-0410-b5e6-96231b3b80d8
* Move -mfpmath handling to -cc1 and implement it for x86.Rafael Espindola2013-08-21
| | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188939 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the logic for selecting the last feature in the command line to the driver.Rafael Espindola2013-08-21
| | | | | | | This is a partial revert of r188817 now that the driver handles -target-feature in a single place. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188910 91177308-0d34-0410-b5e6-96231b3b80d8
* Centralize the handling of -target-feature.Rafael Espindola2013-08-21
| | | | | | | No functionality change other than changing the order of -target-feature relative to other -cc1 command line arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188906 91177308-0d34-0410-b5e6-96231b3b80d8
* Centralize the handling of -target-cpu (-cc1, -cc1as) and -mcpu (gold plugin).Rafael Espindola2013-08-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188837 91177308-0d34-0410-b5e6-96231b3b80d8
* Centralize the logic for handling -m* options and fix pr16943.Rafael Espindola2013-08-20
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188817 91177308-0d34-0410-b5e6-96231b3b80d8
* clang/Driver: [PR12920] Don't forward any -W arguments to gcc-as and gcc-ld.NAKAMURA Takumi2013-08-19
| | | | | | | | | 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? git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188668 91177308-0d34-0410-b5e6-96231b3b80d8
* Move SanitizerArgs to the clang DriverAlexey Samsonov2013-08-19
| | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188660 91177308-0d34-0410-b5e6-96231b3b80d8
* make arm-use-movt available for all ARMRenato Golin2013-08-15
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188488 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver: Forward -Wl, and -Xlink arguments when using windows linkerHans Wennborg2013-08-14
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D1394 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188346 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-cl: Support /link option and set target to win32Hans Wennborg2013-08-13
| | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188331 91177308-0d34-0410-b5e6-96231b3b80d8
* Link in the ubsan runtime when building shared objects.Nick Lewycky2013-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188325 91177308-0d34-0410-b5e6-96231b3b80d8
* Move logic to enable the vectorizer to clangArnold Schwaighofer2013-08-13
| | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188280 91177308-0d34-0410-b5e6-96231b3b80d8
* Add XCore targetRobert Lytton2013-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188258 91177308-0d34-0410-b5e6-96231b3b80d8
* [Mips] MSA frontend option supportJack Carter2013-08-12
| | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188184 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify now that llvm::sys::current_path checks $PWD.Rafael Espindola2013-08-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188128 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-cl: Don't pass /defaultlib to the linkerHans Wennborg2013-08-09
| | | | | | | Since r187945, clang-cl will add the runtime library dependency to the .obj file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188086 91177308-0d34-0410-b5e6-96231b3b80d8
* Make SanitizerArgs parsing toolchain-independentAlexey Samsonov2013-08-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188058 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-cl: Support /showIncludesHans Wennborg2013-08-09
| | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188037 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-cl: use MS C++ ABIHans Wennborg2013-08-08
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D1329 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188000 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "clang-cl: Hook up /Za to prevent adding oldnames.lib dependency"Reid Kleckner2013-08-08
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187998 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-cl: Hook up /Za to prevent adding oldnames.lib dependencyHans Wennborg2013-08-08
| | | | | | | | The /Za flag should probably do more, but let's start with this. Differential Revision: http://llvm-reviews.chandlerc.com/D1320 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187991 91177308-0d34-0410-b5e6-96231b3b80d8
* Move SanitizerArgs implementation from .h to .cppAlexey Samsonov2013-08-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187972 91177308-0d34-0410-b5e6-96231b3b80d8
* The only useful loop unrolling flag to give realistically isChandler Carruth2013-08-08
| | | | | | | | | | | | | | | | | | | | | | | | '-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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187969 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-cl: Support the run-time selection options (/MD, /MT et al.)Hans Wennborg2013-08-08
| | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187945 91177308-0d34-0410-b5e6-96231b3b80d8
* DataFlowSanitizer; Clang changes.Peter Collingbourne2013-08-07
| | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187925 91177308-0d34-0410-b5e6-96231b3b80d8
* Add option to disable module loading.Daniel Jasper2013-08-05
| | | | | | | This patch was created by Lawrence Crowl and reviewed in: http://llvm-reviews.chandlerc.com/D963 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187738 91177308-0d34-0410-b5e6-96231b3b80d8
* Only use the Darwin linker's -export_dynamic option with supported versions.Bob Wilson2013-08-02
| | | | | | Related to <rdar://problem/14578094>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187680 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-commit r187637: "clang-cl: add more options"Hans Wennborg2013-08-02
| | | | | | | | | | | | | | > 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187679 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert last use of st_dev in clang.Rafael Espindola2013-08-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187654 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r187537 "clang-cl: add more options"Hans Wennborg2013-08-02
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187640 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-cl: add more optionsHans Wennborg2013-08-02
| | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187637 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "If -fslp-vectorize or -fno-slp-vectorize are given, honor this ↵Rafael Espindola2013-08-01
| | | | | | | | | | selection. If no flag is given, enable it for -O3." This reverts commit r187630. Looks like it is breaking the bots. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187633 91177308-0d34-0410-b5e6-96231b3b80d8
* If -fslp-vectorize or -fno-slp-vectorize are given, honor this selection. If ↵Nadav Rotem2013-08-01
| | | | | | no flag is given, enable it for -O3. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187630 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable the SLP-vectorizer by defaultNadav Rotem2013-08-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187596 91177308-0d34-0410-b5e6-96231b3b80d8
* Options: Use AliasArgs for -O -> -O2 translation.Hans Wennborg2013-08-01
| | | | | | This way we can do the translation in the .td file rather than manually. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187583 91177308-0d34-0410-b5e6-96231b3b80d8
* AArch64: initial NEON supportTim Northover2013-08-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch by Ana Pazos - Completed implementation of instruction formats: AdvSIMD three same AdvSIMD modified immediate AdvSIMD scalar pairwise - Completed implementation of instruction classes (some of the instructions in these classes belong to yet unfinished instruction formats): Vector Arithmetic Vector Immediate Vector Pairwise Arithmetic - Initial implementation of instruction formats: AdvSIMD scalar two-reg misc AdvSIMD scalar three same - Intial implementation of instruction class: Scalar Arithmetic - Initial clang changes to support arm v8 intrinsics. Note: no clang changes for scalar intrinsics function name mangling yet. - Comprehensive test cases for added instructions To verify auto codegen, encoding, decoding, diagnosis, intrinsics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187568 91177308-0d34-0410-b5e6-96231b3b80d8
* Make -m[no-]pascal-strings an alias of -f[no]pascal-strings in the .td fileHans Wennborg2013-07-31
| | | | | | | | This way we don't have to translate it manually in Clang::ConstructJob. Differential Revision: http://llvm-reviews.chandlerc.com/D1249 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187547 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a comment.Hans Wennborg2013-07-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187502 91177308-0d34-0410-b5e6-96231b3b80d8
* [PowerPC] Support powerpc64le as a syntax-checking target.Bill Schmidt2013-07-26
| | | | | | | | | | | | | | | | | | | | This patch provides basic support for powerpc64le as an LLVM target. However, use of this target will not actually generate little-endian code. Instead, use of the target will cause the correct little-endian built-in defines to be generated, so that code that tests for __LITTLE_ENDIAN__, for example, will be correctly parsed for syntax-only testing. Code generation will otherwise be the same as powerpc64 (big-endian), for now. The patch leaves open the possibility of creating a little-endian PowerPC64 back end, but there is no immediate intent to create such a thing. The new test case variant ensures that correct built-in defines for little-endian code are generated. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187180 91177308-0d34-0410-b5e6-96231b3b80d8
* Options.td: fold the NoForward flag into DriverOptionHans Wennborg2013-07-25
| | | | | | | | | They seemed to have the same implications, and this makes for one less flag to worry about. Differential Revision: http://llvm-reviews.chandlerc.com/D1219 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187168 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't forward all assembler arguments untouched to -cc1asDavid Blaikie2013-07-25
| | | | | | | | | | | | | | Use the same filtering for assembly arguments to -cc1as as we do for -cc1, this allows a consistent (& more useful) diagnostic experience for users (rather than getting an error from -cc1as (which a user shouldn't really be thinking about) about --foo, they get an error from clang about --foo in -Wa,) I'm sort of surprised by the separation of -cc1as & the separate argument handling, etc, but at least this removes a little bit of the duplication. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187156 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify code - no functionality change.Eli Bendersky2013-07-24
| | | | | | | | getToolChain().getTriple().getArch() can be replaced by getToolChain().getArch() git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187082 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass -fno-math-builtin from the Clang driver to -cc1 for the l32 arch.Eli Bendersky2013-07-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187061 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Add support for command-line options -mno-check-zero-division andAkira Hatanaka2013-07-19
| | | | | | | | -mcheck-zero-division. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186710 91177308-0d34-0410-b5e6-96231b3b80d8
* [SystemZ] Add -march= command-line optionRichard Sandiford2013-07-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186694 91177308-0d34-0410-b5e6-96231b3b80d8
* [SystemZ] Enable frame-pointer elimination for -O1 and aboveRichard Sandiford2013-07-19
| | | | | | | Copies the x86 behavior. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186674 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn Driver::CCCIsCXX and CCCIsCPP into a single Mode enum,Hans Wennborg2013-07-18
| | | | | | | | | | | | and add a new option --driver-mode= to control it explicitly. The CCCIsCXX and CCCIsCPP flags were non-overlapping, i.e. there are currently really three modes that Clang can run in: gcc, g++ or cpp, so it makes sense to represent them as an enum. Having a command line flag to control it helps testing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186605 91177308-0d34-0410-b5e6-96231b3b80d8
* Replacing an empty switch with its moral equivalent. No functional changes ↵Aaron Ballman2013-07-15
| | | | | | intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186318 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjC migrator: Add -objcmt-migrate-property to do propertyFariborz Jahanian2013-07-09
| | | | | | | | migration. Also, fixes an old bug where older migration flags were not being checked for properly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185948 91177308-0d34-0410-b5e6-96231b3b80d8