summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
* Driver: tweak the code for determining default image nameHans Wennborg2015-01-091-6/+8
| | | | | | | | It seemed odd to have to make DefaultImageName be a mutable member of Driver. We don't need to the full result of computeTargetTriple() to determine the image name; just base it on DefaultTargetTriple. llvm-svn: 225530
* Driver: begin threading frontend support for SymbolRewriterSaleem Abdulrasool2015-01-091-0/+13
| | | | | | | | | | Allow blessed access to the symbol rewriter from the driver. Although the symbol rewriter could be invoked through tools like opt and llc, it would not accessible from the frontend. This allows us to read the rewrite map files in the frontend rather than the backend and enable symbol rewriting for actually performing the symbol interpositioning. llvm-svn: 225504
* R600: Handle amdgcn tripleTom Stellard2015-01-061-0/+2
| | | | | | For now there is no difference between amdgcn and r600. llvm-svn: 225294
* Set the default ISA for OpenBSD/mips64 to MIPS III.Brad Smith2015-01-061-0/+4
| | | | llvm-svn: 225241
* Allow -fsanitize-coverage=N with ubsan, clang partKostya Serebryany2015-01-061-2/+3
| | | | | | | | | | | | | | | | | | | | Summary: Allow -fsanitize-coverage=N with ubsan, clang part. This simply allows the flag combination. The LLVM will work out of the box, the compile-rt part will follow as a separate patch. Test Plan: check-clang Reviewers: samsonov Reviewed By: samsonov Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6849 llvm-svn: 225229
* Revert "Use the integrated assembler by default on 32-bit PowerPC and SPARC"Duncan P. N. Exon Smith2015-01-052-3/+27
| | | | | | | | | This reverts commit r225212. It's failing on multiple buildbots [1][2]. [1]: http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/22032 [2]: http://lab.llvm.org:8080/green/view/Clang/job/clang-stage1-cmake-RA-incremental_check/2357/ llvm-svn: 225221
* Use the integrated assembler by default on 32-bit PowerPC and SPARCBrad Smith2015-01-052-27/+3
| | | | llvm-svn: 225212
* Fix formatting. NFC.Rafael Espindola2015-01-051-6/+3
| | | | llvm-svn: 225168
* Fix default image name to 'a.exe' on Windows, instead 'a.out'.Yaron Keren2015-01-041-0/+2
| | | | | | This applies to mingw as clang-cl already has its own logic for the filename. llvm-svn: 225134
* Really don't warn about -flto/fno-lto :-(Rafael Espindola2015-01-031-8/+27
| | | | | | This should fix the last bots. llvm-svn: 225100
* Also avoid warning on -flto/-fno-lto on linux.Rafael Espindola2015-01-021-2/+7
| | | | | | | On OS X a .s file is preprocessed, it is not on linux, which is why the warning was still showing up on linux but not OS X. llvm-svn: 225095
* Don't warn on unused -fno-lto.Rafael Espindola2015-01-021-2/+3
| | | | | | | It is somewhat common for CFLAGS to be used with .s files. We were already ignoring -flto. This patch just does the same for -fno-lto. llvm-svn: 225093
* Driver: honour the clang-cl behaviour on ARM as wellSaleem Abdulrasool2015-01-021-3/+4
| | | | | | | | | | Unfortunately, MSVC does not indicate to the driver what target is being used. This means that we cannot correctly select the target architecture for the clang_rt component. This breaks down when targeting windows with the clang driver as opposed to the clang-cl driver. This should fix the native ARM buildbot tests. llvm-svn: 225089
* Driver: reuse getCompilerRT in place of addSanitizerRTWindowsSaleem Abdulrasool2015-01-021-16/+16
| | | | | | | | | | | The logic for addSanitizerRTWindows was performing the same logical operation as getCompilerRT, which was previously fully generalised for Linux and Windows. This avoids having a duplication of the logic for building up the name of a clang_rt component. This change does move the current limitation for Windows into getArchNameForCompilerRTLib, where it is assumed that the architecture for Windows is always i386. llvm-svn: 225087
* Driver: unify compiler-rt component selectionSaleem Abdulrasool2014-12-301-37/+28
| | | | | | | | | | | | | Unify the component handling for compiler-rt. The components are regularly named, built up from: ${LIBRARY_PREFIX}clang_rt.${component}-${arch}[-${environment}]${LIBRARY_SUFFIX} Unify the handling for all the various components, into a single path to link against the various components in a number of places. This reduces duplication of the clang_rt library name construction logic. llvm-svn: 225013
* Driver: whitespaceSaleem Abdulrasool2014-12-301-9/+7
| | | | | | Fixup some whitespace/style issues. NFC. llvm-svn: 225012
* Driver: use the canonical library prefix on WindowsSaleem Abdulrasool2014-12-301-1/+2
| | | | | | | | Unlike Unices, Windows does not use a library prefix. Use the traditional naming scheme even for Windows itanium environments. This makes the builtins behave more like the sanitisers as well. llvm-svn: 224996
* Driver: unify addClangRT{Linux,Windows}Saleem Abdulrasool2014-12-301-20/+16
| | | | | | | | The differences are pretty superficial: - .lib vs .a extensions - whether or not to link (potentially) incorrectly against libgcc_s llvm-svn: 224975
* Driver: convert a couple more instances to range based loopsSaleem Abdulrasool2014-12-291-6/+4
| | | | | | | More conversion to range based for loops rather than direct iterators with dereferencing. NFC. llvm-svn: 224954
* Driver: convert a number of loops to range basedSaleem Abdulrasool2014-12-291-33/+10
| | | | | | | Iterate over the arguments via range based for loops rather than iterators and explicitly dereferencing them. NFC. llvm-svn: 224944
* [multilib] Teach Clang's code about multilib by threadingChandler Carruth2014-12-291-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a CLANG_LIBDIR_SUFFIX down from the build system and using that as part of the default resource dir computation. Without this, essentially nothing that uses the clang driver works when building clang with a libdir suffix. This is probably the single biggest missing piece of support for multilib as without this people could hack clang to end up installed in the correct location, but it would then fail to find its own basic resources. I know of at least one distro that has some variation on this patch to hack around this; hopefully they'll be able to use the libdir suffix functionality directly as the rest of these bits land. This required fixing a copy of the code to compute Clang's resource directory that is buried inside of the frontend (!!!). It had bitrotted significantly relative to the driver code. I've made it essentially a clone of the driver code in order to keep tests (which use cc1 heavily) passing. This copy should probably just be removed and the frontend taught to always rely on an explicit resource directory from the driver, but that is a much more invasive change for another day. I've also updated one test which actually encoded the resource directory in its checked output to tolerate multilib suffixes. Note that this relies on a prior LLVM commit to add a stub to the autoconf build system for this variable. llvm-svn: 224924
* Add driver flags -ftrigraphs, -fno-trigraphs.Nico Weber2014-12-231-2/+5
| | | | | | | | | | | | | | | | | -trigraphs is now an alias for -ftrigraphs. -fno-trigraphs makes it possible to explicitly disable trigraphs, which couldn't be done before. clang -std=c++11 -fno-trigraphs now builds without GNU extensions, but with trigraphs disabled. Previously, trigraphs were only disabled in GNU modes or with -std=c++1z. Make the new -f flags the cc1 interface too. This requires changing -trigraphs to -ftrigraphs in a few cc1 tests. Related to PR21974. llvm-svn: 224790
* Reapply "Change -save-temps to emit unoptimized bitcode files."Bob Wilson2014-12-217-17/+76
| | | | | | | | | | | | | | | | | | | | | | | | This reapplies r224503 along with a fix for compiling Fortran by having the clang driver invoke gcc (see r224546, where it was reverted). I have added a testcase for that as well. Original commit message: It is often convenient to use -save-temps to collect the intermediate results of a compilation, e.g., when triaging a bug report. Besides the temporary files for preprocessed source and assembly code, this adds the unoptimized bitcode files as well. This adds a new BackendJobAction, which is mostly mechanical, to run after the CompileJobAction. When not using -save-temps, the BackendJobAction is combined into one job with the CompileJobAction, similar to the way the integrated assembler is handled. I've implemented this entirely as a driver change, so under the hood, it is just using -disable-llvm-optzns to get the unoptimized bitcode. Based in part on a patch by Steven Wu. rdar://problem/18909437 llvm-svn: 224688
* Driver: hoist an assertionSaleem Abdulrasool2014-12-191-10/+4
| | | | | | | Remove an unnecessary conditional, hoisting the assertion. Minor style tweaks/reflowing. NFC. llvm-svn: 224654
* Driver: refactor a local variableSaleem Abdulrasool2014-12-191-10/+10
| | | | | | | Pull out a getToolChain() into a local variable to share the call across to all the uses. NFC. llvm-svn: 224653
* Allow to disable all sanitizers with "-fno-sanitize=all" option.Alexey Samsonov2014-12-191-5/+14
| | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds "all" sanitizer group. A shortcut "-fno-sanitize=all" can be used to disable all sanitizers for a given source file. "-fsanitize=all" option makes no sense, and will produce an error. This group can also be useful when we add "-fsanitize-recover=<list>" options (patch in http://reviews.llvm.org/D6302), as it would allow to conveniently enable/disable recovery for all specified sanitizers. Test Plan: regression test suite Reviewers: kcc, rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6733 llvm-svn: 224596
* [Sanitizer] Get rid of parseArgument helper function. NFC.Alexey Samsonov2014-12-191-54/+43
| | | | llvm-svn: 224564
* Revert "Change -save-temps to emit unoptimized bitcode files."Reid Kleckner2014-12-186-60/+16
| | | | | | | | | | This reverts commit r224503. It broke compilation of fortran through the Clang driver. Previously `clang -c t.f` would invoke `gcc t.f` and `clang -cc1as`, but now it tries to call `clang -cc1 t.f` which fails for obvious reasons. llvm-svn: 224546
* Correction to -mfu=neon-vfpv4 to pass the correct backend feature nameRichard Barton2014-12-181-2/+2
| | | | | Change-Id: I4dbfe1d97670fc4e626368ef1f91fc008778dfca llvm-svn: 224523
* Change -save-temps to emit unoptimized bitcode files.Bob Wilson2014-12-186-16/+60
| | | | | | | | | | | | | | | | | | | It is often convenient to use -save-temps to collect the intermediate results of a compilation, e.g., when triaging a bug report. Besides the temporary files for preprocessed source and assembly code, this adds the unoptimized bitcode files as well. This adds a new BackendJobAction, which is mostly mechanical, to run after the CompileJobAction. When not using -save-temps, the BackendJobAction is combined into one job with the CompileJobAction, similar to the way the integrated assembler is handled. I've implemented this entirely as a driver change, so under the hood, it is just using -disable-llvm-optzns to get the unoptimized bitcode. Based in part on a patch by Steven Wu. rdar://problem/18909437 llvm-svn: 224503
* Reinstate aapcs as the default arm abi.Eric Christopher2014-12-181-3/+4
| | | | llvm-svn: 224490
* [sanitizer] allow -fsanitize-coverage=N w/ -fsanitize=leak, clang partKostya Serebryany2014-12-171-2/+2
| | | | llvm-svn: 224462
* Add a new flag, -fspell-checking-limit=<number> to control how many times ↵Nick Lewycky2014-12-161-1/+5
| | | | | | | | we'll do spell checking. Note that spell checking will change the produced AST, so we don't automatically change this value when someone sets -ferror-limit=. With this, merge test typo-correction-pt2.cpp into typo-correction.cpp. Remove Sema::UnqualifiedTyposCorrected, a cache of corrected typos. It would only cache typo corrections that didn't provide ValidateCandidate of which there were few left, and it had a bug when we had the same identifier spelled wrong twice. See the last two tests in typo-correction.cpp for cases this fires. llvm-svn: 224375
* Add a FIXME for unifying ARM target abi handling.Eric Christopher2014-12-101-0/+1
| | | | llvm-svn: 223977
* Revert the default changing behavior part of r216662 until weEric Christopher2014-12-101-4/+3
| | | | | | | | can change the backend to be the same default. Leave the modified/new testcases with the exception of the default behavior since it increases our testing footprint. llvm-svn: 223976
* Revert "Driver: Objective-C should respect -fno-exceptions"David Majnemer2014-12-091-14/+25
| | | | | | | | This reverts commit r223455. It's been succesfully argued that -fexceptions (at the driver level) is a misnomer and has little to do with -fobjc-exceptions. llvm-svn: 223723
* Driver: Objective-C should respect -fno-exceptionsDavid Majnemer2014-12-051-25/+14
| | | | | | | | | | | | Clang attempted to replicate a GCC bug: -fobjc-exceptions forces -fexceptions to be enabled. However, this has unintended effects and other awkard side effects that Clang doesn't "correctly" ape (e.g. it's impossible to turn off C++ exceptions in ObjC++ mode). Instead, -f[no]objc-exceptions and -f[no]cxx-exceptions now have an identical relationship with -f[no]exceptions. llvm-svn: 223455
* Driver: Cleanup -fexceptions behaviorDavid Majnemer2014-12-051-48/+15
| | | | | | | No functionality change is intended, just a cleanup of the logic clang uses to determine what -fexceptions/-fno-exceptions ends up doing. llvm-svn: 223453
* Use isOSBinFormatMachO() instead of comparing the object formatEric Christopher2014-12-052-3/+2
| | | | | | against an enum. llvm-svn: 223422
* Silence warning: "NOMINMAX" redefined.Yaron Keren2014-12-041-1/+3
| | | | llvm-svn: 223391
* [msan] allow -fsanitize-coverage=N together with -fsanitize=memory, clang partKostya Serebryany2014-12-031-1/+1
| | | | llvm-svn: 223311
* Remove special case for aarch64 static vs. PIC code in iOS kernel code.Bob Wilson2014-12-022-4/+2
| | | | | | | | | | I added this check a while back but then made a note to myself that it should be completely unnecessary since iOS always uses PIC code-gen for aarch64. Since I could never come up with any reason why it would be necessary, I'm just going to remove it and we'll see if anything breaks. rdar://problem/13627985 llvm-svn: 223097
* Make -fuse-ld=lld work properly on Windows.Zachary Turner2014-12-012-4/+23
| | | | | | | | | | | | Using lld on Windows requires calling link-lld.exe instead of lld.exe. This patch puts this knowledge into clang so that when using the GCC style clang driver, it can properly delegate to lld. Differential Revision: http://reviews.llvm.org/D6428 Reviewed by: Reid Kleckner, Rui Ueyama llvm-svn: 223086
* Add additional arguments for -mfpu optionsRichard Barton2014-11-281-0/+3
| | | | | | | | | Add neon-vfpv3 to allow specifying both at the same time. This is not an option that GCC supports, but follows the same track and should be non-controversial. Change-Id: Id9ec157c835937d7d11ad0f49dbe5171fac17658 llvm-svn: 222933
* Add -mfpu=neon-vfpv4Richard Barton2014-11-281-0/+3
| | | | | | | This enables user to architecturally specify ARMv7A + VFPv4 + NEON. Change-Id: I779b01fef5c47e5e4ac702ae24ed2f76a0e4c63f llvm-svn: 222932
* clang: do not add -pie for tsanDmitry Vyukov2014-11-212-5/+5
| | | | | | | | | Revision 220571 removes the requirement to use -pie for tsan binaries. So remove -pie from driver. Also s/hasZeroBaseShadow/requiresPIE/ because that is what it is used for. Msan does not have zero-based shadow, but requires pie. And in general the relation between zero-based shadow and pie is unclear. http://reviews.llvm.org/D6318 llvm-svn: 222526
* Driver: correct typoSaleem Abdulrasool2014-11-191-1/+1
| | | | | | Fix a typo in the search path identified by Justin Bogner. llvm-svn: 222371
* Update for LLVM API changeDavid Blaikie2014-11-191-1/+1
| | | | llvm-svn: 222303
* clang-cl: Allow /Fo without an argument (PR21589)Hans Wennborg2014-11-171-15/+4
| | | | | | | | | | When it's used without an argument, the default file name is used. The same goes for /Fe. Also, allow using /Fo, /Fa and /Fe with multiple inputs if they don't have an argument. llvm-svn: 222164
* [Sanitizer] Parse and produce all sanitizer-relevant arguments in SanitizerArgs.Alexey Samsonov2014-11-162-61/+61
| | | | | | | | | | | | | In particular, make SanitizerArgs responsible for parsing and passing down to frontend -fsanitize-recover and -fsanitize-undefined-trap-on-error flags. Simplify parsing -f(no-)sanitize= flags parsing: get rid of too complex filterUnsupportedKinds function. No functionality change. llvm-svn: 222105
OpenPOWER on IntegriCloud