summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Tools.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [PowerPC] Support powerpc64le as a syntax-checking target.Bill Schmidt2013-07-261-3/+17
| | | | | | | | | | | | | | | | | | | 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. llvm-svn: 187180
* Options.td: fold the NoForward flag into DriverOptionHans Wennborg2013-07-251-1/+0
| | | | | | | | | 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 llvm-svn: 187168
* Don't forward all assembler arguments untouched to -cc1asDavid Blaikie2013-07-251-34/+39
| | | | | | | | | | | | | | 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. llvm-svn: 187156
* Simplify code - no functionality change.Eli Bendersky2013-07-241-15/+15
| | | | | | getToolChain().getTriple().getArch() can be replaced by getToolChain().getArch() llvm-svn: 187082
* Pass -fno-math-builtin from the Clang driver to -cc1 for the l32 arch.Eli Bendersky2013-07-241-0/+7
| | | | llvm-svn: 187061
* [mips] Add support for command-line options -mno-check-zero-division andAkira Hatanaka2013-07-191-0/+8
| | | | | | -mcheck-zero-division. llvm-svn: 186710
* [SystemZ] Add -march= command-line optionRichard Sandiford2013-07-191-2/+21
| | | | llvm-svn: 186694
* [SystemZ] Enable frame-pointer elimination for -O1 and aboveRichard Sandiford2013-07-191-4/+6
| | | | | | Copies the x86 behavior. llvm-svn: 186674
* Turn Driver::CCCIsCXX and CCCIsCPP into a single Mode enum,Hans Wennborg2013-07-181-19/+19
| | | | | | | | | | | | 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. llvm-svn: 186605
* Replacing an empty switch with its moral equivalent. No functional changes ↵Aaron Ballman2013-07-151-7/+3
| | | | | | intended. llvm-svn: 186318
* ObjC migrator: Add -objcmt-migrate-property to do propertyFariborz Jahanian2013-07-091-1/+4
| | | | | | | migration. Also, fixes an old bug where older migration flags were not being checked for properly. llvm-svn: 185948
* Fix PR16454: Don't #include altivec.h when preprocessing assembly.Bill Schmidt2013-07-031-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the -maltivec flag is present, altivec.h is auto-included for the compilation. This is not appropriate when the job action is to preprocess a file containing assembly code. So don't do that. I was unable to convert the test in the bug report into a regression test. The original symptom was exposed with: % touch x.S % ./bin/clang -target powerpc64-unknown-linux-gnu -maltivec -S -o - x.S I tried this test (and numerous variants) on a PPC64 system: ---------------------------------------------------------------------------- // RUN: touch %t // RUN: %clang -maltivec -S %t -o - | FileCheck %s // Verify that assembling an empty file does not auto-include altivec.h. // CHECK-NOT: static vector ---------------------------------------------------------------------------- However, this test passes for some reason even on a clang built without the fix. I'd be happy to add a test case but at this point I'm not able to figure one out, and I don't want to hold up the patch unnecessarily. Please let me know if you have ideas. Thanks, Bill llvm-svn: 185544
* Debug Info: set default to gdwarf-2 for Darwin.Manman Ren2013-07-021-2/+7
| | | | | | | | | | | | Darwin systems currently do not support dwarf version 3 or above. When we are ready, we can bump the default to gdwarf-4 for Darwin. For other systems, the default is dwarf version 3, if everything goes smoothly, we can bump the version to 4. rdar://13591116 llvm-svn: 185483
* Add support for passing v8fp options via -mfpu.Joey Gouly2013-06-271-0/+8
| | | | llvm-svn: 185075
* Add support for passing '-target armv8' through the Driver.Joey Gouly2013-06-261-0/+1
| | | | llvm-svn: 184970
* Don't use PathV1.h in Tools.cpp.Rafael Espindola2013-06-251-11/+7
| | | | llvm-svn: 184856
* Use the simpler version of llvm::sys::fs::exists.Rafael Espindola2013-06-251-8/+5
| | | | llvm-svn: 184855
* Use the new llvm::sys::EnvPathSeparator.Rafael Espindola2013-06-251-1/+2
| | | | llvm-svn: 184851
* Make -vectorize-... proper cc1 flags instead of abusing -backend-option. FixesNick Lewycky2013-06-251-10/+5
| | | | | | usage of clang as a library. llvm-svn: 184812
* [arcmt/driver] For the -ccc-arcmt-* flags, claim them when -fno-objc-arc is ↵Argyrios Kyrtzidis2013-06-241-0/+4
| | | | | | | | | | passed to avoid the "argument unused during compilation" warning. rdar://14240566 llvm-svn: 184776
* The profile library must come before the C library so that it can useChandler Carruth2013-06-241-2/+3
| | | | | | atexit. llvm-svn: 184708
* Fix the addition of Clang's profile runtime library to the link stepChandler Carruth2013-06-231-1/+19
| | | | | | | | | | | | | | | | | | when specifying --coverage (or related) flags. The system for doing this was based on the old LLVM-hosted profile_rt library, and hadn't been updated for Linux to use the new compiler-rt library. Also, it couldn't possibly work on multiarch or biarch systems in many cases. The whole thing now works much the same as the sanitizer libraries that are built and used out of the compiler-rt repo. Note that other target OSes haven't been updated because I don't know if they're doing anything special with the installation path of profile_rt. I suspect however that *all* of these are wrong and would encourage maintainers of each target to take a hard look at how compiler-rt runtime libraries are linked on their platforms. llvm-svn: 184666
* Fix typo in r184308.Richard Smith2013-06-201-1/+1
| | | | llvm-svn: 184391
* [Driver] Don't forward source file input args to gccReid Kleckner2013-06-191-1/+4
| | | | | | | | | | | | | | | | | | | gcc's inputs are already added by the InputInfoList passed to Action::ConstructJob. Fixes a regression from r183989. This was manifesting when targetting mingw as an extra input argument to gcc when assembling. It presumably affects other situations where clang calls gcc. Prior to r183989, forwardToGCC() was returning false because the INPUT option defined in OptParser.td had the DriverOption flag set on it. LLVM's Option library does not set this flag for INPUT. Reviewers: espindola Differential Revision: http://llvm-reviews.chandlerc.com/D999 llvm-svn: 184308
* Debug Info: support for gdwarf-2 gdwarf-3 gdwarf-4Manman Ren2013-06-191-0/+6
| | | | | | | | These options will add a module flag with name "Dwarf Version". The behavior flag is currently set to Warning, so when two values disagree, a warning will be emitted. llvm-svn: 184276
* Add support for -fpcc-struct-return. Patch by Arthur O'Dwyer!John McCall2013-06-181-0/+12
| | | | llvm-svn: 184166
* Accept and ignore -fdebug-types-section for now. This will be usedEric Christopher2013-06-181-0/+3
| | | | | | later with dwarf4 type hashing. llvm-svn: 184152
* Include PathV1.h only where it is used.Rafael Espindola2013-06-171-0/+1
| | | | llvm-svn: 184090
* [Driver] Refactor clang driver to use LLVM's Option libraryReid Kleckner2013-06-141-4/+5
| | | | | | | | | | | | | | | | | | The big changes are: - Deleting Driver/(Arg|Opt)* - Rewriting includes to llvm/Option/ and re-sorting - 'using namespace llvm::opt' in clang::driver - Fixing the autoconf build by adding option everywhere As discussed in the review, this change includes using directives in header files. I'll make follow up changes to remove those in favor of name specifiers. Reviewers: espindola Differential Revision: http://llvm-reviews.chandlerc.com/D975 llvm-svn: 183989
* Teach clang about the armv4/armv4t distinctionTim Northover2013-06-131-2/+5
| | | | | | | | | When choosing a default CPU, clang used to pick ARM7TDMI (which has Thumb) even when the more restrictive armv4 triple was specified. This should fix that. Patch by Jeroen Hofstee. llvm-svn: 183905
* When we're compiling with -pg make sure to link with gcrt1.o on linux. BeEric Christopher2013-06-071-1/+3
| | | | | | | | | | sure to do this always, this matches the behavior for the gcc driver. Fixes PR16251. Based on a patch by Qiao Yang. llvm-svn: 183591
* If we're splitting the dwarf for fission and don't want to use theEric Christopher2013-06-051-0/+8
| | | | | | | | | | integrated assembler then go ahead and still split the dwarf anyhow. Add two tests, one to exercise existing behavior of not splitting when we're just emitting assembly files and the other to test that we split when we're not in integrated as mode. llvm-svn: 183355
* Default to PIE and using stack protection on OpenBSD.Rafael Espindola2013-06-051-0/+3
| | | | | | Patch by Matthew Dempsky. llvm-svn: 183295
* Driver: implement --dyld-prefix option.Peter Collingbourne2013-05-271-30/+34
| | | | | | | | | This option is used to select a dynamic loader prefix to be used at runtime. Currently this is implemented for the Linux toolchain. Differential Revision: http://llvm-reviews.chandlerc.com/D851 llvm-svn: 182744
* Add -fsanitize=leak to driver options.Sergey Matveev2013-05-271-7/+27
| | | | | | | | If -fsanitize=leak is specified, link the program with the LeakSanitizer runtime. Ignore this option when -fsanitize=address is specified, because AddressSanitizer has this functionality built in. llvm-svn: 182729
* Add -lrt to sanitizer link arguments.Evgeniy Stepanov2013-05-241-0/+1
| | | | | | | | Sanitizer runtime intercepts functions from librt. Not doing this will fail if the librt dependency is not present at program startup (ex. comes from a dlopen()ed library). llvm-svn: 182645
* Fix a logic bug in the handling of -fmath-errno in the driver. We wouldChandler Carruth2013-05-181-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | imply -fno-math-errno if the user passed -fno-fast-math OR -ffast-math, regardless of in which order and regardless of the tool chain default. I've fixed this to follow the logic: 1) If the last dominating flag is -fno-math-errno, -ffast-math, or -Ofast, then do not use math-errno. 2) If the last dominating flag is an explicit -fmath-errno, do use math-errno. 3) Otherwise, use the toolchain default. This, for example, allows the flag sequence '-ffast-math ... -fno-fast-math' with no mention of '-fmath-errno' or '-fno-math-errno' to preserve the toolchain default. Most notably, this should prevent users trying to disable fast-math optimizations on Darwin and BSD platforms from simultaneously enabling (pointless) -fmath-errno. I've enhanced the tests (after more reorganization) to cover this and other weird permutations of flags and targets. llvm-svn: 182203
* [Mips] Add -mldc1-sdc1 / -mno-ldc1-sdc1 command line options.Simon Atanasyan2013-05-111-0/+8
| | | | llvm-svn: 181660
* C++1y: Add a step limit to constexpr evaluation, to catch runaway loops.Richard Smith2013-05-081-0/+5
| | | | llvm-svn: 181388
* Add SystemZ supportUlrich Weigand2013-05-061-1/+10
| | | | | | | | | | | | | | This patch then adds all the usual platform-specific pieces for SystemZ: driver support, basic target info, register names and constraints, ABI info and vararg support. It also adds new tests to verify pre-defined macros and inline asm, and updates a test for the minimum alignment change. This version of the patch incorporates feedback from reviews by Eric Christopher and John McCall. Thanks to all reviewers! Patch by Richard Sandiford. llvm-svn: 181211
* R600: Update GPU variants in -mcpu optionTom Stellard2013-05-061-3/+3
| | | | | | | | We've added the RS880 variant in the LLVM backend to represent an R600 GPU with no vertex cache, so we need to update the GPU mappings for -mcpu. llvm-svn: 181202
* [Mips] Pass -mips16, -mmicromips, -mdsp and -mdspr2 flags to theSimon Atanasyan2013-04-301-0/+6
| | | | | | assembler. llvm-svn: 180775
* Exit early when $PWD isn't set. Remove unused unistd.h include.Benjamin Kramer2013-04-271-4/+5
| | | | llvm-svn: 180670
* Use LLVM's preferred current_path API instead of calling getcwd(3) directly.Benjamin Kramer2013-04-271-5/+3
| | | | | | | The existing code also failed to allocate a buffer for it so getcwd corrupted the stack. sys::fs::current_path takes care of the memory management. llvm-svn: 180669
* [driver] Revert r180652 and 180658 and temporarily #define MAXPATHLEN toChad Rosier2013-04-271-2/+5
| | | | | | | | | | | make the gdb tests and the Windows bots happy. The Path::GetCurrentDirectory API is not equivalent to ::getcwd(), so r180652 causes a gdb tests to fail. On the other hand, <sys/param.h> isn't defined on Windows systems, so that causes Windows builds to fail. rdar://12237559 llvm-svn: 180661
* Fix the dangling pointer.Chad Rosier2013-04-271-2/+2
| | | | llvm-svn: 180658
* [driver] Use the llvm equivalent of getcwd(). Hopefully, this makes the WindowsChad Rosier2013-04-271-3/+2
| | | | | | | bots recover. rdar://12237559 llvm-svn: 180652
* [driver] Implement the -fdebug-compilation-dir in a way that is compatible withChad Rosier2013-04-261-8/+21
| | | | | | | gcc. No test case included as I'm having problems finding a test case where the inode/dev don't match. llvm-svn: 180628
* [driver] Put -fvectorize under the -Ofast umbrella flag.Chad Rosier2013-04-241-1/+6
| | | | | | Part of rdar://13622687 llvm-svn: 180206
* [driver] Improve the implementation of the -Ofast option.Chad Rosier2013-04-241-13/+33
| | | | | | | | | | | | Specifically, allow the flags that fall under this umbrella (i.e., -O3, -ffast-math, and -fstrict-aliasing) to be overridden/disabled with the individual -O[0|1|2|s|z]/-fno- flags. This also fixes the handling of various floating point optimization flags that are modified by -ffast-math (and thus -Ofast as well). Part of rdar://13622687 llvm-svn: 180204
OpenPOWER on IntegriCloud