summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
...
* [RISCV] Propagate -mabi and -march values to GNU assembler.Ana Pazos2018-01-171-0/+12
| | | | | | | | | | | | | | | When using -fno-integrated-as flag, the gnu assembler produces code with some default march/mabi which later causes linker failure due to incompatible mabi/march. In this patch we explicitly propagate -mabi and -march flags to the GNU assembler. In this patch we explicitly propagate -mabi and -march flags to the GNU assembler. Differential Revision: https://reviews.llvm.org/D41271 llvm-svn: 322769
* [clang-cl] Let /FA output use intel assembly.Nico Weber2018-01-171-0/+3
| | | | | | | cl's assembly output is in intel syntax, so clang-cl's should be too, PR35031. https://reviews.llvm.org/D42157 llvm-svn: 322652
* Clang counterpart change for fuzzer FreeBSD supportKamil Rytarowski2018-01-151-0/+2
| | | | | | | | | | | | | | | | Summary: Providing fuzzer sanitizer support for FreeBSD (but only for X86/64 architectures). Reviewers: kimgr, EricWF, martell Reviewed By: martell Patch by David CARLIER. Subscribers: krytarowski, kimgr, emaste, cfe-commits Differential Revision: https://reviews.llvm.org/D41809 llvm-svn: 322469
* Reland "[Driver] Update default sanitizer blacklist location"Petr Hosek2018-01-141-1/+1
| | | | | | | | | This is related to moving the sanitizer blacklists to share/ subdirectory. Differential Revision: https://reviews.llvm.org/D41706 llvm-svn: 322452
* [WebAssembly] Support -stdlib=libc++ switchSam Clegg2018-01-122-0/+22
| | | | | | | | | | | | | | Referenced implementation from Fuchsia and Darwin Toolchain. Still only support CST_Libcxx. Now checks that the argument is really '-stdlib=libc++', and display error. Also, now will pass -lc++ and -lc++abi to the linker. Patch by Patrick Cheng! Differential Revision: https://reviews.llvm.org/D41937 llvm-svn: 322382
* [WebAssembly] Remove `-allow-undefined-file wasm.syms` from linker argsSam Clegg2018-01-111-2/+0
| | | | | | | | See: https://github.com/WebAssembly/tool-conventions/issues/35 Differential Revision: https://reviews.llvm.org/D41923 llvm-svn: 322321
* [RISCV] Add the RISCV target and compiler driverAlex Bradbury2018-01-117-1/+217
| | | | | | | | | As RV64 codegen has not yet been upstreamed into LLVM, we focus on RV32 driver support (RV64 to follow). Differential Revision: https://reviews.llvm.org/D39963 llvm-svn: 322276
* Revert "[Driver] Update default sanitizer blacklist location"Petr Hosek2018-01-111-1/+1
| | | | | | This reverts commit r322258: broke the dfsan build. llvm-svn: 322260
* Reland "[Driver] Update default sanitizer blacklist location"Petr Hosek2018-01-111-1/+1
| | | | | | | | | This is related to moving the sanitizer blacklists to share/ subdirectory. Differential Revision: https://reviews.llvm.org/D41706 llvm-svn: 322258
* Revert "[Driver] Update default sanitizer blacklist location"Petr Hosek2018-01-111-1/+1
| | | | | | This reverts commit r322233: this is breaking dfsan tests. llvm-svn: 322242
* Reland "[Driver] Update default sanitizer blacklist location"Petr Hosek2018-01-101-1/+1
| | | | | | | | | This is related to moving the sanitizer blacklists to share/ subdirectory. Differential Revision: https://reviews.llvm.org/D41706 llvm-svn: 322233
* Revert "[Driver] Update default sanitizer blacklist location"Petr Hosek2018-01-101-1/+1
| | | | | | This reverts commit r322154 because it broke sanitizer bots. llvm-svn: 322155
* [Driver] Update default sanitizer blacklist locationPetr Hosek2018-01-101-1/+1
| | | | | | | | | This is related to moving the sanitizer blacklists to share/ subdirectory. Differential Revision: https://reviews.llvm.org/D41706 llvm-svn: 322154
* Reland "Emit Function IDs table for Control Flow Guard"Adrian McCarthy2018-01-091-0/+4
| | | | | | | | | | | | | | | | | Adds option /guard:cf to clang-cl and -cfguard to cc1 to emit function IDs of functions that have their address taken into a section named .gfids$y for compatibility with Microsoft's Control Flow Guard feature. The original patch didn't have the lit.local.cfg file that restricts the new test to x86, thus the new test was failing on the non-x86 bots. Differential Revision: https://reviews.llvm.org/D40531 The reverts r322008, which was a revert of r322005. This reverts commit a05b89f9aca70597dc79fe97bc49b50b51f525ba. llvm-svn: 322136
* ananas: Add shared library supportEd Schouten2018-01-091-5/+25
| | | | | | | | | | | | | The Ananas Operating System (https://github.com/zhmu/ananas) has shared library support as of commit 57739c0b6ece56dd4872aedf30264ed4b9412c77. This change adds the necessary settings to clang so that shared executables and libraries can be build correctly. Submitted by: Rink Springer Differential Revision: https://reviews.llvm.org/D41500 llvm-svn: 322064
* Added Control Flow Protection FlagOren Ben Simhon2018-01-091-0/+5
| | | | | | | | | | Cf-protection is a target independent flag that instructs the back-end to instrument control flow mechanisms like: Branch, Return, etc. For example in X86 this flag will be used to instrument Indirect Branch Tracking instructions. Differential Revision: https://reviews.llvm.org/D40478 Change-Id: I5126e766c0e6b84118cae0ee8a20fe78cc373dea llvm-svn: 322063
* [Myriad] Remove invalidated -elf flag for MoviAsmWalter Lee2018-01-081-1/+0
| | | | | | | | | | | | | | Summary: The flag has been deprecated, and is becoming invalid in the latest MDK. Reviewers: jyknight Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D41713 llvm-svn: 322023
* Revert "Emit Function IDs table for Control Flow Guard"Adrian McCarthy2018-01-081-4/+0
| | | | | | | | | | The new test fails on the Hexagon bot. Reverting while I investigate. This reverts https://reviews.llvm.org/rL322005 This reverts commit b7e0026b4385180c378edc658ec91a39566f2942. llvm-svn: 322008
* Emit Function IDs table for Control Flow GuardAdrian McCarthy2018-01-081-0/+4
| | | | | | | | | | Adds option /guard:cf to clang-cl and -cfguard to cc1 to emit function IDs of functions that have their address taken into a section named .gfids$y for compatibility with Microsoft's Control Flow Guard feature. Differential Revision: https://reviews.llvm.org/D40531 llvm-svn: 322005
* [Driver] Add flag enabling the function stack size section that was added in ↵Sean Eveson2018-01-081-0/+4
| | | | | | | | | | r319430 Adds the -fstack-size-section flag to enable the .stack_sizes section. The flag defaults to on for the PS4 triple. Differential Revision: https://reviews.llvm.org/D40712 llvm-svn: 321992
* [Driver] Suggest correctly spelled driver optionsBrian Gesiak2018-01-061-8/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Depends on https://reviews.llvm.org/D41732. Utilities such as `opt`, when invoked with arguments that are very nearly spelled correctly, suggest the correctly spelled options: ``` bin/opt -hel opt: Unknown command line argument '-hel'. Try: 'bin/opt -help' opt: Did you mean '-help'? ``` Clang, on the other hand, prior to this commit, does not: ``` bin/clang -hel clang-6.0: error: unknown argument: '-hel' ``` This commit makes use of the new libLLVMOption API from https://reviews.llvm.org/D41732 in order to provide correct suggestions: ``` bin/clang -hel clang-6.0: error: unknown argument: '-hel', did you mean '-help'? ``` Test Plan: `check-clang` Reviewers: yamaguchi, v.g.vassilev, teemperor, ruiu, bruno Reviewed By: bruno Subscribers: bruno, jroelofs, cfe-commits Differential Revision: https://reviews.llvm.org/D41733 llvm-svn: 321917
* [Driver] Fix unused variables and test-writing-into-workdir after r321621Sam McCall2018-01-021-2/+2
| | | | llvm-svn: 321639
* Enable configuration files in clangSerge Pavlov2018-01-011-4/+260
| | | | | | | | | | | | | | | | | | | | | Clang is inherently a cross compiler and can generate code for any target enabled during build. It however requires to specify many parameters in the invocation, which could be hardcoded during configuration process in the case of single-target compiler. The purpose of configuration files is to make specifying clang arguments easier. A configuration file is a collection of driver options, which are inserted into command line before other options specified in the clang invocation. It groups related options together and allows specifying them in simpler, more flexible and less error prone way than just listing the options somewhere in build scripts. Configuration file may be thought as a "macro" that names an option set and is expanded when the driver is called. Use of configuration files is described in `UserManual.rst`. Differential Revision: https://reviews.llvm.org/D24933 llvm-svn: 321621
* Reverted 321587: Enable configuration files in clangSerge Pavlov2017-12-301-260/+4
| | | | | | Need to check targets in tests more carefully. llvm-svn: 321588
* Enable configuration files in clangSerge Pavlov2017-12-301-4/+260
| | | | | | | | | | | | | | | | | | | | | Clang is inherently a cross compiler and can generate code for any target enabled during build. It however requires to specify many parameters in the invocation, which could be hardcoded during configuration process in the case of single-target compiler. The purpose of configuration files is to make specifying clang arguments easier. A configuration file is a collection of driver options, which are inserted into command line before other options specified in the clang invocation. It groups related options together and allows specifying them in simpler, more flexible and less error prone way than just listing the options somewhere in build scripts. Configuration file may be thought as a "macro" that names an option set and is expanded when the driver is called. Use of configuration files is described in `UserManual.rst`. Differential Revision: https://reviews.llvm.org/D24933 llvm-svn: 321587
* [driver][darwin] Take the OS version from -m<os>-version-min argument whenAlex Lorenz2017-12-291-14/+33
| | | | | | | | | | -target has no OS version This ensures that Clang won't warn about redundant -m<os>-version-min argument for an invocation like `-target x86_64-apple-macos -mmacos-version-min=10.11` llvm-svn: 321559
* [OPENMP] Initial support for `-fopenmp-simd` option.Alexey Bataev2017-12-291-0/+4
| | | | | | Added basic support for `-fopenmp-simd` options. llvm-svn: 321558
* Avoid int to string conversion in Twine or raw_ostream contexts.Benjamin Kramer2017-12-285-26/+19
| | | | | | Some output changes from uppercase hex to lowercase hex, no other functionality change intended. llvm-svn: 321526
* [scudo] Add -fsanitize=scudo option to FuchsiaPetr Hosek2017-12-211-0/+1
| | | | | | | | | | | | | | Apparently the -fsanitize flag hadn't been added for Scudo upstream yet. Patch By: flowerhack Reviewers: cryptoad, alekseyshl, mcgrathr, phosek Reviewed By: mcgrathr, phosek Differential Revision: https://reviews.llvm.org/D41413 llvm-svn: 321314
* [Driver] Ensure no overlap between trapping & recoverable sanitizers. NFC.Vedant Kumar2017-12-211-0/+3
| | | | | | | This is NFC because in EmitCheck(), -fsanitize-trap=X overrides -fsanitize-recover=X. llvm-svn: 321230
* [darwin][driver] Warn about mismatching -<os>-version-min rather thanAlex Lorenz2017-12-201-4/+21
| | | | | | | | | | superfluous -<os>-version-min compiler option rdar://35813850 Differential Revision: https://reviews.llvm.org/D41425 llvm-svn: 321145
* [driver][darwin] Set the 'simulator' environment when it's specifiedAlex Lorenz2017-12-191-6/+21
| | | | | | | | | | in '-target' rdar://35742458 Differential Revision: https://reviews.llvm.org/D41076 llvm-svn: 321102
* [driver][darwin] Take the OS version specified in "-target" as the targetAlex Lorenz2017-12-191-47/+69
| | | | | | | | | | | | | OS instead of inferring it from SDK / environment The OS version is specified in -target should be used instead of the one in an environment variable / SDK name. rdar://35813850 Differential Revision: https://reviews.llvm.org/D40998 llvm-svn: 321099
* [clang] -foptimization-record-file= should imply -fsave-optimization-recordJonas Devlieghere2017-12-191-0/+1
| | | | | | | | | | | | | | | | | The Clang option -foptimization-record-file= controls which file an optimization record is output to. Optimization records are output if you use the Clang option -fsave-optimization-record. If you specify the first option without the second, you get a warning that the command line argument was unused. Passing -foptimization-record-file= should imply -fsave-optimization-record. This fixes PR33670 Patch by: Dmitry Venikov <venikov@phystech.edu> Differential revision: https://reviews.llvm.org/D39834 llvm-svn: 321090
* Rename sparc-myriad-elf triplet to sparc-myriad-rtemsWalter Lee2017-12-191-4/+5
| | | | | | | | | | | | | Summary: This is to be consistent with latest Movidius MDK releases. Also, don't inherit any gcc paths for shave triple. Reviewers: jyknight Subscribers: emaste, fedor.sergeev Differential Revision: https://reviews.llvm.org/D41295 llvm-svn: 321080
* Teach clang/NetBSD about additional dependencies for sanitizersKamil Rytarowski2017-12-191-0/+6
| | | | | | | | | | | | | | | | | | | | | | Summary: Sanitizers on NetBSD require additional linkage: - libutil for forkpty(3) - libexecinfo for backtrace(3) Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka, kcc Reviewed By: eugenis Subscribers: #sanitizers, cfe-commits Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41054 llvm-svn: 321060
* [Driver, CodeGen] pass through and apply -fassociative-mathSanjay Patel2017-12-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are 2 parts to getting the -fassociative-math command-line flag translated to LLVM FMF: 1. In the driver/frontend, we accept the flag and its 'no' inverse and deal with the interactions with other flags like -ffast-math -fno-signed-zeros -fno-trapping-math. This was mostly already done - we just need to translate the flag as a codegen option. The test file is complicated because there are many potential combinations of flags here. Note that we are matching gcc's behavior that requires 'nsz' and no-trapping-math. 2. In codegen, we map the codegen option to FMF in the IR builder. This is simple code and corresponding test. For the motivating example from PR27372: float foo(float a, float x) { return ((a + x) - x); } $ ./clang -O2 27372.c -S -o - -ffast-math -fno-associative-math -emit-llvm | egrep 'fadd|fsub' %add = fadd nnan ninf nsz arcp contract float %0, %1 %sub = fsub nnan ninf nsz arcp contract float %add, %2 So 'reassoc' is off as expected (and so is the new 'afn' but that's a different patch). This case now works as expected end-to-end although the underlying logic is still wrong: $ ./clang -O2 27372.c -S -o - -ffast-math -fno-associative-math | grep xmm addss %xmm1, %xmm0 subss %xmm1, %xmm0 We're not done because the case where 'reassoc' is set is ignored by optimizer passes. Example: $ ./clang -O2 27372.c -S -o - -fassociative-math -fno-signed-zeros -fno-trapping-math -emit-llvm | grep fadd %add = fadd reassoc float %0, %1 $ ./clang -O2 27372.c -S -o - -fassociative-math -fno-signed-zeros -fno-trapping-math | grep xmm addss %xmm1, %xmm0 subss %xmm1, %xmm0 Differential Revision: https://reviews.llvm.org/D39812 llvm-svn: 320920
* [Hexagon] Add front-end support for Hexagon V65Krzysztof Parzyszek2017-12-131-0/+1
| | | | llvm-svn: 320579
* [Driver][CodeGen] Add -mprefer-vector-width driver option and attribute ↵Craig Topper2017-12-111-0/+23
| | | | | | | | | | | | | | | | during CodeGen. This adds a new command line option -mprefer-vector-width to specify a preferred vector width for the vectorizers. Valid values are 'none' and unsigned integers. The driver will check that it meets those constraints. Specific supported integers will be managed by the targets in the backend. Clang will take the value and add it as a new function attribute during CodeGen. This represents the alternate direction proposed by Sanjay in this RFC: http://lists.llvm.org/pipermail/llvm-dev/2017-November/118734.html The syntax here matches gcc, though gcc treats it as an x86 specific command line argument. gcc only allows values of 128, 256, and 512. I'm not having clang check any values. Differential Revision: https://reviews.llvm.org/D40230 llvm-svn: 320419
* Revert 320391: Certain targets are failing, pulling back to diagnose.Erich Keane2017-12-113-15/+1
| | | | llvm-svn: 320398
* For Linux/gnu compatibility, preinclude <stdc-predef.h> if the file is availableErich Keane2017-12-113-1/+15
| | | | | | | | | | | | | | | | | | | | 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 Note: this is a recommit after a test failure took down the original (r318669) Patch By: mibintc Differential Revision: https://reviews.llvm.org/D34158 llvm-svn: 320391
* Fix MSVC 'not all control paths return a value' warningSimon Pilgrim2017-12-101-0/+1
| | | | llvm-svn: 320297
* [driver][darwin] Refactor the target selection code, NFCAlex Lorenz2017-12-092-262/+379
| | | | | | | | | | | | | | | | | The simulator variant of Darwin's platforms is removed in favor of a new environment field. The code that selects the platform and the version is split into 4 different functions instead of being all in one function. This is an NFC commit, although it slightly improves the "invalid version number" diagnostic by displaying the environment variable instead of -m<os>-version-min if the OS version was derived from the environment. rdar://35813850 Differential Revision: https://reviews.llvm.org/D41035 llvm-svn: 320235
* Hardware-assisted AddressSanitizer (clang part).Evgeniy Stepanov2017-12-093-10/+24
| | | | | | | | | | | | | | Summary: Driver, frontend and LLVM codegen for HWASan. A clone of ASan, basically. Reviewers: kcc, pcc, alekseyshl Subscribers: srhines, javed.absar, cfe-commits Differential Revision: https://reviews.llvm.org/D40936 llvm-svn: 320232
* Don't link NetBSD programs with -ldl in linkXRayRuntimeDepsKamil Rytarowski2017-12-091-1/+2
| | | | | | | | | | | | | | | | | | | Summary: There is no such library on NetBSD, the corresponding functions like dlopen(3) are in libc. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, eugenis Reviewed By: vitalybuka Subscribers: dberris, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41021 llvm-svn: 320220
* Fix a comment in the codeKamil Rytarowski2017-12-081-1/+1
| | | | | | The -ldl library is missing on NetBSD too, make the comment more generic. llvm-svn: 320165
* [driver] Set the 'simulator' environment for Darwin when compiling forAlex Lorenz2017-12-073-8/+9
| | | | | | | | | | iOS/tvOS/watchOS simulator rdar://35135215 Differential Revision: https://reviews.llvm.org/D40682 llvm-svn: 320073
* [WebAssembly] Pass through --undefined to Wasm LLDSam Clegg2017-12-021-0/+1
| | | | | | | | | | | This is a follow-on to D40724 (Wasm entrypoint changes #1, add `--undefined` argument to LLD). Patch by Nicholas Wilson Differential Revision: https://reviews.llvm.org/D40739 llvm-svn: 319623
* Revert [ARM] disable FPU features when using soft floating point.Keith Walker2017-11-301-15/+5
| | | | | | | This reverts r319420 It is failing the test Driver/arm-mfpu.c so reverting while I investigate the failure. llvm-svn: 319425
* [ARM] disable FPU features when using soft floating point.Keith Walker2017-11-301-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | To be compatible with GCC if soft floating point is in effect any FPU specified is effectively ignored, eg, -mfloat-abi=soft -fpu=neon If any floating point features which require FPU hardware are enabled they must be disable. There was some support for doing this for NEON, but it did not handle VFP, nor did it prevent the backend from emitting the build attribute Tag_FP_arch describing the generated code as using the floating point hardware if a FPU was specified (even though soft float does not use the FPU). Disabling the hardware floating point features for targets which are compiling for soft float has meant that some tests which were incorrectly checking for hardware support also needed to be updated. In such cases, where appropriate the tests have been updated to check compiling for soft float and a non-soft float variant (usually softfp). This was usually because the target specified in the test defaulted to soft float. Differential Revision: https://reviews.llvm.org/D40256 llvm-svn: 319420
OpenPOWER on IntegriCloud