aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Driver/Tools.cpp
AgeCommit message (Collapse)AuthorFilesLines
2016-05-24[Sparc] Add software float option -msoft-floatJacob Baungard Hansen1-15/+59
Summary: Following patch D19265 which enable software floating point support in the Sparc backend, this patch enables the option to be enabled in the front-end using the -msoft-float option. The user should ensure a library (such as the builtins from Compiler-RT) that includes the software floating point routines is provided. Reviewers: jyknight, lero_chris Subscribers: jyknight, cfe-commits Differential Revision: http://reviews.llvm.org/D20419 llvm-svn: 270538
2016-05-23Test commitJacob Baungard Hansen1-0/+1
llvm-svn: 270435
2016-05-22Driver: sink getLinuxDynamicLoader into the ToolchainSaleem Abdulrasool1-70/+1
The parameter already requires the toolchain, sink the method into the class. This also enables the use of the distro detection logic which will be needed to support Exherbo's multiarch approach. llvm-svn: 270352
2016-05-22Driver: simplify getDynameLinkerSaleem Abdulrasool1-47/+49
Convert the cascading if/else to a switch. This makes it easier to follow the logic. Minor difference is that we no longer default to x86_64 but rather to the architecture specified by the architecture. llvm-svn: 270351
2016-05-18Update for llvm change.Rafael Espindola1-2/+0
llvm-svn: 269989
2016-05-18[Mips] Finetuning MIPS32 Android default variantsPetar Jovanovic1-3/+18
MIPS32 Android defaults to FPXX ("-fpxx"). MIPS32R6 Android defaults to FP64A ("-mfp64 -mno-odd-spreg"). Differential Revision: http://reviews.llvm.org/D20345 llvm-svn: 269914
2016-05-18Support for MSVS default calling convention options (/Gd, /Gz, /Gv,Alexey Bataev1-1/+10
/Gr), by Alexander Makarov Patch for bug #27711 Differential Revision: http://reviews.llvm.org/D20171 llvm-svn: 269891
2016-05-17[Mips] Set mips32 as default CPU for MIPS32 AndroidPetar Jovanovic1-1/+3
Change default CPU for MIPS32 Android. Now it is mips32 (rev1). Differential Revision: http://reviews.llvm.org/D20313 llvm-svn: 269754
2016-05-16[PS4] Change the names of some "environmental" things to what ourPaul Robinson1-4/+4
licensees actually see in the toolchain we deliver to them. This will reduce the set of local patches we have to maintain. The triple is not changing. (The term ORBIS is an internal code name for PS4.) llvm-svn: 269671
2016-05-13Get default -fms-compatibility-version from cl.exe's versionAdrian McCarthy1-4/+10
-fms-compatibility-version was defaulting to 18 (VS 2013), which is a pain if your environment is pointing to version 19 (VS 2015) libraries. If cl.exe can be found, this patch uses its version number as the default instead. It re-uses the existing code to find the Visual Studio binaries folder and WinAPI methods to check its version. You can still explicitly specify a compatibility version on the command line. If you don't have cl.exe, this should be a no-op and you'll get the old default of 18. This affected the tests, which assumed that if you didn't specific a version, that it would default to 18, but this won't be true for all machines. So a couple test cases had to be eliminated and a couple others had to be tweaked to allow for various outputs. Addresses: https://llvm.org/bugs/show_bug.cgi?id=27215 Differential Revision: http://reviews.llvm.org/D20136 llvm-svn: 269515
2016-05-13Simplify getLinuxDynamicLinker() by using a common variable for the triple. NFC.Vasileios Kalintiris1-13/+12
llvm-svn: 269412
2016-05-13[mips] Consult triple's vendor field before using musl's interpreter.Vasileios Kalintiris1-1/+3
This should affect only the mips-mti-linux toolchain. llvm-svn: 269411
2016-05-12[ubsan] Add -fsanitize-undefined-strip-path-components=NFilipe Cabecinhas1-0/+4
Summary: This option allows the user to control how much of the file name is emitted by UBSan. Tuning this option allows one to save space in the resulting binary, which is helpful for restricted execution environments. With a positive N, UBSan skips the first N path components. With a negative N, UBSan only keeps the last N path components. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19666 llvm-svn: 269309
2016-05-12[Driver] Squash misleading indentation warning.Marcin Koscielnicki1-6/+6
llvm-svn: 269279
2016-05-11Embed bitcode in object file (clang cc1 part)Steven Wu1-3/+9
Summary: Teach clang to embed bitcode inside bitcode. When -fembed-bitcode cc1 option is used, clang will embed both the input bitcode and cc1 commandline into the bitcode in special sections before compiling to the object file. Using -fembed-bitcode-marker will only introduce a marker in both sections. Depends on D17390 Reviewers: rsmith Subscribers: yaron.keren, vsk, cfe-commits Differential Revision: http://reviews.llvm.org/D17392 llvm-svn: 269202
2016-05-09[Power9] Enable -mcpu=pwr9 (-mcpu=power9) in the front endNemanja Ivanovic1-0/+2
This patch corresponds to review: http://reviews.llvm.org/D19684 It simply adds the handling for the option and the corresponding macros. llvm-svn: 268951
2016-05-05AMDGPU: Use lld as the linker againTom Stellard1-0/+2
Summary: Now that LLVM is emitting version 2 of the AMD code object, we can start using lld again for linking instead of our custom tool. Reviewers: arsenm, kzhuravl Subscribers: rafael, cfe-commits Differential Revision: http://reviews.llvm.org/D19952 llvm-svn: 268648
2016-05-04[SystemZ] Add -mbackchain option.Marcin Koscielnicki1-0/+10
This option, like the corresponding gcc option, is SystemZ-specific and enables storing frame backchain links, as specified in the ABI. Differential Revision: http://reviews.llvm.org/D19891 llvm-svn: 268575
2016-05-02Revert "[Driver] Quote clang full version in dwarf producer when invoking cc1as"Bruno Cardoso Lopes1-2/+1
This reverts commit r264813 / 6484b95d634f53dd929c75265ef3c4decf397584. While using it in the shell is fine, this a problem when cc1as is invoked directly by the driver because single quoting the clang full version makes cc1as write out the version with the quotes in the final binary. If the user wants to copy-n-pastable output, it could use either -### or CC_PRINT_OPTIONS=1 clang -v ... llvm-svn: 268297
2016-04-28Re-apply r267784, r267824 and r267830.Peter Collingbourne1-26/+13
I have updated the compiler-rt tests. llvm-svn: 267903
2016-04-28Revert r267784, r267824 and r267830.Benjamin Kramer1-13/+26
It makes compiler-rt tests fail if the gold plugin is enabled. Revert "Rework interface for bitset-using features to use a notion of LTO visibility." Revert "Driver: only produce CFI -fvisibility= error when compiling." Revert "clang/test/CodeGenCXX/cfi-blacklist.cpp: Exclude ms targets. They would be non-cfi." llvm-svn: 267871
2016-04-27Rework interface for bitset-using features to use a notion of LTO visibility.Peter Collingbourne1-26/+13
Bitsets, and the compiler features they rely on (vtable opt, CFI), only have visibility within the LTO'd part of the linkage unit. Therefore, only enable these features for classes with hidden LTO visibility. This notion is based on object file visibility or (on Windows) dllimport/dllexport attributes. We provide the [[clang::lto_visibility_public]] attribute to override the compiler's LTO visibility inference in cases where the class is defined in the non-LTO'd part of the linkage unit, or where the ABI supports calling classes derived from abstract base classes with hidden visibility in other linkage units (e.g. COM on Windows). If the cross-DSO CFI mode is enabled, bitset checks are emitted even for classes with public LTO visibility, as that mode uses a separate mechanism to cause bitsets to be exported. This mechanism replaces the whole-program-vtables blacklist, so remove the -fwhole-program-vtables-blacklist flag. Because __declspec(uuid()) now implies [[clang::lto_visibility_public]], the support for the special attr:uuid blacklist entry is removed. Differential Revision: http://reviews.llvm.org/D18635 llvm-svn: 267784
2016-04-21[esan] EfficiencySanitizer driver flagsDerek Bruening1-0/+2
Summary: Adds a framework to enable the instrumentation pass for the new EfficiencySanitizer ("esan") family of tools. Adds a flag for esan's cache fragmentation tool via -fsanitize=efficiency-cache-frag. Adds appropriate tests for the new flag. Reviewers: eugenis, vitalybuka, aizatsky, filcab Subscribers: filcab, kubabrecka, llvm-commits, zhaoqin, kcc Differential Revision: http://reviews.llvm.org/D19169 llvm-svn: 267059
2016-04-21Compilation for Intel MCU (Part 1/3)Andrey Turetskiy1-0/+7
Add -miamcu option which: * Sets IAMCU triple * Sets IAMCU ABI * Enforces static compilation Differential Revision: http://reviews.llvm.org/D18398 llvm-svn: 266972
2016-04-19Fix PR26999 better- RenderDebugEnablingArgs() once onlyDouglas Katzman1-22/+22
llvm-svn: 266797
2016-04-19Pass dwarf-version to cc1as.Douglas Katzman1-0/+6
Fix PR26999 - crashing in cc1as with any '*bsd' target. llvm-svn: 266775
2016-04-19Revert r266747 (Compilation for Intel MCU (Part 1/3)) since it breaks a few ↵Andrey Turetskiy1-7/+0
buildbots. llvm-svn: 266753
2016-04-19Compilation for Intel MCU (Part 1/3)Andrey Turetskiy1-0/+7
Add -miamcu option which: * Sets IAMCU triple * Sets IAMCU ABI * Enforces static compilation Differential Revision: http://reviews.llvm.org/D18398 llvm-svn: 266747
2016-04-19[CUDA] Add --no-cuda-noopt-debug, which disables --cuda-noopt-debug.Justin Lebar1-1/+2
Reviewers: tra Subscribers: cfe-commits, jhen Differential Revision: http://reviews.llvm.org/D19251 llvm-svn: 266708
2016-04-13ARM: make Darwin's "-arch armv7em" default to hard-float.Tim Northover1-1/+6
We've already paid the price for separate "armv7m" and "armv7em" slices (support in other tools), it's silly to make them identical other than the default CPU. rdar://23055688 llvm-svn: 266211
2016-04-12[AMDGPU] Add debugger related target optionsKonstantin Zhuravlyov1-0/+20
Differential Revision: http://reviews.llvm.org/D18748 llvm-svn: 266133
2016-04-12Always use --eh-frame-hdr on FreeBSD, even for -staticEd Maste1-1/+1
FreeBSD uses LLVM's libunwind on FreeBSD/arm64 today (and is expected to use it more widely in the future), and it requires the EH frame segment in static binaries. This is the same as r203742 for NetBSD. Differential Revision: http://reviews.llvm.org/D19029 llvm-svn: 266123
2016-04-11Allow simultaneous safestack and stackprotector attributes.Evgeniy Stepanov1-9/+4
This is the clang part of http://reviews.llvm.org/D18846. SafeStack instrumentation pass adds stack protector canaries if both attributes are present on a function. StackProtector pass will step back if the function has a safestack attribute. llvm-svn: 266005
2016-04-06Enable PIE for CloudABI.Ed Schouten1-0/+6
As we're currently working on making CloudABI executables easier to emulate in userspace (e.g., on OS X and Windows), it makes a whole lot of sense to build these using PIE. By using PIE, they can simply be loaded into the existing process address space without clashes. PIE support got added to CloudABI's C library and seems to work pretty well. CloudABI does not make use of an ld.so, so the binary's _start() has all the logic in it to do the relocations. Now that all but one bug in LLD relating to PIE support have been squashed (and a patch for that is already in code review), I'd like to go ahead and force the use of PIE for Clang 3.9. When released, we'll also switch over to using LLD exclusively. llvm-svn: 265546
2016-04-05Add -fno-jump-tables and-fjump-tables flagsNirav Dave1-0/+4
Add no-jump-tables flag to disable use of jump tables when lowering switch statements Reviewers: echristo, hans Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D18407 llvm-svn: 265425
2016-04-02clang-cl: Don't skip i_group flags other than -include when building pchs.Nico Weber1-1/+2
Before this change, e.g. -isystem flags in front of the /FI corresponding to the pch file would be incorrectly ignored. llvm-svn: 265238
2016-03-31[DarwinDriver] Increase the number of valid digits for ld64 version string.Bruno Cardoso Lopes1-5/+2
Previously only 3 digits were valid. Increase it to 5. Differential Revision: http://reviews.llvm.org/D18304 rdar://problem/24843016 llvm-svn: 264987
2016-03-30[Driver] Quote clang full version in dwarf producer when invoking cc1asBruno Cardoso Lopes1-1/+2
Convenience to allow easy copy-n-paste from clang -v output when reproducing cc1as comandline. rdar://problem/23959295 llvm-svn: 264813
2016-03-29[CUDA] Remove three obsolete CUDA cc1 flags.Justin Lebar1-2/+0
Summary: * -fcuda-target-overloads Previously unconditionally set to true by the driver. Necessary for correct functioning of the compiler -- our CUDA headers wrapper won't compile without this. * -fcuda-disable-target-call-checks Previously unconditionally set to true by the driver. Necessary to compile almost any external CUDA code -- almost all libraries assume that host+device code can call host or device functions. * -fcuda-allow-host-calls-from-host-device No effect when target overloading is enabled. Reviewers: tra Subscribers: rsmith, cfe-commits Differential Revision: http://reviews.llvm.org/D18416 llvm-svn: 264739
2016-03-29[AMDGPU] Switch linker to amdphdrs + update testKonstantin Zhuravlyov1-1/+0
Differential Revision: http://reviews.llvm.org/D18253 llvm-svn: 264737
2016-03-28[lanai] Add Lanai backend to clang driver.Jacques Pienaar1-0/+37
Changes to clang to add Lanai backend. Adds a new target, ABI and toolchain. General Lanai backend discussion on llvm-dev thread "[RFC] Lanai backend" (http://lists.llvm.org/pipermail/llvm-dev/2016-February/095118.html). Differential Revision: http://reviews.llvm.org/D17002 llvm-svn: 264655
2016-03-24Modules builds are necessarily compile actions, but they don'tEric Christopher1-1/+1
necessarily produce object files. Turn off split dwarf if we're not producing a file that the driver believes is an object file. llvm-svn: 264227
2016-03-23clang-cl: Add a FIXME for bumping the default msc version.Nico Weber1-0/+1
llvm-svn: 264216
2016-03-23clang-cl: Add more tests for the interaction of /FI and /Yc /Yu.Nico Weber1-2/+4
Most things even work; see the included FIXMEs for things that need polishing. Also don't warn about unused flags for the `/Yuh2.h /FIh1.h /FIh2.h`. The common case is that the pch was built with `/Ych2.h /FIh1.h /FIh2.h`, so h1.h is in the PCH, and we shouldn't warn about /FIh1.h not having an effect. (If we wanted to get fancy, we could store the list of -include flags in the pch and then check that it matches later on.) llvm-svn: 264178
2016-03-21Revert r263974, "clang-cl: With -fmsc-version=1900, use MSVS2015 diag ↵NAKAMURA Takumi1-1/+0
formatting." It seems the test wouldn't expect if default target is *-win32. llvm-svn: 264007
2016-03-21Revert "Convert some ObjC msgSends to runtime calls."Pete Cooper1-12/+0
This reverts commit r263607. This change caused more objc_retain/objc_release calls in the IR but those are then incorrectly optimized by the ARC optimizer. Work is going to have to be done to ensure the ARC optimizer doesn't optimize user written RR, but that should land before this change. This change will also need to be updated to take account for any changes required to ensure that user written calls to RR are distinct from those inserted by ARC. llvm-svn: 263984
2016-03-21clang-cl: With -fmsc-version=1900, use MSVS2015 diag formatting.Nico Weber1-0/+1
llvm-svn: 263974
2016-03-21[modules] Don't invent a module cache path unless implicit module builds are ↵Richard Smith1-22/+20
enabled. llvm-svn: 263970
2016-03-17Minor code cleanups. NFC.Junmo Park1-1/+1
llvm-svn: 263694
2016-03-16Convert some ObjC msgSends to runtime calls.Pete Cooper1-0/+12
It is faster to directly call the ObjC runtime for methods such as retain/release instead of sending a message to those functions. This patch adds support for converting messages to retain/release/alloc/autorelease to their equivalent runtime calls. Tests included for the positive case of applying this transformation, negative tests that we ensure we only convert "alloc" to objc_alloc, not "alloc2", and also a driver test to ensure we enable this only for supported runtime versions. Reviewed by John McCall. Differential Revision: http://reviews.llvm.org/D14737 llvm-svn: 263607