summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
* NFC: Fix some darwin linker warnings introduced in r338385Erik Pilkington2018-09-274-8/+8
| | | | | | | | | | The darwin linker was complaining about Toolchains/RISCV.cpp and Toolchains/Arch/RISCV.cpp had the same name. Fix is to just rename Toolchains/RISCV.cpp to Toolchains/RISCVToolchain.cpp. Differential revision: https://reviews.llvm.org/D52574 llvm-svn: 343263
* [OpenMP] Improve search for libomptarget-nvptxJonas Hahnfeld2018-09-271-6/+14
| | | | | | | | | | | | | | | When looking for the bclib Clang considered the default library path first while it preferred directories in LIBRARY_PATH when constructing the invocation of nvlink. The latter actually makes more sense because during development it allows using a non-default runtime library. So change the search for the bclib to start looking in directories given by LIBRARY_PATH. Additionally add a new option --libomptarget-nvptx-path= which will be searched first. This will be handy for testing purposes. Differential Revision: https://reviews.llvm.org/D51686 llvm-svn: 343230
* [driver][mips] Adjust target triple accordingly to provided ABI nameSimon Atanasyan2018-09-271-0/+10
| | | | | | | | | | | | | Explicitly selected MIPS ABI using the `-mabi` option implies corresponding target triple. For 'O32' ABI it's a 32-bit target triple like `mips-linux-gnu`. For 'N32' and 'N64' ABIs it's a 64-bit target triple like `mips64-linux-gnu`. This patch adjusts target triple accordingly these rules like we do for pseudo-target flags '-m64', '-m32' etc already. Differential revision: https://reviews.llvm.org/D52290 llvm-svn: 343169
* llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...)Fangrui Song2018-09-262-7/+6
| | | | | | | | | | | | | | Summary: The convenience wrapper in STLExtras is available since rL342102. Reviewers: rsmith, #clang, dblaikie Reviewed By: rsmith, #clang Subscribers: mgrang, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52576 llvm-svn: 343147
* Revert "[DRIVER][OFFLOAD] Do not invoke unbundler on unsupported fileAlexey Bataev2018-09-251-12/+0
| | | | | | | | | types." It reverts commit r342991 + several other commits intended to fix the tests. Still have some failed tests, need to investigate it. llvm-svn: 343002
* [DRIVER][OFFLOAD] Do not invoke unbundler on unsupported file types.Alexey Bataev2018-09-251-0/+12
| | | | | | | | | clang-offload-bundler should not be invoked with the unbundling action when the input file type does not match the action type. For example, .so files should be unbundled during linking phase and should be linked only with the host code. llvm-svn: 342991
* [AArch64] Support adding X[8-15,18] registers as CSRs.Tri Vo2018-09-251-0/+27
| | | | | | | | | | | | | | | | | | Summary: Making X[8-15,18] registers call-saved is used to support CONFIG_ARM64_LSE_ATOMICS in Linux kernel. Signed-off-by: Tri Vo <trong@android.com> Reviewers: srhines, nickdesaulniers, javed.absar Reviewed By: nickdesaulniers Subscribers: kristof.beyls, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D52399 llvm-svn: 342990
* [clang-cl] Provide separate flags for all the /O variantsHans Wennborg2018-09-251-0/+1
| | | | | | | | | | | | | | | This provides better help text in "clang-cl /?". Also it cleans things up a bit: previously "/Od" could be handled either as a separate flag aliased to "-O0", or by the main optimization flag processing in TranslateOptArg. With this patch, all the flags get aliased back to /O so they're handled by TranslateOptArg. Thanks to Nico for the idea! Differential revision: https://reviews.llvm.org/D52266 llvm-svn: 342977
* Driver: render arguments for the embedded bitcode correctlySaleem Abdulrasool2018-09-241-14/+131
| | | | | | | | | | When embedding bitcode, only a subset of the arguments should be recorded into the bitcode compilation commandline. The frontend job is split into two jobs, one which will generate the bitcode. Ensure that the arguments for the compilation to bitcode is properly stripped so that the embedded arguments are the permitted subset. llvm-svn: 342929
* [CUDA] Added basic support for compiling with CUDA-10.0Artem Belevich2018-09-241-1/+6
| | | | llvm-svn: 342924
* [ARM][AArch64] Add feature +fp16fmlSjoerd Meijer2018-09-242-1/+54
| | | | | | | | | | | | | | | | | | | | | Armv8.4-A adds a few FP16 instructions that can optionally be implemented in CPUs of Armv8.2-A and above. This patch adds a feature to clang to permit selection of these instructions. This interacts with the +fp16 option as follows: Prior to Armv8.4-A: *) +fp16fml implies +fp16 *) +nofp16 implies +nofp16fml From Armv8.4-A: *) The above conditions apply, additionally: +fp16 implies +fp16fml Patch by Bernard Ogden. Differential Revision: https://reviews.llvm.org/D50229 llvm-svn: 342862
* [XRay][clang] Propagate -fxray-instrumentation-bundle to -cc1Dean Michael Berris2018-09-211-0/+15
| | | | | | | | | | | | | | | Summary: Add a test and ensure that we propagate the -fxray-instrumentation-bundle flag from the driver invocation to the -cc1 options. Reviewers: mboerger, tejohnson Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52342 llvm-svn: 342715
* Driver: extract a local variable for the Toolchain (NFC)Saleem Abdulrasool2018-09-181-53/+47
| | | | | | | Create and store a reference to the current toolchain rather than calling `getToolChain` throughout the function. NFC. llvm-svn: 342515
* Driver: hoist `-mlimit-float-precision` (NFC)Saleem Abdulrasool2018-09-181-5/+5
| | | | | | | | Move the floating point argument handling into the RenderFloatingPointOptions helper. This relocation just puts the floating point related options into a single location. llvm-svn: 342512
* Fix fomit-frame-pointe+pg errorDavid Blaikie2018-09-181-1/+1
| | | | llvm-svn: 342510
* Fix logic around determining use of frame pointer with -pg.Stephen Hines2018-09-181-2/+1
| | | | | | | | | | | | | | | | | | | | Summary: As part of r342165, I rewrote the logic to check whether -fno-omit-frame-pointer was passed after a -fomit-frame-pointer argument. This CL switches that logic to use the consolidated shouldUseFramePointer() function. This fixes a potential issue where -pg gets used with -fomit-frame-pointer on a platform that must always retain frame pointers. Reviewers: dblaikie Reviewed By: dblaikie Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52191 llvm-svn: 342501
* [modules] Driver support for precompiling a collection of files as a singleRichard Smith2018-09-155-36/+141
| | | | | | action. llvm-svn: 342305
* [VFS] vfs::directory_iterator yields path and file type instead of full StatusSam McCall2018-09-142-5/+5
| | | | | | | | | | | | | | | | | | | | | | | Summary: Most callers I can find are using only `getName()`. Type is used by the recursive iterator. Now we don't have to call stat() on every listed file (on most platforms). Exceptions are e.g. Solaris where readdir() doesn't include type information. On those platforms we'll still stat() - see D51918. The result is significantly faster (stat() can be slow). My motivation: this may allow us to improve clang IO on large TUs with long include search paths. Caching readdir() results may allow us to skip many stat() and open() operations on nonexistent files. Reviewers: bkramer Subscribers: fedor.sergeev, cfe-commits Differential Revision: https://reviews.llvm.org/D51921 llvm-svn: 342232
* [Driver] Fix missing MultiArch include dir on powerpcspeKristina Brooks2018-09-141-1/+2
| | | | | | | | | | | | On powerpc-linux-gnuspe, the header files are located in their own include directory named /usr/lib/powerpc-linux-gnuspe, so add this directory to PPCMultiarchIncludeDirs. Patch by glaubitz (John Paul Adrian Glaubitz) Differential Revision: https://reviews.llvm.org/D52066 llvm-svn: 342231
* Support -fno-omit-frame-pointer with -pg.Stephen Hines2018-09-131-1/+2
| | | | | | | | | | | | | | | | | | Summary: Previously, any instance of -fomit-frame-pointer would make it such that -pg was an invalid flag combination. If -fno-omit-frame-pointer is passed later on the command line (such that it actually takes effect), -pg should be allowed. Reviewers: nickdesaulniers Reviewed By: nickdesaulniers Subscribers: manojgupta, nickdesaulniers, cfe-commits, kongyi, chh, pirama Differential Revision: https://reviews.llvm.org/D51713 llvm-svn: 342165
* Fix MSVC "illegal conversion; more than one user-defined conversion has been ↵Simon Pilgrim2018-09-131-1/+1
| | | | | | implicitly applied" warning. NFCI. llvm-svn: 342125
* [AArch64] Support reserving x1-7 registers.Tri Vo2018-09-121-0/+21
| | | | | | | | | | | | | | Summary: Reserving registers x1-7 is used to support CONFIG_ARM64_LSE_ATOMICS in Linux kernel. This change adds support for reserving registers x1 through x7. Reviewers: javed.absar, efriedma, nickdesaulniers, srhines, phosek Reviewed By: nickdesaulniers Subscribers: manojgupta, jfb, cfe-commits, kristof.beyls Differential Revision: https://reviews.llvm.org/D48581 llvm-svn: 342100
* [Hexagon] Remove fp-contract=fast setting for at O3Brendon Cahoon2018-09-121-5/+0
| | | | | | | | | Change Hexagon so that the setting for fp-contract is the default setting. This makes Hexagon consistent with all other targets. Differential Revision: https://reviews.llvm.org/D49999 llvm-svn: 342078
* [Driver] Search LibraryPaths when handling -print-file-namePetr Hosek2018-09-121-18/+23
| | | | | | | | This is necessary to handle the multiarch runtime directories. Differential Revision: https://reviews.llvm.org/D51573 llvm-svn: 342021
* [clang-cl, PCH] Support for /Yc and /Yu without filename and #pragma hdrstopMike Rice2018-09-112-21/+17
| | | | | | | | | | | | | With clang-cl, when the user specifies /Yc or /Yu without a filename the compiler uses a #pragma hdrstop in the main source file to determine the end of the PCH. If a header is specified with /Yc or /Yu #pragma hdrstop has no effect. The optional #pragma hdrstop filename argument is not yet supported. Differential Revision: https://reviews.llvm.org/D51391 llvm-svn: 341963
* Differential Revision: https://reviews.llvm.org/D50246Kristina Brooks2018-09-072-5/+35
| | | | | | | | | | [RISCV] Add support for computing sysroot for riscv32-unknown-elf Extends r338385 to allow the driver to compute the sysroot when an explicit path is not provided. This allows the linker to find C runtime files and the correct include directory for header files. Patch by lewis-revill (Lewis Revill) llvm-svn: 341655
* Reland r341390 clang-cl: Pass /Brepro to linker if it was passed to the compilerNico Weber2018-09-071-0/+9
| | | | | | | | | | The test was missing '--' on mac as pointed out by -Wslash-u-filename: <stdin>:5:69: note: possible intended match here clang: warning: '/Users/thakis/src/llvm-mono/clang/test/Driver/msvc-link.c' treated as the '/U' option [-Wslash-u-filename] Differential Revision: https://reviews.llvm.org/D51635 llvm-svn: 341654
* [MSan] add KMSAN support to Clang driverAlexander Potapenko2018-09-072-4/+9
| | | | | | | | | | | | | | | Boilerplate code for using KMSAN instrumentation in Clang. We add a new command line flag, -fsanitize=kernel-memory, with a corresponding SanitizerKind::KernelMemory, which, along with SanitizerKind::Memory, maps to the memory_sanitizer feature. KMSAN is only supported on x86_64 Linux. It's incompatible with other sanitizers, but supports code coverage instrumentation. llvm-svn: 341641
* Re-commit "Enable DWARF accelerator tables by default when tuning for lldb ↵Pavel Labath2018-09-061-1/+1
| | | | | | | | | | | | | | | | | (-glldb => -gpubnames)"" This recommits r341472, which was reverted due to test failures on macos bots. The issue was that a macos target implies -glldb which, together with this patch added a -gpubnames switch where there previously wasn't one. The intentions of those checks was to check that -gpubnames is not emitted by default so I add an explicit -ggdb arg to those command lines to get same behavior on all platforms (the fact that -glldb *does* set -gpubnames is tested by a separate test). Differential Revision: https://reviews.llvm.org/D51576 llvm-svn: 341564
* Reverting r 341390 because it is causing test failures on GreenDragon.A Bergen2018-09-061-9/+0
| | | | | | http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental/52810/ llvm-svn: 341560
* Fix the -print-multi-directory flag to print the selected multilib.Christian Bruel2018-09-062-13/+11
| | | | | | | | | | | | | | Summary: Fix -print-multi-directory to print the selected multilib Reviewers: jroelofs Reviewed By: jroelofs Subscribers: jroelofs, timshen, thakis, srhines, cfe-commits Differential Revision: https://reviews.llvm.org/D51354 llvm-svn: 341547
* Revert "Enable DWARF accelerator tables by default when tuning for lldb ↵Pavel Labath2018-09-051-1/+1
| | | | | | | | (-glldb => -gpubnames)" This reverts commit r341472 due to breakage in green dragon bots. llvm-svn: 341492
* Enable DWARF accelerator tables by default when tuning for lldb (-glldb => ↵Pavel Labath2018-09-051-1/+1
| | | | | | | | | | | | | | | | | | -gpubnames) Summary: DWARF v5 accelerator tables provide a considerable performance improvement for lldb and will make the default -glldb behavior same on all targets (right now we emit apple tables on apple targets, but these are not controlled by -gpubnames, only by -glldb). Reviewers: dblaikie Subscribers: probinson, clayborg, JDevlieghere, aprantl, cfe-commits Differential Revision: https://reviews.llvm.org/D51576 llvm-svn: 341472
* Revert r341373, since it fails on some targets.Tim Shen2018-09-042-11/+13
| | | | | | Differential Revision: https://reviews.llvm.org/D51354 llvm-svn: 341418
* clang-cl: Pass /Brepro to linker if it was passed to the compilerNico Weber2018-09-041-0/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D51635 llvm-svn: 341390
* Fix the -print-multi-directory flag to print the selected multilib.Christian Bruel2018-09-042-13/+11
| | | | | | | | | | | | | | Summary: Fix -print-multi-directory to print the selected multilib Reviewers: jroelofs Reviewed By: jroelofs Subscribers: srhines, cfe-commits Differential Revision: https://reviews.llvm.org/D51354 llvm-svn: 341373
* [x86/SLH] Add a real Clang flag and LLVM IR attribute for SpeculativeChandler Carruth2018-09-042-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Load Hardening. Wires up the existing pass to work with a proper IR attribute rather than just a hidden/internal flag. The internal flag continues to work for now, but I'll likely remove it soon. Most of the churn here is adding the IR attribute. I talked about this Kristof Beyls and he seemed at least initially OK with this direction. The idea of using a full attribute here is that we *do* expect at least some forms of this for other architectures. There isn't anything *inherently* x86-specific about this technique, just that we only have an implementation for x86 at the moment. While we could potentially expose this as a Clang-level attribute as well, that seems like a good question to defer for the moment as it isn't 100% clear whether that or some other programmer interface (or both?) would be best. We'll defer the programmer interface side of this for now, but at least get to the point where the feature can be enabled without relying on implementation details. This also allows us to do something that was really hard before: we can enable *just* the indirect call retpolines when using SLH. For x86, we don't have any other way to mitigate indirect calls. Other architectures may take a different approach of course, and none of this is surfaced to user-level flags. Differential Revision: https://reviews.llvm.org/D51157 llvm-svn: 341363
* Revert "Disable the GNUstep v2 ABI on Windows."David Chisnall2018-09-041-1/+2
| | | | | | | | | This reverts commit b4547c9cadd2f8adfe3f3182e4c56e466c5256cb. Apparently git llvm push from the monorepo does not respect branches and pushes the current branch to master. llvm-svn: 341352
* Disable the GNUstep v2 ABI on Windows.David Chisnall2018-09-041-2/+1
| | | | | | | | | | | The code remains so that we can potentially reenable it in a point release, but the driver will reject it. Several issues were raised during testing that made it clear that this was not quite ready for general consumption. Approved by: Hans Wennborg llvm-svn: 341350
* [Aarch64] Fix linker emulation for Aarch64 big endianPeter Smith2018-09-031-1/+1
| | | | | | | | | | | | | | This patch fixes target linker emulation for aarch64 big endian. aarch64_be_linux is not recognized by gnu ld. The equivalent emulation mode supported by gnu ld is aarch64linuxb. Patch by: Bharathi Seshadri Reviewed by: Peter Smith Differential Revision: https://reviews.llvm.org/D42930 llvm-svn: 341312
* [WebAssembly] clang-format (NFC)Heejin Ahn2018-08-312-15/+13
| | | | | | | | | | Summary: This patch runs clang-format on all wasm-only files. Subscribers: dschuff, sbc100, jgravelle-google, sunfish, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D51448 llvm-svn: 341254
* Refactor Addlibgcc to make the when and what logic more straightfoward.Sterling Augustine2018-08-311-12/+31
| | | | | | Add Android tests. llvm-svn: 341231
* [DEBUGINFO] Add support for emission of the debug directives only.Alexey Bataev2018-08-311-2/+13
| | | | | | | | | | | | | | | | Summary: Added option -gline-directives-only to support emission of the debug directives only. It behaves very similar to -gline-tables-only, except that it sets llvm debug info emission kind to llvm::DICompileUnit::DebugDirectivesOnly. Reviewers: echristo Subscribers: aprantl, fedor.sergeev, JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D51177 llvm-svn: 341212
* Revert r341107. That change breaks lto-android in a way is untested.Sterling Augustine2018-08-301-30/+12
| | | | llvm-svn: 341114
* Refactor Addlibgcc to make the when and what logic more straightfoward.Sterling Augustine2018-08-301-12/+30
| | | | | | | No functional change. A forthcoming change will add support for -shared-libgcc. llvm-svn: 341107
* [libFuzzer] Port to WindowsMatt Morehouse2018-08-301-0/+13
| | | | | | | | | | | | | | | | | | | | Summary: Port libFuzzer to windows-msvc. This patch allows libFuzzer targets to be built and run on Windows, using -fsanitize=fuzzer and/or fsanitize=fuzzer-no-link. It allows these forms of coverage instrumentation to work on Windows as well. It does not fix all issues, such as those with -fsanitize-coverage=stack-depth, which is not usable on Windows as of this patch. It also does not fix any libFuzzer integration tests. Nearly all of them fail to compile, fixing them will come in a later patch, so libFuzzer tests are disabled on Windows until them. Patch By: metzman Reviewers: morehouse, rnk Reviewed By: morehouse, rnk Subscribers: #sanitizers, delcypher, morehouse, kcc, eraman Differential Revision: https://reviews.llvm.org/D51022 llvm-svn: 341082
* [HIP] Add -fvisibility hidden option to clangYaxun Liu2018-08-301-0/+6
| | | | | | | | | | AMDGPU target need -fvisibility hidden option for clang to work around a limitation of no PLT support, otherwise there is compilation error at -O0. Differential Revision: https://reviews.llvm.org/D51434 llvm-svn: 341077
* [OPENMP][NVPTX] Add options -f[no-]openmp-cuda-force-full-runtime.Alexey Bataev2018-08-301-2/+10
| | | | | | | Added options -f[no-]openmp-cuda-force-full-runtime to [not] force use of the full runtime for OpenMP offloading to CUDA devices. llvm-svn: 341073
* AMDGPU: Default to hidden visibilityMatt Arsenault2018-08-302-0/+17
| | | | | | | | | | | | Object linking isn't supported, so it's not useful to emit default visibility. Default visibility requires relocations we don't yet support for functions compiled in another translation unit. WebAssembly already does this, although they insert these arguments in a different place for some reason. llvm-svn: 341033
* [analyzer] Move analyzer-eagerly-assume to AnalyzerOptions, enable by defaultGeorge Karpenkov2018-08-291-2/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D51251 llvm-svn: 340963
OpenPOWER on IntegriCloud