summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
* Restructure the propagation of -fPIC/-fPIE.Rafael Espindola2016-06-231-4/+2
| | | | | | | | | | | | | The PIC and PIE levels are not independent. In fact, if PIE is defined it is always the same as PIC. This is clear in the driver where ParsePICArgs returns a PIC level and a IsPIE boolean. Unfortunately that is currently lost and we pass two redundant levels down the pipeline. This patch keeps a bool and a PIC level all the way down to codegen. llvm-svn: 273566
* Fixing a FIXME related to Unicode support on Windows. Converted the Win32 ↵Aaron Ballman2016-06-231-18/+27
| | | | | | | | APIs to explicitly use the W version when it involves strings that can hold non-ASCII characters (like file paths). Now explicitly using the A version for strings that will always be ASCII (like registry key paths). No extra tests required as this is currently covered by existing testing, and this is basically impossible to write Unicode-specific tests for. llvm-svn: 273563
* [driver][mips] Factor out findMIPSMultilibs code into separate functions. NFCSimon Atanasyan2016-06-221-189/+185
| | | | | | | | The findMIPSMultilibs is too long. One more reason for splitting is to escape redundant calls of MultilibSet::FilterOut method which lead to disk access. llvm-svn: 273465
* Add support for /Ob1 and -finline-hint-functions flagsHans Wennborg2016-06-222-1/+2
| | | | | | | | | | | | | | | | Add support for /Ob1 (and equivalent -finline-hint-functions), which enable inlining only for functions marked inline, either explicitly (via inline keyword, for example), or implicitly (function definition in class body, for example). This works by enabling inlining pass, and adding noinline attribute to every function not marked inline. Patch by Rudy Pons <rudy.pons@ilod.org>! Differential Revision: http://reviews.llvm.org/D20647 llvm-svn: 273440
* Add a ENABLE_X86_RELAX_RELOCATIONS cmake option.Rafael Espindola2016-06-201-1/+1
| | | | | | This corresponds to binutils' --enable-x86-relax-relocations. llvm-svn: 273224
* [X86] Add -mno-iamcu option.Andrey Turetskiy2016-06-202-22/+27
| | | | | | | | | | Add -mno-iamcu option to: 1) Countervail -miamcu option easily 2) Be compatible with GCC which supports this option Differential Revision: http://reviews.llvm.org/D21469 llvm-svn: 273147
* Driver: introduce and use `-isystem-after` for cross-windowsSaleem Abdulrasool2016-06-172-0/+9
| | | | | | | | | | | | | | This mirrors the many other -i*after options to insert a new system search directory at the end of the search path. This makes it possible to actually inject a search path after the resource dir. This option is similar in spirit to the /imsvc option in the clang-cl driver. This is needed to properly use the driver for Windows targets where the clang headers wrap some of the system headers. This concept is actually useful on other targets (e.g. Linux) and would be really easy to support on the core toolchain. llvm-svn: 273016
* [Driver] Adapt Linux::GCCVersion::Parse to match GCC 5 installationsBryan Chan2016-06-171-0/+3
| | | | | | | | | | | | | | | | | Summary: Some GCC 5 installations store the libstdc++ includes and GCC-specific files in paths without the minor part of the version number, such as /usr/include/c++/5 /usr/lib64/gcc/x86_64-suse-linux/5 Reviewers: cfe-commits, thiagomacieira, jroelofs Subscribers: tinti, jroelofs Differential Revision: http://reviews.llvm.org/D14727 llvm-svn: 273012
* Compilation for Intel MCU (Part 3/3)Andrey Turetskiy2016-06-161-14/+33
| | | | | | | | | | | | | This is the last patch required to support compilation for Intel MCU target (e.g. Intel(R) Quark(TM) micro controller D 2000). When IAMCU triple is used: * Use IAMCU linker output format * Link with IAMCU crt objects * Link with IAMCU libraries Differential Revision: http://reviews.llvm.org/D20675 llvm-svn: 272885
* Compilation for Intel MCU (Part 2/3)Andrey Turetskiy2016-06-165-13/+46
| | | | | | | | | | | | This is the second patch required to support compilation for Intel MCU target (e.g. Intel(R) Quark(TM) micro controller D 2000). When IAMCU triple is used: * Recognize and use IAMCU GCC toolchain * Set up include paths * Forbid C++ Differential Revision: http://reviews.llvm.org/D19274 llvm-svn: 272883
* [CUDA] Don't pass top-level -march down to device cc1 or ptxas.Justin Lebar2016-06-151-1/+3
| | | | | | | | | | | | | | | | | | Summary: Previously if you did e.g. $ clang -march=haswell -x cuda foo.cu we would pass "-march=haswell -march=sm_20" down to the ptxas tool. This causes it to assert, and rightly so! Reviewers: tra Subscribers: cfe-commits, echristo Differential Revision: http://reviews.llvm.org/D21419 llvm-svn: 272857
* Fix linking of DFSan + coverage.Evgeniy Stepanov2016-06-151-1/+1
| | | | | | Broken in r272717 because of no test coverage. llvm-svn: 272853
* Add support to clang-cl driver for /GS switchEtienne Bergeron2016-06-151-0/+13
| | | | | | | | | | | | | | | | | | | Summary: This patch is adding command-line support for the MSVC buffer security check. The buffer security check is turned on with the '/GS' compiler switch. https://msdn.microsoft.com/en-us/library/8dbf701c.aspx The MSVC buffer security check in implemented here: http://reviews.llvm.org/D20346 Reviewers: hans, rnk Subscribers: chrisha, cfe-commits, rnk, hans, thakis Differential Revision: http://reviews.llvm.org/D20347 llvm-svn: 272832
* Fix sanitizer coverage support in the win32 driver.Evgeniy Stepanov2016-06-141-22/+22
| | | | | | | --dependent-lib arguments for the sanitizer libraries must be emitted when coverage is enabled w/o any sanitizers. llvm-svn: 272735
* [sanitizer] Allow sanitize coverage w/o sanitizers.Evgeniy Stepanov2016-06-141-9/+8
| | | | | | | The reason is that this (a) seems to work just fine and (b) useful when building stuff with sanitizer+coverage, but need to exclude the sanitizer for a particular source file. llvm-svn: 272717
* Start adding support for Musl.Rafael Espindola2016-06-141-0/+2
| | | | | | | | | | | The two patches together enable clang to support targets like "x86_64-pc-linux-musl" and build binaries against musl-libc instead of glibc. This make it easy for clang to work on some musl-based systems like Alpine Linux and certain flavors of Gentoo. Patch by Lei Zhang. llvm-svn: 272662
* [CUDA][OpenMP] Create generic offload toolchainsSamuel Antao2016-06-133-21/+39
| | | | | | | | | | | | | | | | | | | Summary: This patch introduces the concept of offloading tool chain and offloading kind. Each tool chain may have associated an offloading kind that marks it as used in a given programming model that requires offloading. It also adds the logic to iterate on the tool chains based on the kind. Currently, only CUDA is supported, but in general a programming model (an offloading kind) may have associated multiple tool chains that require supporting offloading. This patch does not add tests - its goal is to keep the existing functionality. This patch is the first of a series of three that attempts to make the current support of CUDA more generic and easier to extend to other programming models, namely OpenMP. It tries to capture the suggestions/improvements/concerns on the initial proposal in http://lists.llvm.org/pipermail/cfe-dev/2016-February/047547.html. It only tackles the more consensual part of the proposal, i.e.does not address the problem of intermediate files bundling yet. Reviewers: ABataev, jlebar, echristo, hfinkel, tra Subscribers: guansong, Hahnfeld, andreybokhanko, tcramer, mkuron, cfe-commits, arpith-jacob, carlo.bertolli, caomhin Differential Revision: http://reviews.llvm.org/D18170 llvm-svn: 272571
* Revert "Strip Android version when looking up toolchain paths."Chandler Carruth2016-06-111-9/+1
| | | | | | | This reverts commit r272413. The tests here have been failing on several different build bots for over 10 hours. llvm-svn: 272454
* Driver: make it easier to select the SjLj EH modelSaleem Abdulrasool2016-06-101-1/+2
| | | | | | | | | | | GCC still permits enabling the SjLj EH model. This is something which can be done on various targets. Hoist the -fsjlj-exceptions option into the driver and pass it through. This allows one to opt into the alternative EH model while retaining the default to be the target's default. Resolves PR27749! llvm-svn: 272424
* Strip Android version when looking up toolchain paths.Josh Gao2016-06-101-1/+9
| | | | | | | | | | | | | | | | Summary: Android target triples can include a version number in the abi field (e.g. 'aarch64-linux-android21'), used for checking for availability. However, the driver was searching for toolchain binaries using the passed in triple as a prefix. Reviewers: srhines, danalbert, t.p.northover Subscribers: t.p.northover, aemerson, tberghammer, danalbert, srhines, cfe-commits Differential Revision: http://reviews.llvm.org/D21163 llvm-svn: 272413
* This patch fixes target linker emulation for ARM 32 big endian.Strahinja Petrovic2016-06-101-1/+1
| | | | llvm-svn: 272402
* Add a RenderScript language typePirama Arumuga Nainar2016-06-091-0/+1
| | | | | | | | | | | | | | | | | Summary: Add RenderScript language type and associate it with ".rs" extensions. Test that the driver passes "-x renderscript" to the frontend for ".rs" files. (Also add '.rs' to the list of suffixes tested by lit). Reviewers: rsmith Subscribers: cfe-commits, srhines Differential Revision: http://reviews.llvm.org/D21199 llvm-svn: 272317
* [mips] The default ABI depends on the CPU not the Arch on MTI and IMG vendor ↵Daniel Sanders2016-06-061-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | triples. Summary: 32-bit CPU's default to O32. 64-bit CPU's default to N64. The default CPU (mips32r2/mips64r2) still depends on the arch so there's no functional change when the CPU isn't specified but commands like: clang -target mips-mti-linux-gnu -mips64r2 will now default to a 64-bit ABI like our gcc toolchains do* instead of asserting in the backend**. Other vendors (including Triple::UnknownVendor) still derive the default ABI from the arch. * Although not the same one as our gcc toolchains, clang has historically defaulted to N64 where gcc defaults to N32. ** Mixing O32 and a 64-bit CPU causing assertions is a long-standing bug. Reviewers: atanasyan Subscribers: sdardis, cfe-commits Differential Revision: http://reviews.llvm.org/D21016 llvm-svn: 271884
* Add PIE magic for NetBSD. Add tests for the correct flags forJoerg Sonnenberger2016-06-041-9/+10
| | | | | | non-shared, PIE and shared output mode. llvm-svn: 271801
* Don't pass --build-id to ld by default.Rafael Espindola2016-06-031-4/+3
| | | | | | | | | | | | We now have a cmake option to change the default: ENABLE_LINKER_BUILD_ID. The reason is that build-id is fairly expensive, so we shouldn't impose it in the regular edit/build cycle. This is similar to gcc, that has an off by default --enable-linker-build-id option. llvm-svn: 271692
* RAS extensions are part of ARMv8.2.Sjoerd Meijer2016-06-031-0/+2
| | | | | | | | | | This patch enables +ras +noras to AArch64 in clang. Patch by: Roger Ferrer Ibanez and Oliver Stannard Differential Revision: http://reviews.llvm.org/D20283 llvm-svn: 271672
* This adds target support and tests for Cortex-A73Sjoerd Meijer2016-06-021-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D20864 llvm-svn: 271507
* [asan] Added -fsanitize-address-use-after-scope flagVitaly Buka2016-06-021-0/+11
| | | | | | | | | | | | | | | | Summary: Also emit lifetime markers for -fsanitize-address-use-after-scope. Asan uses life-time markers for use-after-scope check. PR27453 Reviewers: kcc, eugenis, aizatsky Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D20759 llvm-svn: 271451
* [driver][arm] add armv7 and thumb include and lib pathsChih-Hung Hsieh2016-06-011-1/+51
| | | | | | | | | | | Add a new test android-ndk-standalone.cpp with new Android NDK release tree structure. Detect armv7 sub architecture and thumb mode, to add system include and link search paths. Differential Revision: http://reviews.llvm.org/D20600 llvm-svn: 271427
* [AMDGPU] Set default dwarf version to 2Konstantin Zhuravlyov2016-05-311-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D20640 llvm-svn: 271347
* Handle -Wa,--mrelax-relocations=[no|yes].Rafael Espindola2016-05-291-0/+10
| | | | llvm-svn: 271162
* [driver][mips] Fix local variable naming. NFCSimon Atanasyan2016-05-281-6/+6
| | | | llvm-svn: 271110
* [driver][mips] Revert support for CodeSourcery MIPS toolchainSimon Atanasyan2016-05-281-4/+66
| | | | | | This is revert of r270366. The support for CS toolchain were dropped too early. llvm-svn: 271109
* [Driver] Fix driver support for color diagnosticsBruno Cardoso Lopes2016-05-271-28/+12
| | | | | | | | | | | | | | | | Diagnostics that happen during driver time do not have color output support unless -fcolor-diagonostic is explicitly passed into the driver. This is not a problem for cc1 since dianostic arguments are properly handled and color is enabled by default if the terminal supports it. Make the driver behave like CC1. There are tests that already check for these flags, but for the color itself there's no sensible way to test it. Differential Revision: http://reviews.llvm.org/D20404 rdar://problem/26290980 llvm-svn: 271042
* [mips] Compact branch policy setting.Simon Dardis2016-05-272-0/+22
| | | | | | | | | | | | | | This patch adds the commandline option -mcompact-branches={never,optimal,always), which controls how LLVM generates compact branches for MIPSR6 targets. By default, the compact branch policy is 'optimal' where LLVM will generate the most appropriate branch for any situation. The 'never' and 'always' policy will disable or always generate compact branches wherever possible respectfully. Reviewers: dsanders, vkalintiris, atanasyan Differential Revision: http://reviews.llvm.org/D20729 llvm-svn: 271000
* [mips] Kill 'support' for untested EABI.Daniel Sanders2016-05-271-1/+1
| | | | | | | | | | | | | | | | | Summary: There are no llvm backend tests* for EABI and no EABI buildbots. There were only three clang tests, all of which checked that -mabi=eabi was passed to the assembler. *There is a single backend test that specifies EABI but it actually tests MIPS16. Reviewers: atanasyan Subscribers: emaste, sdardis, atanasyan, cfe-commits Differential Revision: http://reviews.llvm.org/D20679 llvm-svn: 270998
* Apply clang-tidy's misc-move-constructor-init throughout Clang.Benjamin Kramer2016-05-271-3/+4
| | | | | | No functionality change intended, maybe a tiny performance improvement. llvm-svn: 270996
* Turn copies into references as suggested by clang-tidy's ↵Benjamin Kramer2016-05-271-1/+1
| | | | | | performance-unnecessary-copy-initialization. llvm-svn: 270994
* [OPENMP] Fixed processing of '-fopenmp-version=' option and test.Alexey Bataev2016-05-271-1/+1
| | | | llvm-svn: 270962
* [AMDGPU] Remove individual debugger options + update featuresKonstantin Zhuravlyov2016-05-261-1/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D20336 llvm-svn: 270895
* [OPENMP] Add option '-fopenmp-version=[31|40|45]' allowing choosingAlexey Bataev2016-05-261-1/+3
| | | | | | | | | | OpenMP version. If '-fopenmp' option is provided '-fopenmp-version=' allows to control, which version of OpenMP must be supported. Currently it affects only the value of _OPENMP define. llvm-svn: 270838
* Revert "[AArch64] Using new TargetParser in Clang"Renato Golin2016-05-251-15/+39
| | | | | | | | This reverts commit r270688 and r270689. The issue is not a random order, but a different order for some targets and others (prob. Linux vs Darwin). Reverting until we have a better fix. llvm-svn: 270691
* [AArch64] Using new TargetParser in ClangRenato Golin2016-05-251-39/+15
| | | | | | | | | | Using AArch64TargetParser in clang to avoid repetitive string parsing. Use TargetParser to do ARCH/CPU/ArchExt parsing instead of local implementation. Patch by Jojo Ma. llvm-svn: 270688
* clang-cl: Fix unused argument warning when combining /O2 and /Ob2Hans Wennborg2016-05-251-1/+6
| | | | llvm-svn: 270642
* clang-cl: Bake /Ob0 and /Ob2 into the general /O option handlingHans Wennborg2016-05-241-1/+13
| | | | | | | This is a follow-up to r270609, wherein I forgot that /O options can be combined, and e.g. /Odb2 is a valid combination. llvm-svn: 270614
* [Driver] Add support for -finline-functions and /Ob2 flagsHans Wennborg2016-05-241-2/+3
| | | | | | | | | | | | | | | | | | -finline-functions and /Ob2 are currently ignored by Clang. The only way to enable inlining is to use the global O flags, which also enable other options, or to emit LLVM bitcode using Clang, then running opt by hand with the inline pass. This patch allows to simply use the -finline-functions flag (same as GCC) or /Ob2 in clang-cl mode to enable inlining without other optimizations. This is the first patch of a serie to improve support for the /Ob flags. Patch by Rudy Pons <rudy.pons@ilod.org>! Differential Revision: http://reviews.llvm.org/D20576 llvm-svn: 270609
* [Sparc] Add software float option -msoft-floatJacob Baungard Hansen2016-05-242-15/+69
| | | | | | | | | | | | | | | 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
* [CUDA] Add -fcuda-approx-transcendentals flag.Justin Lebar2016-05-231-0/+4
| | | | | | | | | | | | | | Summary: This lets us emit e.g. sin.approx.f32. See http://docs.nvidia.com/cuda/parallel-thread-execution/#floating-point-instructions-sin Reviewers: rnk Subscribers: tra, cfe-commits Differential Revision: http://reviews.llvm.org/D20493 llvm-svn: 270484
* Test commitJacob Baungard Hansen2016-05-231-0/+1
| | | | llvm-svn: 270435
* Driver: support exherbo's multiarch supportSaleem Abdulrasool2016-05-231-26/+59
| | | | | | | | Exherbo has an alternative file system layout to accommodate multiarch. The loader is located at /usr/${triple}/lib/${loader}. Adjust the Linux toolchain to support that on exherbo. llvm-svn: 270392
OpenPOWER on IntegriCloud