summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
...
* Add flag to request Clang is ABI-compatible with older versions of itselfRichard Smith2017-08-261-0/+3
| | | | | | | | | | | | | | | | | | This patch adds a flag -fclang-abi-compat that can be used to request that Clang attempts to be ABI-compatible with some older version of itself. This is provided on a best-effort basis; right now, this can be used to undo the ABI change in r310401, reverting Clang to its prior C++ ABI for pass/return by value of class types affected by that change, and to undo the ABI change in r262688, reverting Clang to using integer registers rather than SSE registers for passing <1 x long long> vectors. The intent is that we will maintain this backwards compatibility path as we make ABI-breaking fixes in future. The reversion to the old behavior for r310401 is also applied to the PS4 target since that change is not part of its platform ABI (which is essentially to do whatever Clang 3.2 did). llvm-svn: 311823
* Revert "[SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer"Matt Morehouse2017-08-251-3/+2
| | | | | | This reverts r311801 due to a bot failure. llvm-svn: 311803
* [SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzerMatt Morehouse2017-08-251-2/+3
| | | | | | | | | | | | | | | | | Summary: - Don't sanitize __sancov_lowest_stack. - Don't instrument leaf functions. - Add CoverageStackDepth to Fuzzer and FuzzerNoLink. Reviewers: vitalybuka, kcc Reviewed By: kcc Subscribers: cfe-commits, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D37156 llvm-svn: 311801
* Expose -mllvm -accurate-sample-profile to clang.Dehao Chen2017-08-241-0/+4
| | | | | | | | | | | | | | Summary: With accurate sample profile, we can do more aggressive size optimization. For some size-critical application, this can reduce the text size by 20% Reviewers: davidxl, rsmith Reviewed By: davidxl, rsmith Subscribers: mehdi_amini, eraman, sanjoy, cfe-commits Differential Revision: https://reviews.llvm.org/D37091 llvm-svn: 311707
* [mips] Introducing option -mabs=[legacy/2008]Petar Jovanovic2017-08-241-0/+22
| | | | | | | | | | | | | | | | | In patch r205628 using abs.[ds] instruction is forced, as they should behave in accordance with flags Has2008 and ABS2008. Unfortunately for revisions prior mips32r6 and mips64r6, abs.[ds] is not generating correct result when working with NaNs. To generate a sequence which always produce a correct result but also to allow user more control on how his code is compiled, option -mabs is added where user can choose legacy or 2008. By default legacy mode is used on revisions prior R6. Mips32r6 and mips64r6 use abs2008 mode by default. Patch by Aleksandar Beserminji Differential Revision: https://reviews.llvm.org/D35982 llvm-svn: 311669
* [Driver] Register effective triple before get arm float abi.Leo Li2017-08-241-0/+2
| | | | | | | | | | | | | | | | Summary: We need to register effective triple before calling `getARMFloatABI`. Add missing code when `--print-libgcc-file-name` is passed. Reviewers: atanasyan, rsmith, mgorny, peter.smith, kristof.beyls, compnerd, jroelofs Reviewed By: compnerd Subscribers: llvm-commits, aemerson, javed.absar, srhines, kristof.beyls, pirama Differential Revision: https://reviews.llvm.org/D35742 llvm-svn: 311624
* Revert r311552: [Bash-autocompletion] Add support for static analyzer flagsRui Ueyama2017-08-231-10/+1
| | | | | | This reverts commit r311552 because it broke ubsan and asan bots. llvm-svn: 311557
* [Bash-autocompletion] Add support for static analyzer flagsYuka Takahashi2017-08-231-1/+10
| | | | | | | | | | | | | | | | | | | | | | Summary: This is a patch for clang autocomplete feature. It will collect values which -analyzer-checker takes, which is defined in clang/StaticAnalyzer/Checkers/Checkers.inc, dynamically. First, from ValuesCode class in Options.td, TableGen will generate C++ code in Options.inc. Options.inc will be included in DriverOptions.cpp, and calls OptTable's addValues function. addValues function will add second argument to Option's Values class. Values contains string like "foo,bar,.." which is handed to Values class in OptTable. Reviewers: v.g.vassilev, teemperor, ruiu Subscribers: hiraditya, cfe-commits Differential Revision: https://reviews.llvm.org/D36782 llvm-svn: 311552
* bpf: add -mcpu=# support for bpfYonghong Song2017-08-231-0/+2
| | | | | | | | | | | | | | | | | | | | | -mcpu=# will support: . generic: the default insn set . v1: insn set version 1, the same as generic . v2: insn set version 2, version 1 + additional jmp insns . probe: the compiler will probe the underlying kernel to decide proper version of insn set. Examples: $ clang -target bpf -mcpu=v1 -c t.c $ clang -target bpf -mcpu=v2 -c t.c $ clang -target bpf -mcpu=generic -c t.c $ clang -target bpf -mcpu=probe -c t.c $ clang -target bpf -mcpu=v3 -c t.c error: unknown target CPU 'v3' Signed-off-by: Yonghong Song <yhs@fb.com> Acked-by: Alexei Starovoitov <ast@kernel.org> llvm-svn: 311523
* Revert "Revert "Revert "Revert "Fix LLVMgold plugin name/path for non-Linux.""""Dan Albert2017-08-221-2/+14
| | | | | | | With tests fixed for Windows style paths now that they are going through path canonicalization. llvm-svn: 311487
* [mips] Rename getSupportedNanEncoding() to getIEEE754Standard()Petar Jovanovic2017-08-222-25/+26
| | | | | | | | | | | Rename the function getSupportedNanEncoding() to getIEEE754Standard(), since this function will be used for non-nan related features. Patch by Aleksandar Beserminji. Differential Revision: https://reviews.llvm.org/D36824 llvm-svn: 311454
* Test fix: only add shared libraries to rpath.George Karpenkov2017-08-221-1/+1
| | | | llvm-svn: 311422
* Moving libFuzzer to compiler-rt: required updates to the Clang driver.George Karpenkov2017-08-213-33/+16
| | | | | | Differential Revision: https://reviews.llvm.org/D36909 llvm-svn: 311406
* [Driver][Darwin] Do not pass -munwind-table if -fno-excpetions isAkira Hatanaka2017-08-211-1/+6
| | | | | | | | | | | | supplied. With this change, -fno-exceptions disables unwind tables unless -funwind-tables is supplied too or the target is x86-64 (x86-64 requires emitting unwind tables). rdar://problem/33934446 llvm-svn: 311397
* [Driver] Recognize DevDiv internal builds of MSVC, with a different ↵Stephan T. Lavavej2017-08-212-26/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | directory structure. This is a reasonably non-intrusive change, which I've verified works for both x86 and x64 DevDiv-internal builds. The idea is to change `bool IsVS2017OrNewer` into a 3-state `ToolsetLayout VSLayout`. Either a build is DevDiv-internal, released VS 2017 or newer, or released VS 2015 or older. When looking at the directory structure, if instead of `"VC"` we see `"x86ret"`, `"x86chk"`, `"amd64ret"`, or `"amd64chk"`, we recognize this as a DevDiv-internal build. After we get past the directory structure validation, we use this knowledge to regenerate paths appropriately. `llvmArchToDevDivInternalArch()` knows how we use `"i386"` subdirectories, and `MSVCToolChain::getSubDirectoryPath()` uses that. It also knows that DevDiv-internal builds have an `"inc"` subdirectory instead of `"include"`. This may still not be the "right" fix in any sense, but I believe that it's non-intrusive in the sense that if the special directory names aren't found, no codepaths are affected. (`ToolsetLayout::OlderVS` and `ToolsetLayout::VS2017OrNewer` correspond to `IsVS2017OrNewer` being `false` or `true`, respectively.) I searched for all references to `IsVS2017OrNewer`, which are places where Clang cares about VS's directory structure, and the only one that isn't being patched is some logic to deal with cross-compilation. I'm fine with that not working for DevDiv-internal builds for the moment (we typically test the native compilers), so I added a comment. Fixes D36860. llvm-svn: 311391
* Enable libfuzzer on NetBSD/amd64Kamil Rytarowski2017-08-211-0/+2
| | | | | | | | | | | | | | | | | | | Summary: Enable SanitizerKind::Fuzzer and SanitizerKind::FuzzerNoLink on x86_64. Sponsored by <The NetBSD Foundation> Reviewers: joerg, kcc, vitalybuka, george.karpenkov Reviewed By: vitalybuka Subscribers: cfe-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36935 llvm-svn: 311365
* [mips] Remove checking of the redundant condition. NFCSimon Atanasyan2017-08-211-2/+1
| | | | llvm-svn: 311334
* [ARM][AArch64] Cortex-A75 and Cortex-A55 testsSam Parker2017-08-211-0/+11
| | | | | | | | | | | | | | | | | | Add frontend tests for Cortex-A75 and Cortex-A55, Arm's latest big.LITTLE A-class cores. They implement the ARMv8.2-A architecture, including the cryptography and RAS extensions, plus the optional dot product extension. They also implement the RCpc AArch64 extension from ARMv8.3-A. Cortex-A75: https://developer.arm.com/products/processors/cortex-a/cortex-a75 Cortex-A55: https://developer.arm.com/products/processors/cortex-a/cortex-a55 Differential Revision: https://reviews.llvm.org/D36731 llvm-svn: 311319
* [SanitizerCoverage] Add stack depth tracing instrumentation.Matt Morehouse2017-08-181-5/+12
| | | | | | | | | | | | | | | | | | | | | | Summary: Augment SanitizerCoverage to insert maximum stack depth tracing for use by libFuzzer. The new instrumentation is enabled by the flag -fsanitize-coverage=stack-depth and is compatible with the existing trace-pc-guard coverage. The user must also declare the following global variable in their code: thread_local uintptr_t __sancov_lowest_stack https://bugs.llvm.org/show_bug.cgi?id=33857 Reviewers: vitalybuka, kcc Reviewed By: vitalybuka Subscribers: kubamracek, hiraditya, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D36839 llvm-svn: 311186
* Revert r311137 (GlobalISel ABI commit).Tim Northover2017-08-181-1/+1
| | | | | | | It was committed by mistake since it was in the same monorepo as the LLVM change I was working on. llvm-svn: 311140
* GlobalISel (AArch64): fix ABI at border between GPRs and SP.Tim Northover2017-08-171-1/+1
| | | | | | | | If a struct would end up half in GPRs and half on SP the ABI says it should actually go entirely on the stack. We were getting this wrong in GlobalISel before, causing compatibility issues. llvm-svn: 311137
* Base optimization-record file names on the final outputHal Finkel2017-08-161-4/+7
| | | | | | | | | | | | | | Using Output.getFilename() to construct the file name used for optimization recording in Clang::ConstructJob, when -c is provided, does not work correctly if we're not using the integrated assembler. With -no-integrated-as (or -save-temps) Output.getFilename() gives the name of the temporary assembly file, not the final output file. Instead, use the final output (as provided by -o). If this is not available, then fall back to using a name based on the input file. Fixes PR31532. llvm-svn: 311041
* [Driver] SafeStack does not need a runtime library on FuchsiaPetr Hosek2017-08-161-0/+5
| | | | | | | | Patch by Roland McGrath Differential Revision: https://reviews.llvm.org/D36779 llvm-svn: 311034
* Revert "Revert "Revert "Fix LLVMgold plugin name/path for non-Linux."""Dan Albert2017-08-151-14/+2
| | | | llvm-svn: 310977
* Revert "Revert "Fix LLVMgold plugin name/path for non-Linux.""Dan Albert2017-08-151-2/+14
| | | | | | | | | | | | | | | | | | | Summary: Relanding https://reviews.llvm.org/D35739 which was reverted because it broke the tests on non-Linux. The tests have been fixed to be platform agnostic, and additional tests have been added to make sure that the plugin has the correct extension on each platform (%pluginext doesn't work in CHECK lines). Reviewers: srhines, pirama Reviewed By: srhines Subscribers: emaste, mehdi_amini, eraman, cfe-commits Differential Revision: https://reviews.llvm.org/D36769 llvm-svn: 310960
* Revert "Fix LLVMgold plugin name/path for non-Linux."Dan Albert2017-08-151-14/+2
| | | | | | Broke a test. Will fix the test and re-land later. llvm-svn: 310903
* Fix LLVMgold plugin name/path for non-Linux.Dan Albert2017-08-141-2/+14
| | | | | | | | | | | | | | | | | | Summary: It's only named LLVMgold.so on Linux. Fix the name for Windows and Darwin. Also fix the path for Windows so binutils doesn't have to. Reviewers: srhines, pirama Reviewed By: srhines Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D35739 llvm-svn: 310895
* Fix memory leak in ToolChain::TranslateOpenMPTargetArgsJonas Hahnfeld2017-08-141-1/+5
| | | | | | | rL310433 introduced a code path where DAL is not returned and must be freed. This change allows to run openmp-offload.c when Clang is built with ASan. llvm-svn: 310817
* [AArch64] Add support for a MinGW AArch64 targetMartin Storsjo2017-08-132-3/+20
| | | | | | Differential Revision: https://reviews.llvm.org/D36364 llvm-svn: 310798
* Add -fsanitize=fuzzer-no-link flag to the driver.George Karpenkov2017-08-113-2/+7
| | | | | | | | | | | The flag will perform instrumentation necessary to the fuzzing, but will NOT link libLLVMFuzzer.a library. Necessary when modifying CFLAGS for projects which may produce executables as well as a fuzzable target. Differential Revision: https://reviews.llvm.org/D36600 llvm-svn: 310733
* [OpenMP] Enable previously successful offloading tests.Gheorghe-Teodor Bercea2017-08-112-1/+14
| | | | | | | | | | | | Create a separate test file to contain all tests for OpenMP offloading to GPUs. Make libdevice checking more robust by accounting for the case in which no libdevice is found. This changes are in connrection with diff: D29660 llvm-svn: 310718
* [mips] Support implicit gpopt with N64 when using -fno-picSimon Dardis2017-08-111-0/+13
| | | | | | | | | | | As clang defaults to -mno-abicalls when using -fno-pic for N64, implicitly use -mgpopt in that case. Reviewers: atanasyan Differential Revision: https://reviews.llvm.org/D36315 llvm-svn: 310714
* Revert r310057Stefan Maksimovic2017-08-111-0/+2
| | | | | | | | Bring back changes which r304953 introduced since they were in fact not the cause of failures described in r310057 commit message. llvm-svn: 310702
* Enable bunch of sanitizers on NetBSD/X86 and X86_64Kamil Rytarowski2017-08-101-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Enable more sanitizers: - i386 and amd64: * SanitizerKind::Vptr; * SanitizerKind::Leak; * SanitizerKind::SafeStack; * SanitizerKind::Function; - amd64 only: * SanitizerKind::Thread; These sanitizers are in the process of upstreaming to LLVM projects. Sponsored by <The NetBSD Foundation> Reviewers: joerg, dim, vitalybuka, kcc, filcab, fjricci Reviewed By: vitalybuka Subscribers: #sanitizers, cfe-commits Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36482 llvm-svn: 310649
* [OpenMP] Delete tests in openmp-offload.c which cuase failuresGheorghe-Teodor Bercea2017-08-102-3/+18
| | | | | | | | until a better way to perform these tests is figured out. Change connected to diff: D29654 llvm-svn: 310625
* [mips] Show warning in case of mixing -mlong-calls and -mabicalls optionsSimon Atanasyan2017-08-101-2/+10
| | | | | | | | | | While we do not support `-mshared / -mno-shared` properly, show warning and ignore `-mlong-calls` option in case of implicitly or explicitly provided `-mabicalls` option. Differential revision: https://reviews.llvm.org/D36551 llvm-svn: 310614
* [mips] Notify user that `-mabicalls` is ignored on non-PIC N64 ABISimon Atanasyan2017-08-101-3/+15
| | | | | | | | | | The -mabicalls option does not make sense in the case of non position independent code for the N64 ABI. After this change the driver shows a warning that -mabicalls is ignored in that case. Differential revision: https://reviews.llvm.org/D36550 llvm-svn: 310613
* Revert r310489 and follow-up commits r310505, r310519, r310537 and r310549Alex Lorenz2017-08-102-25/+4
| | | | | | | | | | Commit r310489 caused 'openmp-offload.c' test failures on Darwin and other platforms: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_check/39230/testReport/junit/Clang/Driver/openmp_offload_c/ The follow-up commits tried to fix the test, but the test is still failing. llvm-svn: 310580
* [OpenMP] Provide a default GPU arch that is supported byGheorghe-Teodor Bercea2017-08-102-3/+18
| | | | | | | | the underlying hardware. This fixes a bug triggered by diff: D29660 llvm-svn: 310549
* [Driver] Search compiler-rt paths in -print-file-name=Petr Hosek2017-08-102-4/+14
| | | | | | | | | | | This makes it possible to print the name of compiler-rt libraries by using simply clang -print-file-name=libclang_rt.${runtime}-${arch}.so same as other libraries, without having to know the details of the resource directory organization. Differential Revision: https://reviews.llvm.org/D35820 llvm-svn: 310548
* [OpenMP] Enable executable lookup into driver directory.Gheorghe-Teodor Bercea2017-08-091-0/+3
| | | | | | | | | | | | | | Summary: Invoking the compiler inside a script causes the clang-offload-bundler executable to not be found. This patch enables the lookup for executables in the driver directory where the clang-offload-bundler resides. Reviewers: hfinkel, carlo.bertolli, arpith-jacob, ABataev, caomhin Reviewed By: hfinkel Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D36537 llvm-svn: 310513
* [OpenMP] Add flag for overwriting default PTX version for OpenMP targetsGheorghe-Teodor Bercea2017-08-091-1/+7
| | | | | | | | | | | | | | | | | Summary: This flag "--fopenmp-ptx=" enables the overwriting of the default PTX version used for GPU offloaded OpenMP target regions: "+ptx42". Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, Hahnfeld, jlebar, hfinkel, tstellar Reviewed By: ABataev Subscribers: rengolin, cfe-commits Differential Revision: https://reviews.llvm.org/D29660 llvm-svn: 310489
* [OpenMP] Add flag for disabling the default generation of relocatable OpenMP ↵Gheorghe-Teodor Bercea2017-08-091-1/+4
| | | | | | | | | | | | | | | | target code for NVIDIA GPUs. Summary: Previously we have added the "-c" flag which gets passed to PTXAS by default to generate relocatable OpenMP target code by default. This set of flags exposes control over this behaviour. Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, Hahnfeld, jlebar, hfinkel, tstellar Reviewed By: ABataev Subscribers: Hahnfeld, rengolin, cfe-commits Differential Revision: https://reviews.llvm.org/D29659 llvm-svn: 310484
* [OpenMP] Make OpenMP generated code for the NVIDIA device relocatable by defaultGheorghe-Teodor Bercea2017-08-091-0/+4
| | | | | | | | | Original Diff: D29642 This patch was previously reverted due to an error with patch D29654 that this depends on. llvm-svn: 310479
* [OpenMP] Fix bug regarding cubin integration into host binaryGheorghe-Teodor Bercea2017-08-092-3/+5
| | | | | | | | | | when a BindArchAction is used. This is not a functional change. Original Diff: D29654 llvm-svn: 310433
* [sanitizer-coverage] -fsanitize-coverage=bb,inline-8bit-countersKostya Serebryany2017-08-081-1/+3
| | | | llvm-svn: 310409
* [OpenMP] OpenMP device offloading code generation produces a cubin file ↵Gheorghe-Teodor Bercea2017-08-087-132/+248
| | | | | | | | which is then integrated in the host binary using the host linker. Diff: D29654 llvm-svn: 310362
* Darwin's toolchain should be initialized before openmp offloadingAlex Lorenz2017-08-081-0/+6
| | | | | | | | is processed This fixes an 'openmp-offload.c' test failure introduced by r310263. llvm-svn: 310347
* Revert r310291, r310300 and r310332 because of test failure on DarwinAlex Lorenz2017-08-087-252/+132
| | | | | | | | | | | | | | | | | | | | | The commit r310291 introduced the failure. r310332 was a test fix commit and r310300 was a followup commit. I reverted these two to avoid merge conflicts when reverting. The 'openmp-offload.c' test is failing on Darwin because the following run lines: // RUN: touch %t1.o // RUN: touch %t2.o // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -save-temps -no-canonical-prefixes %t1.o %t2.o 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-TWOCUBIN %s trigger the following assertion: Driver.cpp:3418: assert(CachedResults.find(ActionTC) != CachedResults.end() && "Result does not exist??"); llvm-svn: 310345
* [OpenMP] Make OpenMP generated code for the NVIDIA device relocatable by defaultGheorghe-Teodor Bercea2017-08-071-0/+4
| | | | | | | | | | | | | | Summary: When device offloading is enabled and the device is an NVIDIA GPU, OpenMP target regions must be compiled with relocation enabled by passing the "-c" flag to the PTXAS invocation. Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, Hahnfeld, jlebar, hfinkel, tstellar Reviewed By: Hahnfeld Subscribers: Hahnfeld, rengolin, mkuron, cfe-commits Differential Revision: https://reviews.llvm.org/D29642 llvm-svn: 310300
OpenPOWER on IntegriCloud