summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
...
* [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
* Revert "[libFuzzer] Port to Windows"Matt Morehouse2018-08-291-13/+0
| | | | | | This reverts r340949 due to bot breakage again. llvm-svn: 340954
* [libFuzzer] Port to WindowsMatt Morehouse2018-08-291-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. Reviewers: morehouse, rnk Reviewed By: morehouse, rnk Subscribers: #sanitizers, delcypher, morehouse, kcc, eraman Differential Revision: https://reviews.llvm.org/D51022 llvm-svn: 340949
* [HIP] Fix output file extensionYaxun Liu2018-08-281-1/+1
| | | | | | | | | | | | | | | | | | OffloadBundlingJobAction constructor accepts a list of JobAction as inputs. The host JobAction is the last one. The file type of OffloadBundlingJobAction should be determined by the host JobAction (the last one) instead of the first one. Since HIP emits LLVM bitcode for device compilation, device JobAction has different file type as host Job Action. This bug causes incorrect output file extension for HIP. This patch fixes it by using the last input JobAction (host JobAction) to determine file type of OffloadBundlingJobAction. Differential Revision: https://reviews.llvm.org/D51336 llvm-svn: 340873
* Revert "[libFuzzer] Port to Windows"Matt Morehouse2018-08-281-13/+0
| | | | | | This reverts commit r340860 due to failing tests. llvm-svn: 340867
* [libFuzzer] Port to WindowsMatt Morehouse2018-08-281-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: morehouse, kcc, eraman Differential Revision: https://reviews.llvm.org/D51022 llvm-svn: 340860
* [ubsan] Enable -fsanitize=vptr on Apple devices and simulatorsVedant Kumar2018-08-281-2/+8
| | | | | | | | | It seems like an oversight that this check was not always enabled for on-device or device simulator targets. Differential Revision: https://reviews.llvm.org/D51239 llvm-svn: 340849
* [Driver] Delete last reference of lld -flavor old-gnuFangrui Song2018-08-281-8/+1
| | | | | | This is dead code because lld -flavor old-gnu was removed in 2016 by rLLD262158. llvm-svn: 340845
* [Xray] Darwin - Enable in the driver sideDavid Carlier2018-08-273-1/+10
| | | | | | | | | | Reviewers: dberris Reviered By: dberris Differential Revision: https://reviews.llvm.org/D51269 llvm-svn: 340712
* [Driver] Change MipsLinux default linker from "lld" to "ld.lld"Fangrui Song2018-08-261-1/+1
| | | | | | | | | | | | Reviewers: kzhuravl, atanasyan Reviewed By: atanasyan Subscribers: sdardis, arichardson, jrtc27, atanasyan, cfe-commits Differential Revision: https://reviews.llvm.org/D51234 llvm-svn: 340709
* Reland r340552, "Driver: Enable address-significance tables by default when ↵Peter Collingbourne2018-08-241-1/+2
| | | | | | | | | | targeting COFF." which was reverted in r340579. The underlying problem that caused the revert was fixed in r340648. Differential Revision: https://reviews.llvm.org/D51049 llvm-svn: 340649
* [RISCV] RISC-V using -fuse-init-array by defaultKito Cheng2018-08-241-1/+3
| | | | | | | | | | Reviewers: asb, apazos, mgrang Reviewed By: asb Differential Revision: https://reviews.llvm.org/D50043 llvm-svn: 340595
OpenPOWER on IntegriCloud