summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
...
* DebugInfo: Default to standalone debug when tuning for LLDBDavid Blaikie2019-04-161-3/+4
| | | | | | | | | | | | | | | | | LLDB can't currently handle Clang's default (limit/no-standalone) DWARF, so platforms that default to LLDB (Darwin) or anyone else manually requesting LLDB tuning, should also get standalone DWARF. That doesn't mean a user can't explicitly enable (because they have other reasons to prefer standalone DWARF (such as that they're only building half their application with debug info enabled, and half without - or because they're tuning for GDB, but want to be able to use it under LLDB too (this is the default on FreeBSD))) or disable (testing LLDB fixes/improvements that handle no-standalone mode, building C code, perhaps, which wouldn't have the LLDB<>no-standalone conflict, etc) the feature regardless of the tuning. llvm-svn: 358464
* [MinGW] Remove some supefluous calls to MakeArgString. NFC.Martin Storsjo2019-04-151-8/+8
| | | | llvm-svn: 358393
* [c++20] Enable driver and frontend support for building and usingRichard Smith2019-04-141-5/+10
| | | | | | modules when -std=c++2a is specified. llvm-svn: 358355
* [HIP] Use -mlink-builtin-bitcode to link device libraryYaxun Liu2019-04-121-40/+41
| | | | | | | | | | | | Use -mlink-builtin-bitcode instead of llvm-link to link device library so that device library bitcode and user device code can be compiled in a consistent way. This is the same approach used by CUDA and OpenMP. Differential Revision: https://reviews.llvm.org/D60513 llvm-svn: 358290
* [asan] Add gcc 8's driver option -fsanitize=pointer-compare and ↵Pierre Gousseau2019-04-1211-0/+49
| | | | | | | | | | | | -fsanitize=pointer-substract. Disabled by default as this is still an experimental feature. Reviewed By: thakis Differential Revision: https://reviews.llvm.org/D59221 llvm-svn: 358285
* Enable frame pointer elimination for OpenBSD on x86 and mips64.Brad Smith2019-04-121-0/+12
| | | | llvm-svn: 358245
* Add support for detection of devtoolset-8Tom Stellard2019-04-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The current llvm/clang et al. project can be built with the latest developer toolset (devtoolset-8) on RHEL, which provides GCC 8.2.1. However, the result compiler will not identify this toolset itself when compiling programs, which is of course not desirable. After the patch - which simply adds the name of the developer toolset to the existing list - it gets identified and selected, as shown below: [bamboo@bamboo llvm-project]$ clang -v clang version 9.0.0 (https://github.com/llvm/llvm-project.git e5ac385fb1ffa4bd3875ea6a4d24efdbd7814572) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /home/bamboo/llvm/bin Found candidate GCC installation: /opt/rh/devtoolset-4/root/usr/lib/gcc/x86_64-redhat-linux/5.2.1 Found candidate GCC installation: /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7 Found candidate GCC installation: /opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8 Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.2 Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5 Selected GCC installation: /opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8 Candidate multilib: .;@m64 Candidate multilib: 32;@m32 Selected multilib: .;@m64 Patch By: Radu-Adrian Popescu Reviewers: tstellar, fedor.sergeev Reviewed By: tstellar Subscribers: jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59987 llvm-svn: 358002
* Enable IAS for FreeBSD SPARC64.Brad Smith2019-04-071-1/+2
| | | | llvm-svn: 357878
* [RISCV] Collect library directories and triples for riscv64 triple tooAlex Bradbury2019-04-041-6/+16
| | | | | | | | | | | | When setting up library and tools paths when detecting an accompanying GCC installation only riscv32 was handled. As a consequence when targetting riscv64 neither the linker nor libraries would be found. This adds handling and tests for riscv64. Differential Revision: https://reviews.llvm.org/D53392 Patch by Edward Jones. llvm-svn: 357699
* [driver][mips] Check both `gnuabi64` and `gnu` suffixes in `getMultiarchTriple`Simon Atanasyan2019-04-021-14/+19
| | | | | | | | | | In case of N64 ABI toolchain paths migth have `mips-linux-gnuabi64` or `mips-linux-gnu` directory regardless of selected environment. Check both variants while detecting a multiarch triple. Fix for the bug https://bugs.llvm.org/show_bug.cgi?id=41204 llvm-svn: 357506
* [driver] clang-format. Fix indentation, split long lines. NFCSimon Atanasyan2019-04-023-18/+28
| | | | llvm-svn: 357505
* [Driver] Enable -fsanitize-address-globals-dead-stripping by default on PS4.Pierre Gousseau2019-04-021-0/+1
| | | | | | | | | | Can be safely enabled on PS4. Reviewed By: probinson Differential Revision: https://reviews.llvm.org/D59815 llvm-svn: 357480
* Range-style std::find{,_if} -> llvm::find{,_if}. NFCFangrui Song2019-03-313-6/+4
| | | | llvm-svn: 357359
* Adds `-ftime-trace` option to clang that produces Chrome `chrome://tracing` ↵Anton Afanasyev2019-03-301-0/+1
| | | | | | | | | | | | | | compatible JSON profiling output dumps. This change adds hierarchical "time trace" profiling blocks that can be visualized in Chrome, in a "flame chart" style. Each profiling block can have a "detail" string that for example indicates the file being processed, template name being instantiated, function being optimized etc. This is taken from GitHub PR: https://github.com/aras-p/llvm-project-20170507/pull/2 Patch by Aras Pranckevičius. Differential Revision: https://reviews.llvm.org/D58675 llvm-svn: 357340
* [Driver] Use --warn-shared-textrel for Android.Dan Albert2019-03-291-0/+5
| | | | | | | | | | | | | | | Android does not allow shared text relocations. Enable the linker warning to detect them by default. Reviewers: srhines, pirama Reviewed By: srhines Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D53344 llvm-svn: 357296
* [AMDGPU] Switch default DWARF version to 5Scott Linder2019-03-291-1/+1
| | | | | | | | | Effectively reverts r337612. The issues that cropped up with the last attempt appear to have gone away. Differential Revision: https://reviews.llvm.org/D59008 llvm-svn: 357285
* [AArch64] Support selecting TPIDR_EL[1-3] as the thread baseOliver Stannard2019-03-291-0/+12
| | | | | | | | | | | | | | Add an -mtp=el[0-3] option to select which of the AArch64 thread ID registers will be used for the TLS base pointer. This is a followup to rL356657 which added subtarget features to enable accesses to the privileged thread ID registers. Patch by Philip Derrin! Differential revision: https://reviews.llvm.org/D59631 llvm-svn: 357250
* [Driver] Default Android toolchains to noexecstack.Dan Albert2019-03-285-1/+22
| | | | | | | | | | | | | | Android does not support executable stacks. Reviewers: srhines, pirama Reviewed By: pirama Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D53343 llvm-svn: 357197
* [WebAssembly] Reland of rL356953 (4dcf3acce6)Sam Clegg2019-03-282-1/+23
| | | | | | | | | The previous patch was missing GetProgramPath() in the return value of getLinkerPath(). See https://reviews.llvm.org/D59743 llvm-svn: 357195
* [Driver] Allow -gsplit-dwarf on ELF OSes other than Linux and FuchsiaFangrui Song2019-03-281-5/+4
| | | | | | | | | | | In gcc, -gsplit-dwarf is handled in gcc/gcc.c as a spec (ASM_FINAL_SPEC): objcopy --extract-dwo + objcopy --strip-dwo. In gcc/opts.c, -gsplit_dwarf has the same semantic of a -g. Except for the availability of the external command 'objcopy', nothing precludes the feature working on other ELF OSes. llvm doesn't use objcopy, so it doesn't have to exclude other OSes. llvm-svn: 357150
* Revert "[WebAssembly] Don't use default GetLinkerPath"Derek Schuff2019-03-272-23/+1
| | | | | | | This reverts commit 4dcf3acce6d7455fd079d8e57441906ca2bad254. (reverts LLVM SVN r356953) llvm-svn: 357127
* Revert the r348352 "[clang] - Simplify tools::SplitDebugName."George Rimar2019-03-275-13/+21
| | | | | | | | | This partially reverts the r348352 (https://reviews.llvm.org/D55006) because of https://bugs.llvm.org/show_bug.cgi?id=41161. I did not revert the test case file because it passes fine now. llvm-svn: 357061
* Make -mno-outline pass -enable-machine-outliner=never to ld in LTOJessica Paquette2019-03-261-6/+15
| | | | | | | | | | Since AArch64 has default outlining behaviour, we need to make sure that -mno-outline is actually passed along to the linker in this case. Otherwise, it will run by default on minsize functions even when -mno-outline is specified. Also fix the darwin-ld test for this, which wasn't actually doing anything. llvm-svn: 357031
* [RISCV] Pass -target-abi to -cc1asRoger Ferrer Ibanez2019-03-262-0/+16
| | | | | | | | | | | | | | | | | The RISC-V assembler needs the target ABI because it defines a flag of the ELF file, as described in [1]. Make clang (the driver) to pass the target ABI to -cc1as in exactly the same way it does for -cc1. Currently -cc1as knows about -target-abi but is not handling it. Handle it and pass it to the MC layer via MCTargetOptions. [1] https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md#file-header Differential Revision: https://reviews.llvm.org/D59298 llvm-svn: 356981
* [WebAssembly] Don't use default GetLinkerPathSam Clegg2019-03-252-1/+23
| | | | | | | | | | | | | | | | | We can't (don't want to) honor the same set of "-fuse-ld" flags with WebAssembly since the ELF linkers (ld.lld, ld.gnu, etc) don't work with wasm object files. Instead we implement our own linker finding logic, similar or other non-ELF platforms like MSVC. We've had a few issues with CLANG_DEFAULT_LINKER overriding the WebAssembly linker which doesn't make sense since there is no generic linker that can handle WebAssembly today. Differential Revision: https://reviews.llvm.org/D59743 llvm-svn: 356953
* clang -dumpversion returns 4.2.1 for legacy reason, update itSylvestre Ledru2019-03-251-5/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: It has been introduced in 2011 for gcc compat: https://github.com/llvm-mirror/clang/commit/95a907fc0f2f717dca38a379c1d2353bfea06d4f it is probably time to remove it to remove the confusion. reported: https://bugs.llvm.org/show_bug.cgi?id=38836 https://bugs.launchpad.net/ubuntu/+source/llvm-defaults/+bug/1810860 Reviewers: ddunbar, rnk Reviewed By: rnk Subscribers: jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D56803 llvm-svn: 356931
* [WebAssembly] Make driver -pthread imply linker --shared-memoryThomas Lively2019-03-221-1/+3
| | | | | | | | | | | | | | | | Summary: This eliminates a linker error the user might otherwise see about how using the 'atomics' feature requires --shared-memory. Reviewers: sbc100, aheejin Subscribers: dschuff, jgravelle-google, sunfish, jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59721 llvm-svn: 356817
* [Driver] Pass -malign-double from the driver to the cc1 command lineCraig Topper2019-03-211-0/+1
| | | | | | | | | | -malign-double is currently only implemented in the -cc1 interface. But its declared in Options.td so it is a driver option too. But you try to use it with the driver you'll get a message about the option being unused. This patch teaches the driver to pass the option through to cc1 so it won't be unused. The Options.td says the option is x86 only but I didn't see any x86 specific code in its impementation in cc1 so not sure if the documentation is wrong or if I should only pass this option through the driver on x86 targets. Differential Revision: https://reviews.llvm.org/D59624 llvm-svn: 356706
* Add --unwindlib=[libgcc|compiler-rt] to parallel --rtlib= [take 2]Sterling Augustine2019-03-192-35/+96
| | | | | | | | | | | | | | | | | | | | "clang++ hello.cc --rtlib=compiler-rt" now can works without specifying additional unwind or exception handling libraries. This reworked version of the feature no longer modifies today's default unwind library for compiler-rt: which is nothing. Rather, a user can specify -DCLANG_DEFAULT_UNWINDLIB=libunwind when configuring the compiler. This should address the issues from the previous version. Update tests for new --unwindlib semantics. Differential Revision: https://reviews.llvm.org/D59109 llvm-svn: 356508
* [HIP-Clang] propagate -mllvm options to opt and llcAaron Enye Shi2019-03-151-0/+9
| | | | | | | | | | Change the HIP Toolchain to pass the OPT_mllvm options into OPT and LLC stages. Added a lit test to verify the command args. Reviewers: yaxunl Differential Revision: https://reviews.llvm.org/D59316 llvm-svn: 356277
* Fix invocation of Gold plugin with LTO after r355331Nemanja Ivanovic2019-03-131-1/+5
| | | | | | | | | | The above commit breaks the usage of PGO and LTO when -fprofile-use is supplied without a path. This patch changes the usage of this argument to be inline with its use in addPGOAndCoverageFlags(). Differential revision: https://reviews.llvm.org/D59304 llvm-svn: 356111
* Reland "[Remarks] Add -foptimization-record-passes to filter remark emission"Francis Visoiu Mistrih2019-03-122-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently we have -Rpass for filtering the remarks that are displayed as diagnostics, but when using -fsave-optimization-record, there is no way to filter the remarks while generating them. This adds support for filtering remarks by passes using a regex. Ex: `clang -fsave-optimization-record -foptimization-record-passes=inline` will only emit the remarks coming from the pass `inline`. This adds: * `-fsave-optimization-record` to the driver * `-opt-record-passes` to cc1 * `-lto-pass-remarks-filter` to the LTOCodeGenerator * `--opt-remarks-passes` to lld * `-pass-remarks-filter` to llc, opt, llvm-lto, llvm-lto2 * `-opt-remarks-passes` to gold-plugin Differential Revision: https://reviews.llvm.org/D59268 Original llvm-svn: 355964 llvm-svn: 355984
* Revert "[Remarks] Add -foptimization-record-passes to filter remark emission"Francis Visoiu Mistrih2019-03-122-16/+0
| | | | | | This reverts commit 20fff32b7d1f1a1bd417b22aa9f26ededd97a3e5. llvm-svn: 355976
* [Remarks] Add -foptimization-record-passes to filter remark emissionFrancis Visoiu Mistrih2019-03-122-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | Currently we have -Rpass for filtering the remarks that are displayed as diagnostics, but when using -fsave-optimization-record, there is no way to filter the remarks while generating them. This adds support for filtering remarks by passes using a regex. Ex: `clang -fsave-optimization-record -foptimization-record-passes=inline` will only emit the remarks coming from the pass `inline`. This adds: * `-fsave-optimization-record` to the driver * `-opt-record-passes` to cc1 * `-lto-pass-remarks-filter` to the LTOCodeGenerator * `--opt-remarks-passes` to lld * `-pass-remarks-filter` to llc, opt, llvm-lto, llvm-lto2 * `-opt-remarks-passes` to gold-plugin Differential Revision: https://reviews.llvm.org/D59268 llvm-svn: 355964
* [Driver] Support object files in addition to static and shared libraries in ↵Petr Hosek2019-03-125-16/+41
| | | | | | | | | | | | compiler-rt This change introduces support for object files in addition to static and shared libraries which were already supported which requires changing the type of the argument from boolean to an enum. Differential Revision: https://reviews.llvm.org/D56044 llvm-svn: 355891
* Remove esan.Nico Weber2019-03-115-22/+4
| | | | | | | | | | | It hasn't seen active development in years, and it hasn't reached a state where it was useful. Remove the code until someone is interested in working on it again. Differential Revision: https://reviews.llvm.org/D59133 llvm-svn: 355862
* Revert "[runtimes] Move libunwind, libc++abi and libc++ to lib/ and include/"Matthew Voss2019-03-083-7/+3
| | | | | | | | This broke the windows bots. This reverts commit 28302c66d2586074f77497d5dc4eac7182b679e0. llvm-svn: 355725
* [runtimes] Move libunwind, libc++abi and libc++ to lib/ and include/Petr Hosek2019-03-083-3/+7
| | | | | | | | | | | | | | | This change is a consequence of the discussion in "RFC: Place libs in Clang-dedicated directories", specifically the suggestion that libunwind, libc++abi and libc++ shouldn't be using Clang resource directory. Tools like clangd make this assumption, but this is currently not true for the LLVM_ENABLE_PER_TARGET_RUNTIME_DIR build. This change addresses that by moving the output of these libraries to lib/<target> and include/ directories, leaving resource directory only for compiler-rt runtimes and Clang builtin headers. Differential Revision: https://reviews.llvm.org/D59013 llvm-svn: 355665
* [HIP] Do not unbundle object files for -fno-gpu-rdcYaxun Liu2019-03-051-10/+13
| | | | | | | | | | | | | | | | When -fno-gpu-rdc is set, device code is compiled, linked, and assembled into fat binary and embedded as string in object files. The object files are normal object files which can be linked by host linker. In the linking stage, the object files should not be unbundled when -fno-gpu-rdc is set since they are normal object files, not bundles. The object files only need to be unbundled when -fgpu-rdc is set. Currently clang always unbundles object files, disregarding -fgpu-rdc option. This patch fixes that. Differential Revision: https://reviews.llvm.org/D58917 llvm-svn: 355410
* Order File Instrumentation: add clang support for -forder-file-instrumentationManman Ren2019-03-042-1/+13
| | | | | | | | When -forder-file-instrumentation is on, we pass llvm flag to enable the order file instrumentation pass. https://reviews.llvm.org/D58751 llvm-svn: 355333
* [PGO] Clang part of change for context-sensitive PGO (part1)Rong Xu2019-03-043-3/+60
| | | | | | | | | | Part 1 of CSPGO change in Clang. This includes changes in clang options and calls to llvm PassManager. Tests will be committed in part2. This change needs the PassManager change in llvm. Differential Revision: https://reviews.llvm.org/D54176 llvm-svn: 355331
* [clang] [ToolChains/NetBSD] Support relative libc++ header pathMichal Gorny2019-03-031-2/+18
| | | | | | | | | | | | | | | | | | | Support locating the libc++ header files relatively to the clang executable, in addition to the default system path. This is meant to cover two use cases: running just-built clang from the install directory, and running installed clang from non-standard location (e.g. /usr/local). This is the first step towards ensuring that tests of more LLVM projects can work out-of-the-box within the build tree, and use the correct set of headers (rather than e.g. mixing just-built clang+libcxx with system install of libcxx). It avoids requiring the user to hack around missing include paths, or LLVM build system to replicate system-specific C++ library defaults in order to append appropriate paths implicitly. Differential Revision: https://reviews.llvm.org/D58592 llvm-svn: 355282
* [WebAssembly] Temporarily disable bulk-memory with -pthreadThomas Lively2019-03-021-21/+1
| | | | | | | | | | | | | | | | | | | Summary: To prevent the instability of bulk-memory in the wasm backend from blocking separate pthread testing, temporarily remove the logic that adds -mbulk-memory in the presence of -pthread. Since browsers will ship bulk memory before or alongside threads, this change will be reverted as soon as bulk memory has stabilized in the backend. Reviewers: sbc100 Subscribers: dschuff, jgravelle-google, aheejin, sunfish, jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58854 llvm-svn: 355248
* [Driver] Allow enum SanitizerOrdinal to represent more than 64 different ↵Pierre Gousseau2019-03-012-109/+155
| | | | | | | | | | | | | | | sanitizer checks, NFC. enum SanitizerOrdinal has reached maximum capacity, this change extends the capacity to 128 sanitizer checks. This can eventually allow us to add gcc 8's options "-fsanitize=pointer-substract" and "-fsanitize=pointer-compare". This is a recommit of r354873 but with a fix for unqualified lookup error in lldb cmake build bot. Fixes: https://llvm.org/PR39425 Differential Revision: https://reviews.llvm.org/D57914 llvm-svn: 355190
* Fix file headers. NFCFangrui Song2019-03-015-5/+5
| | | | llvm-svn: 355176
* [WebAssembly] Remove uses of ThreadModelThomas Lively2019-02-284-42/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In the clang UI, replaces -mthread-model posix with -matomics as the source of truth on threading. In the backend, replaces -thread-model=posix with the atomics target feature, which is now collected on the WebAssemblyTargetMachine along with all other used features. These collected features will also be used to emit the target features section in the future. The default configuration for the backend is thread-model=posix and no atomics, which was previously an invalid configuration. This change makes the default valid because the thread model is ignored. A side effect of this change is that objects are never emitted with passive segments. It will instead be up to the linker to decide whether sections should be active or passive based on whether atomics are used in the final link. Reviewers: aheejin, sbc100, dschuff Subscribers: mehdi_amini, jgravelle-google, hiraditya, sunfish, steven_wu, dexonsmith, rupprecht, jfb, jdoerfert, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D58742 llvm-svn: 355112
* Partial revert of r353952: [HIP] Handle compile -m options and propagate ↵Yaxun Liu2019-02-281-2/+2
| | | | | | | | | | | | | | into LLC Remove comments and tests about passing -mcode-object-v3 to driver since it does not work. Other -m options are OK. Also put back -mattr=-code-object-v3 since HIP is still not ready for code object v3. Differential Revision: https://reviews.llvm.org/D57977 llvm-svn: 355106
* Use Secure PLT as default on NetBSD/PowerPC.Joerg Sonnenberger2019-02-271-1/+1
| | | | llvm-svn: 355033
* revert r354873 as this breaks lldb builds.Pierre Gousseau2019-02-262-155/+109
| | | | llvm-svn: 354875
* [Driver] Allow enum SanitizerOrdinal to represent more than 64 different ↵Pierre Gousseau2019-02-262-109/+155
| | | | | | | | | | | | | sanitizer checks, NFC. enum SanitizerOrdinal has reached maximum capacity, this change extends the capacity to 128 sanitizer checks. This can eventually allow us to add gcc 8's options "-fsanitize=pointer-substract" and "-fsanitize=pointer-compare". Fixes: https://llvm.org/PR39425 Differential Revision: https://reviews.llvm.org/D57914 llvm-svn: 354873
OpenPOWER on IntegriCloud