summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
...
* [XRay][clang] Introduce -fxray-always-emit-customeventsDean Michael Berris2017-11-301-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The -fxray-always-emit-customevents flag instructs clang to always emit the LLVM IR for calls to the `__xray_customevent(...)` built-in function. The default behaviour currently respects whether the function has an `[[clang::xray_never_instrument]]` attribute, and thus not lower the appropriate IR code for the custom event built-in. This change allows users calling through to the `__xray_customevent(...)` built-in to always see those calls lowered to the corresponding LLVM IR to lay down instrumentation points for these custom event calls. Using this flag enables us to emit even just the user-provided custom events even while never instrumenting the start/end of the function where they appear. This is useful in cases where "phase markers" using __xray_customevent(...) can have very few instructions, must never be instrumented when entered/exited. Reviewers: rnk, dblaikie, kpw Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40601 llvm-svn: 319388
* Reformat switch statement added in r319297, NFCReid Kleckner2017-11-291-12/+12
| | | | llvm-svn: 319364
* [Driver] Turns out the GNU assembler does support falkor/saphira.Chad Rosier2017-11-291-3/+1
| | | | llvm-svn: 319323
* Fix function call to fix buildIsmail Donmez2017-11-291-1/+1
| | | | | | | | | ../tools/clang/lib/Driver/ToolChains/Cuda.cpp:80:18: error: reference to non-static member function must be called; did you mean to call it with no arguments? if (Distro(D.getVFS).IsDebian()) ~~^~~~~~ () llvm-svn: 319322
* Follow up of r319317, add the missing header fileSylvestre Ledru2017-11-291-0/+1
| | | | llvm-svn: 319319
* Add the nvidia-cuda-toolkit Debian package path to search pathSylvestre Ledru2017-11-291-0/+5
| | | | | | | | | | | | | | | | | | | Summary: Reported here: http://bugs.debian.org/882505 Patch by Andreas Beckmann Reviewers: Hahnfeld, tra Reviewed By: tra Subscribers: jlebar, cfe-commits Differential Revision: https://reviews.llvm.org/D40453 llvm-svn: 319317
* Toolchain: Normalize dwarf, sjlj and seh ehMartell Malone2017-11-2910-19/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a re-apply of r319294. adds -fseh-exceptions and -fdwarf-exceptions flags clang will check if the user has specified an exception model flag, in the absense of specifying the exception model clang will then check the driver default and append the model flag for that target to cc1 -fno-exceptions has a higher priority then specifying the model move __SEH__ macro definitions out of Targets into InitPreprocessor behind the -fseh-exceptions flag move __ARM_DWARF_EH__ macrodefinitions out of verious targets and into InitPreprocessor behind the -fdwarf-exceptions flag and arm|thumb check remove unused USESEHExceptions from the MinGW Driver fold USESjLjExceptions into a new GetExceptionModel function that gives the toolchain classes more flexibility with eh models Reviewers: rnk, mstorsjo Differential Revision: https://reviews.llvm.org/D39673 llvm-svn: 319297
* Revert "Toolchain: Normalize dwarf, sjlj and seh eh"Martell Malone2017-11-2910-75/+20
| | | | | | | | This reverts rL319294. The windows sanitizer does not like seh on x86. Will re apply with None type for x86 llvm-svn: 319295
* Toolchain: Normalize dwarf, sjlj and seh ehMartell Malone2017-11-2910-20/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | adds -fseh-exceptions and -fdwarf-exceptions flags clang will check if the user has specified an exception model flag, in the absense of specifying the exception model clang will then check the driver default and append the model flag for that target to cc1 clang cc1 assumes dwarf is the default if none is passed and -fno-exceptions has a higher priority then specifying the model move __SEH__ macro definitions out of Targets into InitPreprocessor behind the -fseh-exceptions flag move __ARM_DWARF_EH__ macrodefinitions out of verious targets and into InitPreprocessor behind the -fdwarf-exceptions flag and arm|thumb check remove unused USESEHExceptions from the MinGW Driver fold USESjLjExceptions into a new GetExceptionModel function that gives the toolchain classes more flexibility with eh models Reviewers: rnk, mstorsjo Differential Revision: https://reviews.llvm.org/D39673 llvm-svn: 319294
* [WebAssemby] Enable "-mthread-model single" by default, for now.Dan Gohman2017-11-272-0/+9
| | | | | | | | | | | | | The WebAssembly standard does not yet have threads, and while it's in the process of being standardized, it'll take some time for it to make it through and be available in all popular implementations. With increasing numbers of people using the LLVM wasm backend through LLVM directly rather than through Emscripten, it's increasingly important to have friendly defaults. See also https://bugs.llvm.org/show_bug.cgi?id=35411 llvm-svn: 319101
* Switch CPU names not recognized by GNU assemblerPirama Arumuga Nainar2017-11-271-10/+21
| | | | | | | | | | | | | | | | Summary: Switch CPU names not recognized by GNU assembler to a close CPU that it does recognize. In this patch, kryo, falkor and saphira all get replaced by cortex-a57 when invoking the assembler. In addition, krait was already being replaced by cortex-a15. Reviewers: weimingz Subscribers: srhines, cfe-commits Differential Revision: https://reviews.llvm.org/D40476 llvm-svn: 319077
* Enable additonal features in NetBSDKamil Rytarowski2017-11-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Enable for x86_64: - ESan, - KASan, - MSan. Enable for x86_64 and i386: - Scudo. These features are under active development and in various level of completeness. Sponsored by <The NetBSD Foundation> Reviewers: dvyukov, joerg, vitalybuka, eugenis Reviewed By: eugenis Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40456 llvm-svn: 319007
* [Driver] Make the use of relax relocations a per target optionPetr Hosek2017-11-223-1/+6
| | | | | | | | | | | | | The support for relax relocations is dependent on the linker and different toolchains within the same compiler can be using different linkers some of which may or may not support relax relocations. Give toolchains the option to control whether they want to use relax relocations in addition to the existing (global) build system option. Differential Revision: https://reviews.llvm.org/D39831 llvm-svn: 318816
* Add -finstrument-function-entry-bare flagHans Wennborg2017-11-211-2/+5
| | | | | | | | | | | | | | | | | This is an instrumentation flag that's similar to -finstrument-functions, but it only inserts calls on function entry, the calls are inserted post-inlining, and they don't take any arugments. This is intended for users who want to instrument function entry with minimal overhead. (-pg would be another alternative, but forces frame pointer emission and affects link flags, so is probably best left alone to be used for generating gcov data.) Differential revision: https://reviews.llvm.org/D40276 llvm-svn: 318785
* [OpenMP] Consistently use cubin extension for nvlinkJonas Hahnfeld2017-11-214-18/+39
| | | | | | | | | | | | This was previously done in some places, but for example not for bundling so that single object compilation with -c failed. In addition cubin was used for all file types during unbundling which is incorrect for assembly files that are passed to ptxas. Tighten up the tests so that we can't regress in that area. Differential Revision: https://reviews.llvm.org/D40250 llvm-svn: 318763
* Revert r318669/318694Erich Keane2017-11-203-16/+1
| | | | | | Broke some libclang tests, so reverting for now. llvm-svn: 318698
* [AutoComplete] Use stronger sort predicate for autocomplete candidates to ↵Mandeep Singh Grang2017-11-201-1/+5
| | | | | | | | | | | | | | | | | | remove non-deterministic ordering Summary: This fixes the failure in test/Driver/autocomplete.c uncovered by D39245. Reviewers: yamaguchi, teemperor, ruiu Reviewed By: yamaguchi, ruiu Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D40234 llvm-svn: 318681
* For Linux/gnu compatibility, preinclude <stdc-predef.h> if the file is availableErich Keane2017-11-203-1/+16
| | | | | | | | | | | | | | | | | | | | | | As reported in llvm bugzilla 32377. Here’s a patch to add preinclude of stdc-predef.h. The gcc documentation says “On GNU/Linux, <stdc-predef.h> is pre-included.” See https://gcc.gnu.org/gcc-4.8/porting_to.html; The preinclude is inhibited with –ffreestanding. Basically I fixed the failing test cases by adding –ffreestanding which inhibits this behavior. I fixed all the failing tests, including some in extra/test, there's a separate patch for that which is linked here Patch By: mibintc Differential Revision: https://reviews.llvm.org/D34158 llvm-svn: 318669
* [ARM] For assembler files recognize -Xassembler or -Wa, -mthumbPeter Smith2017-11-201-1/+1
| | | | | | Attempt to fix warning picked up by buildbot. llvm-svn: 318648
* [ARM] For assembler files recognize -Xassembler or -Wa, -mthumbPeter Smith2017-11-202-5/+33
| | | | | | | | | | | | | | | | | | | | | | The Unified Arm Assembler Language is designed so that the majority of assembler files can be assembled for both Arm and Thumb with the choice made as a compilation option. The way this is done in gcc is to pass -mthumb to the assembler with either -Wa,-mthumb or -Xassembler -mthumb. This change adds support for these options to clang. There is no assembler equivalent of -mno-thumb, -marm or -mno-arm so we don't need to recognize these. Ideally we would do all of the processing in CollectArgsForIntegratedAssembler(). Unfortunately we need to change the triple and at that point it is too late. Instead we look for the option earlier in ComputeLLVMTriple(). Fixes PR34519 Differential Revision: https://reviews.llvm.org/D40127 llvm-svn: 318647
* Driver: remove `SupportsObjCGC` (NFC)Saleem Abdulrasool2017-11-196-12/+0
| | | | | | This option is not used in the frontend. Remove the method. llvm-svn: 318609
* [Driver] add initial support for alpine linuxMartell Malone2017-11-192-3/+11
| | | | | | | | | | | | set -pie as default for musl linux targets add detection of alpine linux append appropriate compile flags for alpine Reviewers: rnk Differential Revision: https://reviews.llvm.org/D39588 llvm-svn: 318608
* Switch -mcount and -finstrument-functions to emit EnterExitInstrumenter ↵Hans Wennborg2017-11-141-1/+2
| | | | | | | | | | | | | | | | attributes This updates -mcount to use the new attribute names (LLVM r318195), and switches over -finstrument-functions to also use these attributes rather than inserting instrumentation in the frontend. It also adds a new flag, -finstrument-functions-after-inlining, which makes the cygprofile instrumentation get inserted after inlining rather than before. Differential Revision: https://reviews.llvm.org/D39331 llvm-svn: 318199
* Update a link to the old code.google.com bug trackerHans Wennborg2017-11-131-1/+1
| | | | llvm-svn: 318109
* [clang] Remove redundant return [NFC]Mandeep Singh Grang2017-11-131-2/+0
| | | | | | | | | | | | | | Reviewers: rsmith, sfantao, mcrosier Reviewed By: mcrosier Subscribers: jholewinski, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D39915 llvm-svn: 318074
* Add CLANG_DEFAULT_OBJCOPY to allow Clang to use llvm-objcopy for dwarf fissionJake Ehrlich2017-11-111-1/+2
| | | | | | | | | | | | llvm-objcopy is getting to where it can be used in non-trivial ways (such as for dwarf fission in clang). It now supports dwarf fission but this feature hasn't been thoroughly tested yet. This change allows people to optionally build clang to use llvm-objcopy rather than GNU objcopy. By default GNU objcopy is still used so nothing should change. Differential Revision: https://reviews.llvm.org/D39029 llvm-svn: 317960
* AMDGPU/NFC: Move getAMDGPUTargetFeatures to AMDGPU toolchainKonstantin Zhuravlyov2017-11-103-19/+24
| | | | | | Differential Revision: https://reviews.llvm.org/D39877 llvm-svn: 317909
* Revert "[XRay][darwin] Initial XRay in Darwin Support"Dean Michael Berris2017-11-102-15/+0
| | | | | | This reverts r317875. llvm-svn: 317877
* [XRay][darwin] Initial XRay in Darwin SupportDean Michael Berris2017-11-102-0/+15
| | | | | | | | | | | | | | | | | | | | | | Summary: This change implements the changes required in both clang and compiler-rt to allow building XRay-instrumented binaries in Darwin. For now we limit this to x86_64. We also start building the XRay runtime library in compiler-rt for osx. A caveat to this is that we don't have the tests set up and running yet, which we'll do in a set of follow-on changes. This patch uses the monorepo layout for the coordinated change across multiple projects. Reviewers: kubamracek Subscribers: mgorny, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D39114 llvm-svn: 317875
* [Driver] Make clang/cc conforms to UNIX standardSteven Wu2017-11-101-6/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is basically reverting r261774 with a tweak for clang-cl. UNIX standard states: When c99 encounters a compilation error that causes an object file not to be created, it shall write a diagnostic to standard error and continue to compile other source code operands, but it shall not perform the link phase and it shall return a non-zero exit status The same goes for c89 or cc. And they are all alias or shims pointing to clang on Darwin. The original commit was intended for CUDA so the error message doesn't get emit twice for both host and device. It seems that the clang driver has been changed to model the CUDA dependency differently. Now the driver behaves the same without this commit. rdar://problem/32223263 Reviewers: thakis, dexonsmith, tra Reviewed By: tra Subscribers: jlebar, cfe-commits Differential Revision: https://reviews.llvm.org/D39502 llvm-svn: 317860
* New clang option -fno-plt which avoids the PLT and lazy binding while making ↵Sriraman Tallam2017-11-071-0/+4
| | | | | | | | external calls. Differential Revision: https://reviews.llvm.org/D39079 llvm-svn: 317605
* Vary Windows toolchain selection by -fuse-ldDave Lee2017-11-061-1/+7
| | | | | | | | | | | | | | | | | Summary: This change allows binutils to be used for linking with MSVC. Currently, when using an MSVC target and `-fuse-ld=bfd`, the driver produces an invalid linker invocation. Reviewers: rnk, compnerd Reviewed By: compnerd Subscribers: smeenai, cfe-commits Differential Revision: https://reviews.llvm.org/D39509 llvm-svn: 317511
* [Driver] MinGW: Remove custom linker detectionMartell Malone2017-11-041-10/+2
| | | | | | | | | | | | | | | | | | This is a re-apply of rL313082 which was reverted in rL313088 In rL289668 the ability to specify the default linker at compile time was added but because the MinGW driver used custom detection we could not take advantage of this new CMAKE flag CLANG_DEFAULT_LINKER. rL289668 added no test cases and the mingw driver was either overlooked or purposefully skipped because it has some custom linker tests Removing them here because they are covered by the generic case. Reviewers: rnk Differntial Revision: https://reviews.llvm.org/D37727 llvm-svn: 317397
* [Driver] Add Scudo as a possible -fsanitize= optionKostya Kortchinsky2017-11-033-16/+20
| | | | | | | | | | | | | | | | | | | | | | Summary: This change adds Scudo as a possible Sanitizer option via -fsanitize=. This allows for easier static & shared linking of the Scudo library, it allows us to enforce PIE (otherwise the security of the allocator is moot), and check for incompatible Sanitizers combo. In its current form, Scudo is not compatible with any other Sanitizer, but the plan is to make it work in conjunction with UBsan (-fsanitize=scudo,undefined), which will require additional work outside of the scope of this change. Reviewers: eugenis, kcc, alekseyshl Reviewed By: eugenis, alekseyshl Subscribers: llvm-commits, srhines Differential Revision: https://reviews.llvm.org/D39334 llvm-svn: 317337
* [CUDA] Mark CUDA as a no-errno platform.Justin Lebar2017-11-031-0/+1
| | | | | | | | | | | | | | | | | | | | Summary: CUDA doesn't support errno at all, so this is the right thing -- or at least, in the right direction. But also, this unbreaks the CUDA test-suite math tests [0] after D39481. __cuda_cmath.h forwards nexttoward() to __builtin_nexttoward, which, after that patch, was lowering to a libcall that doesn't exist in NVPTX. [0] http://lab.llvm.org:8011/builders/clang-cuda-build/builds/14999 Reviewers: tra Subscribers: sanjoy, cfe-commits Differential Revision: https://reviews.llvm.org/D39586 llvm-svn: 317297
* Add default calling convention support for regcall.Erich Keane2017-11-021-1/+6
| | | | | | | | | | | Added support for regcall as default calling convention. Also added code to exclude main when applying default calling conventions. Patch-By: eandrews Differential Revision: https://reviews.llvm.org/D39210 llvm-svn: 317268
* [CFI] Add CFI-icall pointer type generalizationVlad Tsyrklevich2017-10-311-0/+10
| | | | | | | | | | | | | | | | | | | | | | | Summary: This change allows generalizing pointers in type signatures used for cfi-icall by enabling the -fsanitize-cfi-icall-generalize-pointers flag. This works by 1) emitting an additional generalized type signature metadata node for functions and 2) llvm.type.test()ing for the generalized type for translation units with the flag specified. This flag is incompatible with -fsanitize-cfi-cross-dso because it would require emitting twice as many type hashes which would increase artifact size. Reviewers: pcc, eugenis Reviewed By: pcc Subscribers: kcc Differential Revision: https://reviews.llvm.org/D39358 llvm-svn: 317044
* Driver: default to `unsigned int` `wchar_t` for ARMSaleem Abdulrasool2017-10-291-1/+6
| | | | | | | | | | AAPCS and AAPCS64 mandate that `wchar_t` with `-fno-short-wchar` is an `unsigned int` rather than a `signed int`. Ensure that the driver does not flip the signedness of `wchar_t` for those targets. Add additional tests to ensure that this does not regress. llvm-svn: 316858
* [WebAssembly] Add crt1.o with calling lldSam Clegg2017-10-272-8/+9
| | | | | | | | | Also, for OS unknown targets like wasm, don't include 'unknown' in the library path. This is a fix for rL316719. Differential Revision: https://reviews.llvm.org/D39354 llvm-svn: 316777
* [WebAssembly] Include libclang_rt.builtins in the standard waySam Clegg2017-10-273-11/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D39218 llvm-svn: 316719
* Use -fuse-init-array if no gcc installation is found.Nico Weber2017-10-261-1/+2
| | | | | | | | | | | | | | | | clang currently uses .init_array instead of .ctors on Linux if it detects gcc 4.7+. Make it so that it also uses .init_array if no gcc installation is found at all – if there's no old gcc, there's nothing we need to be compatible with. icecc for example runs clang in a very small chroot, so before this change clang would use .ctors if run under icecc. And lld currently silently mislinks inputs with .ctors sections, so before this clang + icecc + lld would produce broken binaries. (But this seems like a good change independent of that lld bug.) https://reviews.llvm.org/D39317 llvm-svn: 316713
* [LSan] Enable -fsanitize=leak for PPC64 Linux.Alex Shlyapnikov2017-10-261-1/+1
| | | | | | | | | | | | Summary: . Reviewers: eugenis Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D39312 llvm-svn: 316636
* [CUDA] Print an error if you try to compile with < sm_30 on CUDA 9.Justin Lebar2017-10-252-8/+10
| | | | | | | | | | | | | | Summary: CUDA 9's minimum sm is sm_30. Ideally we should also make sm_30 the default when compiling with CUDA 9, but that seems harder than it should be. Subscribers: sanjoy Differential Revision: https://reviews.llvm.org/D39109 llvm-svn: 316611
* Enable -pie and --enable-new-dtags by default on Android.Evgeniy Stepanov2017-10-253-6/+18
| | | | | | | | | | | | | | | Summary: Also enable -no-pie on Gnu toolchain (previously available on Darwin only). Non-PIE executables won't even start on recent Android, and DT_RPATH is ignored by the loader. Reviewers: srhines, danalbert Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D38430 llvm-svn: 316606
* Add support of the next Debian (Debian buster - version 10)Sylvestre Ledru2017-10-251-0/+2
| | | | llvm-svn: 316579
* Add support of the next Ubuntu (Ubuntu 18.04 - Bionic Beaver)Sylvestre Ledru2017-10-251-0/+1
| | | | llvm-svn: 316577
* [AArch64] Fix PR34625 -mtune without -mcpu should not set -target-cpuPeter Smith2017-10-241-6/+10
| | | | | | | | | | | | | | | | | | | | When -mtune is used on AArch64 the -target-cpu is passed the value of the cpu given to -mtune. As well as setting micro-architectural features of the -mtune cpu, this will also add the architectural features such as support for instructions. This can result in the backend using instructions that are supported in the -mtune cpu but not supported in the target architecture. For example use of the v8.1-a LSE extensions with -march=v8. This change removes the setting of -target-cpu for -mtune, the -mcpu must be used to set -target-cpu. This has the effect of removing all non-hard coded benefits of mtune but it does produce correct output when -mtune cpu with a later architecture than v8 is used. Fixes PR34625 Differential Revision: https://reviews.llvm.org/D39179 llvm-svn: 316424
* [Driver] Use ld.lld directly for Fuchsia rather than passing flavorPetr Hosek2017-10-232-5/+3
| | | | | | | | | | | Passing a flavor to LLD requires command line argument, but if these are being passed through a response file, this will fail because LLD needs to know which driver to use before processing the response file. Use ld.lld directly instead to avoid this issue. Differential Revision: https://reviews.llvm.org/D39176 llvm-svn: 316379
* Fix a typo with -fno-double-square-bracket-attributes and add a test to ↵Aaron Ballman2017-10-211-0/+3
| | | | | | demonstrate that it works as expected in C++11 mode. Additionally corrected the handling of -fdouble-square-bracket-attributes to be properly passed down to the cc1 option. llvm-svn: 316275
* Allow /showIncludes with /PErich Keane2017-10-201-1/+3
| | | | | | | | | | | | | | | | | r213589 was checked in as a solution to https://bugs.llvm.org/show_bug.cgi?id=20336. However, it is possible to use /EP with /P to suppress #line directives AND output to a file. There is no reason in that case to suppress /showIncludes. This was reported here: https://bugs.llvm.org/show_bug.cgi?id=34997 Differential Revision: https://reviews.llvm.org/D39104 llvm-svn: 316225
OpenPOWER on IntegriCloud