summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
...
* Re-land "Add an -fno-temp-file flag for compilation"Hans Wennborg2019-12-191-0/+1
| | | | | | | | This time making sure to initialize FrontendOptions::UseTemporary. Patch by Zachary Henkel! Differential revision: https://reviews.llvm.org/D70615
* [clang] Remove -Wexperimental-float-control.Jordan Rupprecht2019-12-181-8/+0
| | | | | | | | | | | | | | Summary: Per D62731, the behavior of clang with `-frounding-math` is no worse than when the rounding flag was completely ignored, so remove this unnecessary warning. Reviewers: mibintc, chandlerc, echristo, rjmccall, kpn, erichkeane, rsmith, andrew.w.kaylor Reviewed By: mibintc Subscribers: merge_guards_bot, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71671
* [Remarks][Driver] Place temporary remark files next to temporary object filesFrancis Visoiu Mistrih2019-12-181-11/+18
| | | | | | | | | | | On Darwin, when used for generating a linked binary from a source file (through an intermediate object file), the driver will invoke `cc1` to generate a temporary object file. The temporary remark file will now be emitted next to the object file, which will then be picked up by `dsymutil` and emitted in the .dSYM bundle. This is available for all formats except YAML since by default, YAML doesn't need a section and the remark file will be lost.
* [Remarks][Driver] Run dsymutil when remarks are enabledFrancis Visoiu Mistrih2019-12-181-2/+3
| | | | | | | | | When clang is invoked with a source file without -c or -S, it creates a cc1 job, a linker job and if debug info is requested, a dsymutil job. In case of remarks, we should also create a dsymutil job to avoid losing the remarks that will be generated in a tempdir that gets removed. Differential Revision: https://reviews.llvm.org/D71675
* [Remarks][Driver][NFC] Make shouldEmitRemarks more available in the DriverFrancis Visoiu Mistrih2019-12-182-25/+25
| | | | Move the function to Driver.h so that it can be re-used in other places.
* Revert "Add an -fno-temp-file flag for compilation"Mitch Phillips2019-12-181-1/+0
| | | | | | | This reverts commit d129aa1d5369781deff6c6b854cb612e160d3fb2. This broke the MSan buildbots. More information available in the original PR: https://reviews.llvm.org/D70615
* Add an -fno-temp-file flag for compilationHans Wennborg2019-12-181-0/+1
| | | | | | | | | | | | Our build system does not handle randomly named files created during the build well. We'd prefer to write compilation output directly without creating a temporary file. Function parameters already existed to control this behavior but were not exposed all the way out to the command line. Patch by Zachary Henkel! Differential revision: https://reviews.llvm.org/D70615
* [Driver] Avoid copies in range-based for loopsMark de Wever2019-12-172-2/+2
| | | | | | This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall. Differential Revision: https://reviews.llvm.org/D71527
* [Clang FE, SystemZ] Recognize -mpacked-stack CL optionJonas Paulsson2019-12-171-0/+2
| | | | | | | | | | | Recognize -mpacked-stack from the command line and add a function attribute "mpacked-stack" when passed. This is needed for building the Linux kernel. If this option is passed for any other target than SystemZ, an error is generated. Review: Ulrich Weigand https://reviews.llvm.org/D71441
* [driver][darwin] Pass -platform_version flag to the linker instead of the ↵Alex Lorenz2019-12-172-1/+50
| | | | | | | | | | | -<platform>_version_min flag In Xcode 11, ld added a new flag called -platform_version that can be used instead of the old -<platform>_version_min flags. The new flag allows Clang to pass the SDK version from the driver to the linker. This patch adopts the new -platform_version flag in Clang, and starts using it by default, unless a linker version < 520 is passed to the driver. Differential Revision: https://reviews.llvm.org/D71579
* [MinGW] Implicitly add .exe suffix if not providedMartin Storsjö2019-12-171-1/+13
| | | | | | | | | | | | | | | | | GCC implicitly adds an .exe suffix if it is given an output file name, but the file name doesn't contain a suffix, and there are certain users of GCC that rely on this behaviour (and run into issues when trying to use Clang instead of GCC). And MSVC's cl.exe also does the same (but not link.exe). However, GCC only does this when actually running on windows, not when operating as a cross compiler. As GCC doesn't have this behaviour when cross compiling, we definitely shouldn't introduce the behaviour in such cases (as it would break at least as many cases as this fixes). Differential Revision: https://reviews.llvm.org/D71400
* [clang][SystemZ] Add support for -march=nativeUlrich Weigand2019-12-163-5/+18
| | | | | | Handle -march=native in systemz::getSystemZTargetCPU, similar to how this is done on other platforms. Also change the return type to std::string instead of const char *.
* [Driver] Default to -momit-leaf-frame-pointer for AArch64Fangrui Song2019-12-131-3/+3
| | | | | | | | | | | | | | | | | This matches https://gcc.gnu.org/onlinedocs/gcc/AArch64-Options.html > -momit-leaf-frame-pointer > -mno-omit-leaf-frame-pointer > > Omit or keep the frame pointer in leaf functions. The former behavior is the default. -mno-omit-leaf-frame-pointer is currently a no-op because TargetOptions::DisableFramePointerElim is only considered for non-leaf functions. Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D71167
* [Driver] Use .init_array for all gcc installations and simplify Generic_ELF ↵Fangrui Song2019-12-133-17/+14
| | | | | | | | | | | | | | | | | -fno-use-init-array rules D39317 made clang use .init_array when no gcc installations is found. This change changes all gcc installations to use .init_array . GCC 4.7 by default stopped providing .ctors/.dtors compatible crt files, and stopped emitting .ctors for __attribute__((constructor)). .init_array should always work. FreeBSD rules are moved to FreeBSD.cpp to make Generic_ELF rules clean. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D71434
* Default to -fuse-init-arrayFangrui Song2019-12-128-14/+27
| | | | | | | | | | | | | | | | | | | Very few ELF platforms still use .ctors/.dtors now. Linux (glibc: 1999-07), DragonFlyBSD, FreeBSD (2012-03) and Solaris have supported .init_array for many years. Some architectures like AArch64/RISC-V default to .init_array . GNU ld and gold can even convert .ctors to .init_array . It makes more sense to flip the CC1 default, and only uses -fno-use-init-array on platforms that don't support .init_array . For example, OpenBSD did not support DT_INIT_ARRAY before Aug 2016 (https://github.com/openbsd/src/commit/86fa57a2792c6374b0849dd7b818a11e676e60ba) I may miss some ELF platforms that still use .ctors, but their maintainers can easily diagnose such problems. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D71393
* [Remarks][Driver] Ask for line tables when remarks are enabledFrancis Visoiu Mistrih2019-12-111-0/+5
| | | | | | | | | | | | | | | | Serialized remarks contain debug locations for each remark, by storing a file path, a line, and a column. Also, remarks support being embedded in a .dSYM bundle using a separate section in object files, that is found by `dsymutil` through the debug map. In order for tools to map addresses to source and display remarks in the source, we need line tables, and in order for `dsymutil` to find the object files containing the remark section, we need to keep the debug map around. Differential Revision: https://reviews.llvm.org/D71325
* [OpenMP] Use the OpenMP-IR-BuilderJohannes Doerfert2019-12-111-0/+1
| | | | | | | | | | | | | | | This is a follow up patch to use the OpenMP-IR-Builder, as discussed on the mailing list ([1] and later) and at the US Dev Meeting'19. [1] http://lists.flang-compiler.org/pipermail/flang-dev_lists.flang-compiler.org/2019-May/000197.html Reviewers: kiranchandramohan, ABataev, RaviNarayanaswamy, gtbercea, grokos, sdmitriev, JonChesterfield, hfinkel, fghanim Subscribers: ppenzin, penzn, llvm-commits, cfe-commits, jfb, guansong, bollu, hiraditya, mgorny Tags: #clang Differential Revision: https://reviews.llvm.org/D69922
* [DWARF5][SplitDwarf] Set default state for -fsplit-dwarf-inlining to be false.Alexey Lapshin2019-12-111-1/+1
| | | | | | | | | The -fsplit-dwarf-inlining option does not conform to DWARF5 standard. It creates children for Skeleton compilation unit. We need default behavior to be DWARF5 compatible. Thus set default state for -fsplit-dwarf-inlining into "false". Differential Revision: https://reviews.llvm.org/D71304
* [Remarks][Driver] Error on -foptimization-record-file with multiple -arch ↵Francis Visoiu Mistrih2019-12-091-79/+128
| | | | | | | | | options This adds a check for the usage of -foptimization-record-file with multiple -arch options. This is not permitted since it would require us to rename the file requested by the user to avoid overwriting it for the second cc1 invocation.
* [clang][IFS] Allow 2 output files when using -o and -c with clang IFS stubs.Puyan Lotfi2019-12-092-7/+26
| | | | | | | | | | | | | | | | | | | | | | | | This patch allows for -o to be used with -c when compiling with clang interface stubs enabled. This is because the second file will be an intermediate ifs stubs file that is the text stub analog of the .o file. Both get produces in this case, so two files. Why are we doing this? Because we want to support the case where interface stubs are used bu first invoking clang like so: clang -c <other flags> -emit-interface-stubs foo.c -o foo.o ... clang -emit-interface-stubs <.o files> -o libfoo.so This should generate N .ifs files, and one .ifso file. Prior to this patch, using -o with the -c invocation was not possible. Currently the clang driver supports generating a a.out/.so file at the same time as a merged ifs file / ifso file, but this is done by checking that the final job is the IfsMerge job. When -c is used, the final job is a Compile job so what this patch does is check to figure out of the job type is TY_IFS_CPP. Differential Revision: https://reviews.llvm.org/D70763
* Reland 198fbcb8, "Driver: Don't look for libc++ headers in the install ↵Peter Collingbourne2019-12-091-11/+16
| | | | | | | | | | | | | | | | | | | | | | directory on Android.", which was reverted in b3249027. Fixed the test case to set --sysroot, which lets it succeed in the case where a directory named "/usr/include/c++/v1" or "/usr/local/include/c++/v1" exists. Original commit message: > The NDK uses a separate set of libc++ headers in the sysroot. Any headers > in the installation directory are not going to work on Android, not least > because they use a different name for the inline namespace (std::__1 instead > of std::__ndk1). > > This effectively makes it impossible to produce a single toolchain that is > capable of targeting both Android and another platform that expects libc++ > headers to be installed in the installation directory, such as Mac. > > In order to allow this scenario to work, stop looking for headers in the > install directory on Android. Differential Revision: https://reviews.llvm.org/D71154
* Revert "Driver: Don't look for libc++ headers in the install directory on ↵David Zarzycki2019-12-081-16/+11
| | | | | | | | Android." This reverts commit 198fbcb817492ff45946e3f7517de15e8cdf0607. This breaks Fedora 31.
* Driver: Don't look for libc++ headers in the install directory on Android.Peter Collingbourne2019-12-061-11/+16
| | | | | | | | | | | | | | | | The NDK uses a separate set of libc++ headers in the sysroot. Any headers in the installation directory are not going to work on Android, not least because they use a different name for the inline namespace (std::__1 instead of std::__ndk1). This effectively makes it impossible to produce a single toolchain that is capable of targeting both Android and another platform that expects libc++ headers to be installed in the installation directory, such as Mac. In order to allow this scenario to work, stop looking for headers in the install directory on Android. Differential Revision: https://reviews.llvm.org/D71154
* clang/AMDGPU: Fix default for frame-pointer attributeMatt Arsenault2019-12-071-0/+2
| | | | Enabling optimization should allow frame pointer elimination.
* [AMDGPU][HIP] Improve opt-level handlingScott Linder2019-12-051-23/+38
| | | | | | | | | | | | | | | | | Summary: The HIP toolchain invokes `llc` without an explicit opt-level, meaning it always uses the default (-O2). This makes it impossible to use -O1, for example. The HIP toolchain also coerces -Os/-Oz to -O2 even when invoking opt, and it coerces -Og to -O2 rather than -O1. Forward the opt-level to `llc` as well as `opt`, and only coerce levels where it is required. Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70987
* Also check /Fo when deciding on the .gcna / .gcda filename (PR44208)Hans Wennborg2019-12-051-1/+3
| | | | Differential revision: https://reviews.llvm.org/D71012
* Reapply af57dbf12e54 "Add support for options -frounding-math, ↵Melanie Blower2019-12-051-9/+196
| | | | | | | | | | | | ftrapping-math, -ffp-model=, and -ffp-exception-behavior=" Patch was reverted because https://bugs.llvm.org/show_bug.cgi?id=44048 The original patch is modified to set the strictfp IR attribute explicitly in CodeGen instead of as a side effect of IRBuilder. In the 2nd attempt to reapply there was a windows lit test fail, the tests were fixed to use wildcard matching. Differential Revision: https://reviews.llvm.org/D62731
* [clang][IFS] Ignoring -Xlinker/-Xclang arguments in InterfaceStubs pass for now.Puyan Lotfi2019-12-041-0/+2
| | | | | | | | | | | Many of the inputs to clang driver toolchain tools can be things other than files such as -Xclang and -Xlinker arguments. For now we don't take such tool pass-through type arguments (although having an -Xifs would be nice to have to replace things like -emit-merged-ifs). So because for the moment we are not doing any sort of argument pass-through, I am going to have InterfaceStubs Merger ignore any non-file type input arguments. Differential Revision: https://reviews.llvm.org/D70838
* Revert " Reapply af57dbf12e54 "Add support for options ↵Melanie Blower2019-12-041-196/+9
| | | | | | | -frounding-math, ftrapping-math, -ffp-model=, and -ffp-exception-behavior="" This reverts commit cdbed2dd856c14687efd741c2d8321686102acb8. Build break on Windows (lit fail)
* Reapply af57dbf12e54 "Add support for options -frounding-math, ↵Melanie Blower2019-12-041-9/+196
| | | | | | | | | | ftrapping-math, -ffp-model=, and -ffp-exception-behavior=" Patch was reverted because https://bugs.llvm.org/show_bug.cgi?id=44048 The original patch is modified to set the strictfp IR attribute explicitly in CodeGen instead of as a side effect of IRBuilder Differential Revision: https://reviews.llvm.org/D62731
* [HIP] Remove opencl.amdgcn.libYaxun (Sam) Liu2019-12-041-3/+2
| | | | Differential Revision: https://reviews.llvm.org/D70980
* [WebAssembly] Find wasm-opt with GetProgramPathDan Gohman2019-12-021-4/+4
| | | | | | | Instead of just searching for wasm-opt in PATH, use GetProgramPath, which checks the `COMPILER_PATH` environment variable, -B paths, and `PATH`. Differential Revision: https://reviews.llvm.org/D70780
* Add AIX assembler supportstevewan2019-12-022-5/+74
| | | | | | | | | | | | | | | | Summary: A skeleton of AIX toolchain and system linker support has been introduced in D68340, and this is a follow on patch to it. This patch adds support to system assembler invocation to the AIX toolchain. Reviewers: daltenty, hubert.reinterpretcast, jasonliu, Xiangling_L, dlj Reviewed By: daltenty, hubert.reinterpretcast Subscribers: wuzish, nemanjai, kbarton, jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69620
* Revert "[ARM] Allocatable Global Register Variables for ARM"Carey Williams2019-11-291-33/+5
| | | | This reverts commit 2d739f98d8a53e38bf9faa88cdb6b0c2a363fb77.
* [Clang] Bypass distro detection on non-Linux hostsAlexandre Ganea2019-11-284-6/+25
| | | | | | Skip distro detection when we're not running on Linux, or when the target triple is not Linux. This saves a few OS calls for each invocation of clang.exe. Differential Revision: https://reviews.llvm.org/D70467
* [ConstExprPreter] Removed the flag forcing the use of the interpreterNandor Licker2019-11-271-3/+0
| | | | | | | | | | | | | | | | | | | Summary: Removed the ```-fforce-experimental-new-constant-interpreter flag```, leaving only the ```-fexperimental-new-constant-interpreter``` one. The interpreter now always emits an error on an unsupported feature. Allowing the interpreter to bail out would require a mapping from APValue to interpreter memory, which will not be necessary in the final version. It is more sensible to always emit an error if the interpreter fails. Reviewers: jfb, Bigcheese, rsmith, dexonsmith Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70071
* [Fuchsia] Don't fail for unknown architecturesPetr Hosek2019-11-261-3/+2
| | | | | | | | When selecting the set of default sanitizers, don't fail for unknown architectures. This may be the case e.g. with x86_64-unknown-fuchsia -m32 target that's used to build the bootloader. Differential Revision: https://reviews.llvm.org/D70747
* Initial implementation of -fmacro-prefix-map and -ffile-prefix-mapDan McGregor2019-11-263-2/+49
| | | | | | | | | GCC 8 implements -fmacro-prefix-map. Like -fdebug-prefix-map, it replaces a string prefix for the __FILE__ macro. -ffile-prefix-map is the union of -fdebug-prefix-map and -fmacro-prefix-map Reviewed By: rnk, Lekensteyn, maskray Differential Revision: https://reviews.llvm.org/D49466
* [WebAssembly] Change the llvm-lto dir to use the LLVM VersionDan Gohman2019-11-251-11/+17
| | | | | | | | | Using the version instead of the VCS revision, which isn't available when LLVM_APPEND_VC_REV is set. The bitcode format should be backwards-compatible at least within a minor version, so the version string should be sufficient. Differential Revision: https://reviews.llvm.org/D70677
* [Driver] Fix incorrect GNU triplet for PowerPC on SUSE LinuxAaron Puchert2019-11-231-1/+3
| | | | | | | | | | | | | | | Summary: On SUSE distributions for 32-bit PowerPC, gcc is configured as a 64-bit compiler using the GNU triplet "powerpc64-suse-linux", but invoked with "-m32" by default. Thus, the correct GNU triplet for 32-bit PowerPC SUSE distributions is "powerpc64-suse-linux" and not "powerpc-suse-linux". Reviewers: jrtc27, nemanjai, glaubitz Reviewed By: nemanjai Differential Revision: https://reviews.llvm.org/D55326
* [WebAssembly] Use wasm-opt and LTO libraries when available.Dan Gohman2019-11-221-0/+36
| | | | | | | | | | When there's a wasm-opt in the PATH, run the it to optimize LLVM's output. This fixes PR43796. And, add an "llvm-lto" directory to the sysroot library search paths, so that sysroots can provide LTO-enabled system libraries. Differential Revision: https://reviews.llvm.org/D70500
* [Driver] Make -static-libgcc imply static libunwindJosh Kunz2019-11-221-1/+4
| | | | | | | | | | | | | | | | | | In the GNU toolchain, `-static-libgcc` implies that the unwindlib will be linked statically. However, when `--unwindlib=libunwind`, this flag is ignored, and a bare `-lunwind` is added to the linker args. Unfortunately, this means that if both `libunwind.so`, and `libunwind.a` are present in the library path, `libunwind.so` will be chosen in all cases where `-static` is not set. This change makes `-static-libgcc` affect the `-l` flag produced by `--unwindlib=libunwind`. After this patch, providing `-static-libgcc --unwindlib=libunwind` will cause the driver to explicitly emit `-l:libunwind.a` to statically link libunwind. For all other cases it will emit `-l:libunwind.so` matching current behavior with a more explicit link line. https://reviews.llvm.org/D70416
* [RISCV] Use compiler-rt if no GCC installation detectedEdward Jones2019-11-222-3/+29
| | | | | | | | If a GCC installation is not detected, then this attempts to use compiler-rt and the compiler-rt crtbegin/crtend implementations as a fallback. Differential Revision: https://reviews.llvm.org/D68407
* [RISCV] Support mutilib in baremetal environmentZakk Chen2019-11-212-3/+87
| | | | | | | | | | | | 1. Currently only support the set of multilibs same to riscv-gnu-toolchain. 2. Fix testcase typo causes fail on Windows. 3. Fix testcases to set empty sysroot. Reviewers: espindola, asb, kito-cheng, lenary Reviewed By: lenary Differential Revision: https://reviews.llvm.org/D67508
* [Clang] Enable RISC-V support for FuchsiaPetr Hosek2019-11-211-3/+11
| | | | | | | | We don't have a full sysroot yet, so for now we only include compiler support and compiler-rt builtins, the rest of the runtimes will get enabled later. Differential Revision: https://reviews.llvm.org/D70477
* [PowerPC] Add new Future CPU for PowerPCStefan Pintilie2019-11-211-0/+1
| | | | | | | | | | | This patch will add -mcpu=future into clang for PowerPC. A CPU type is required for work that may possibly be enabled for some future Power CPU. The CPU type future will serve that purpose. This patch introduces no new functionality. It is an incremental patch on top of which Power PC work for some future CPU can be done. Differential Revision: https://reviews.llvm.org/D70262
* Fix compilation warning. NFC.Michael Liao2019-11-211-1/+1
|
* Revert "[RISCV] Support mutilib in baremetal environment"Zakk Chen2019-11-212-87/+3
| | | | | This reverts commit df876a026981b7a125b31bbb85ba4b1144edb0f9. Clang::riscv32-toolchain.c Clang::riscv64-toolchain.c fails on Windows.
* Reland 9f3fdb0d7fab: [Driver] Use VFS to check if sanitizer blacklists existIlya Biryukov2019-11-212-8/+8
| | | | | | | With updates to various LLVM tools that use SpecialCastList. It was tempting to use RealFileSystem as the default, but that makes it too easy to accidentally forget passing VFS in clang code.
* Revert "[Driver] Use VFS to check if sanitizer blacklists exist"Ilya Biryukov2019-11-212-8/+8
| | | | | This reverts commit ba6f906854263375cff3257d22d241a8a259cf77. Commit caused compilation errors on llvm tests. Will fix and re-land.
OpenPOWER on IntegriCloud