aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Driver
AgeCommit message (Collapse)AuthorFilesLines
2017-07-06[OpenMP] Extend CLANG target options with device offloading kind.Gheorghe-Teodor Bercea18-32/+73
Summary: Pass the type of the device offloading when building the tool chain for a particular target architecture. This is required when supporting multiple tool chains that target a single device type. In our particular use case, the OpenMP and CUDA tool chains will use the same ```addClangTargetOptions ``` method. This enables the reuse of common options and ensures control over options only supported by a particular tool chain. Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, jlebar, hfinkel, tstellar, Hahnfeld Reviewed By: hfinkel Subscribers: jgravelle-google, aheejin, rengolin, jfb, dschuff, sbc100, cfe-commits Differential Revision: https://reviews.llvm.org/D29647 llvm-svn: 307272
2017-07-06[OpenMP] Customize CUDA-based tool chain selectionGheorghe-Teodor Bercea1-2/+16
Summary: This patch provides a generic way of selecting CUDA based tool chains as host-device pairs. Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, Hahnfeld, jlebar, hfinkel, tstellar Reviewed By: Hahnfeld Subscribers: rengolin, cfe-commits Differential Revision: https://reviews.llvm.org/D29658 llvm-svn: 307271
2017-07-05[driver][mips] Use AddTargetFeature to check arguments and add feature ↵Simon Atanasyan1-7/+2
flags. NFC llvm-svn: 307152
2017-07-05[driver][mips] Remove redundant curly brackets. NFCSimon Atanasyan1-3/+2
llvm-svn: 307151
2017-07-04Enable LLVM asan support for NetBSD/amd64Kamil Rytarowski3-0/+15
Summary: Enable LLVM asan sanitizer for NetBSD/amd64. Don't generate -ldl for dlopen(3)-like functions on NetBSD. These features are available in libc on NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, kcc, dim Reviewed By: dim Subscribers: #clang, #sanitizers Tags: #clang, #sanitizers Differential Revision: https://reviews.llvm.org/D34960 llvm-svn: 307104
2017-07-01Add an option group for deprecated warnings. Add the removedJoerg Sonnenberger1-0/+6
-fslp-vectorize-aggressive and -fno-slp-vectorize-aggressive flags back under this group and test for the warning. Document the future removal in the ReleaseNotes. Differential Revision: https://reviews.llvm.org/D34926 llvm-svn: 306965
2017-07-01fix trivial typos; NFCHiroshi Inoue1-1/+1
llvm-svn: 306954
2017-07-01Un-revert "[Driver] Add -fdiagnostics-hotness-threshold"Brian Gesiak1-0/+6
Summary: Un-revert https://reviews.llvm.org/D34868, but with a slight tweak to the documentation to fix an error -- I had used the wrong syntax for a link. llvm-svn: 306948
2017-07-01Revert "[Driver] Add -fdiagnostics-hotness-threshold"Brian Gesiak1-6/+0
Summary: The commit caused a documentation breakage. llvm-svn: 306946
2017-07-01[Driver] Add -fdiagnostics-hotness-thresholdBrian Gesiak1-0/+6
Summary: Depends on https://reviews.llvm.org/D34867. Add a Clang frontend option to enable optimization remark hotness thresholds, which were added to LLVM in https://reviews.llvm.org/D34867. This prevents diagnostics that do not meet a minimum hotness threshold from being output. When generating optimization remarks for large codebases with a ton of cold code paths, this option can be used to limit the optimization remark output at a reasonable size. Discussion of this change can be read here: http://lists.llvm.org/pipermail/llvm-dev/2017-June/114377.html Reviewers: anemet, davidxl, hfinkel Reviewed By: anemet Subscribers: fhahn, cfe-commits Differential Revision: https://reviews.llvm.org/D34868 llvm-svn: 306945
2017-07-01Fix indentation.Akira Hatanaka1-7/+7
This is an attempt to fix a failing bot: http://lab.llvm.org:8011/builders/ubuntu-gcc7.1-werror llvm-svn: 306944
2017-07-01Update clang support for -mexecute-only/-mpure-code for backend change to ↵Eric Christopher1-3/+1
use subtarget feature rather than command line option. llvm-svn: 306928
2017-07-01[Driver] Check that the iOS deployment target is iOS 10 or earlier ifAkira Hatanaka1-2/+26
the target is 32-bit. The following changes are made to the driver since 32-bit apps do not run on iOS 11 or later: - If the deployment target is set explicitly, either with a command-line option or an environment variable, the driver should report an error if the version is greater than iOS 10. - In the case where the deployment target is not set explicitly and the default is inferred from the target triple or SDK version, it should use a maximum default of iOS 10.99.99. rdar://problem/32230613 Differential Revision: https://reviews.llvm.org/D34529 llvm-svn: 306922
2017-06-30Driver: honor -nostdinc and -isystem-after on CrossWindowsSaleem Abdulrasool1-4/+10
This changes CrossWindows to look for -nostdinc instead of -nostdlibinc. In addition, fixes a bug where -isystem-after options would be dropped when called with -nostdinc. Patch by Dave Lee! llvm-svn: 306829
2017-06-30[Driver] Actually report errors during parsing instead of stopping when ↵Benjamin Kramer2-15/+32
there's an error somewhere. This is a more principled version of r303756. That change was both very brittle about the state of the Diags object going into the driver and also broke tooling in funny ways. In particular it prevented tools from capturing diagnostics properly and made the compilation database logic fail to provide arguments to the tool, falling back to scanning directories for JSON files. llvm-svn: 306822
2017-06-30Fix heap use after free introduced by r306769.Daniel Jasper1-1/+1
llvm-svn: 306804
2017-06-30Remove Clang support for '-fvectorize-slp-aggressive' which used LLVM'sChandler Carruth1-5/+0
basic block vectorizer. This vectorizer has had no known users for many, many years and is completely surpassed by the normal '-fvectorize-slp'-controlled SLP vectorizer in LLVM. Hal proposed this back in 2014 to no objections: http://lists.llvm.org/pipermail/llvm-dev/2014-November/079091.html While this patch completely removes the flag, Joerg is working on a patch that will add it back in a way that warns users and ignores the flag in a clear and well factored way (so that we can keep doing this going forward). Differential Revision: https://reviews.llvm.org/D34846 llvm-svn: 306786
2017-06-30Unified logic for computing target ABI in backend and front end by moving ↵Eric Christopher1-35/+6
this common code to Support/TargetParser. Modeled Triple::GNU after front end code (aapcs abi) and updated tests that expect apcs abi. Patch by Ana Pazos! llvm-svn: 306769
2017-06-29Insert llvm_unreachable at the end of a function to silence gcc'sAkira Hatanaka1-0/+1
-Werror=return-type error. This is an attempt to fix the following failing bot: http://lab.llvm.org:8011/builders/ubuntu-gcc7.1-werror llvm-svn: 306739
2017-06-29[libFuzzer] Add Fuzzer to the list of sanitizers which support coverage.George Karpenkov1-1/+1
Without this change, additional coverage flags specified after -fsanitize=fuzzer would get discarded. https://reviews.llvm.org/D34794 llvm-svn: 306734
2017-06-29[libFuzzer] Do not link in libFuzzer with -fsanitize=fuzzer when producing a ↵George Karpenkov2-2/+3
shared object https://reviews.llvm.org/D34791 llvm-svn: 306733
2017-06-29[Sema] Issue diagnostics if a new/delete expression generates a call toAkira Hatanaka2-0/+29
a c++17 aligned allocation/deallocation function that is unavailable in the standard library on Apple platforms. The aligned functions are implemented only in the following versions or later versions of the OSes, so clang issues diagnostics if the deployment target being targeted is older than these: macosx: 10.13 ios: 11.0 tvos: 11.0 watchos: 4.0 The diagnostics are issued whenever the aligned functions are selected except when the selected function has a definition in the same file. If there is a user-defined function available somewhere else, option -Wno-aligned-allocation-unavailable can be used to silence the diagnostics. rdar://problem/32664169 Differential Revision: https://reviews.llvm.org/D34574 llvm-svn: 306722
2017-06-29[OpenMP] Pass -fopenmp-is-device to preprocessing and machine specific code ↵Gheorghe-Teodor Bercea1-3/+5
generation stages Summary: The preprocessing and code generation and optimization stages of the compiler are also passed the "-fopenmp-is-device" flag. This is used to trigger machine specific preprocessing and code generation when performing device offloading to an NVIDIA GPU via OpenMP directives. Reviewers: arpith-jacob, caomhin, carlo.bertolli, Hahnfeld, hfinkel, tstellar Reviewed By: Hahnfeld Subscribers: Hahnfeld, rengolin Differential Revision: https://reviews.llvm.org/D29645 llvm-svn: 306691
2017-06-29[OpenMP] Add support for auxiliary triple specificationGheorghe-Teodor Bercea1-0/+17
Summary: Device offloading requires the specification of an additional flag containing the triple of the //other// architecture the code is being compiled on if such an architecture exists. If compiling for the host, the auxiliary triple flag will contain the triple describing the device and vice versa. Reviewers: arpith-jacob, sfantao, caomhin, carlo.bertolli, ABataev, Hahnfeld, jlebar, hfinkel, tstellar Reviewed By: Hahnfeld Subscribers: rengolin, cfe-commits Differential Revision: https://reviews.llvm.org/D29339 llvm-svn: 306689
2017-06-28Remove a redundant call to ArgList::hasFlag. NFC.Vedant Kumar1-7/+6
llvm-svn: 306497
2017-06-27Reapply "Frontend support for Nios2 target"Nikolai Bozhenov1-0/+19
Summary: - Implements TargetInfo class for Nios2 target. - Enables handling of -march and -mcpu options for Nios2 target. - Definition of Nios2 builtin functions. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D33356 Author: belickim <mateusz.belicki@intel.com> llvm-svn: 306383
2017-06-26[mips] Enable IAS by default for Android 64-bit MIPS target (N64)Petar Jovanovic1-3/+5
IAS is already used for MIPS64 in majority of Android projects. Android MIPS64 uses N64 ABI. Set IAS as a default now. Differential Revision: https://reviews.llvm.org/D34514 llvm-svn: 306280
2017-06-25Add support for Ananas platformEd Schouten4-0/+192
Ananas is a home-brew operating system, mainly for amd64 machines. After using GCC for quite some time, it has switched to clang and never looked back - yet, having to manually patch things is annoying, so it'd be much nicer if this was in the official tree. More information: https://github.com/zhmu/ananas/ https://rink.nu/projects/ananas.html Submitted by: Rink Springer Differential Revision: https://reviews.llvm.org/D32936 llvm-svn: 306239
2017-06-23[ubsan] Disable the object size check at -O0Vedant Kumar1-1/+17
This check currently isn't able to diagnose any issues at -O0, not is it likely to [1]. Disabling the check at -O0 leads to substantial compile time and binary size savings. [1] [cfe-dev] Disabling ubsan's object size check at -O0 Differential Revision: https://reviews.llvm.org/D34563 llvm-svn: 306181
2017-06-23Sort the autocomplete candidates before printing them out.Rui Ueyama1-0/+7
Currently, autocompleted options are displayed in the same order as we wrote them in .td files. This patch sort them out in clang so that they are sorted alphabetically. This should improve usability. Differential Revision: https://reviews.llvm.org/D34557 llvm-svn: 306116
2017-06-23Revert "Revert r305164/5/7."Saleem Abdulrasool2-15/+59
Restore the `-gz` option to the driver with some minor tweaks to handle the additional case for `-Wa,--compress-debug-sections`. This intends to make the compression of the debug information controllable from the driver. The following is the behaviour: -gz enable compression (ambiguous for format, will default to zlib-gnu) -gz=none disable compression -gz=zlib-gnu enable compression (deprecated GNU style zlib compression) -gz=zlib enable compression (zlib based compression) Although -Wa,-compress-debug-sections works, it should be discouraged when using the driver to invoke the assembler. However, we permit the assembler to accept the GNU as style argument --compress-debug-sections to maintain compatibility. Note, -gz/-gz= does *NOT* imply -g. That is, you need to additionally specific -g for debug information to be generated. llvm-svn: 306115
2017-06-23[WebAssembly] Add default -allow-undefined-file to linker argsSam Clegg1-2/+3
Also, don't use the outdated lib32/lib64 naming of files within the sysroot. The more modern/flexible approach IIUC is to use seperate sysroots or /lib/<target-tripple> and /include/<target-tripple>. Differential Revision: https://reviews.llvm.org/D33565 llvm-svn: 306074
2017-06-21Revert r305678: [driver][macOS] Pick the system version for theAlex Lorenz1-22/+1
deployment target if the SDK is newer than the system This commit also reverts follow-up commits r305680 and r305685 that have buildbot fixes. The change in r305678 wasn't correct because it relied on `llvm::sys::getProcessTriple`, which uses a pre-configured OS version. We should lookup the actual macOS version of the system on which the compiler is running. llvm-svn: 305891
2017-06-20[GSoC] Flag value completion for clangYuka Takahashi2-5/+23
This is patch for GSoC project, bash-completion for clang. To use this on bash, please run `source clang/utils/bash-autocomplete.sh`. bash-autocomplete.sh is code for bash-completion. In this patch, Options.td was mainly changed in order to add value class in Options.inc. llvm-svn: 305805
2017-06-19Add missing OS check to r305678Alex Lorenz1-2/+4
That commit failed on non-macOS buildbots as I've forgotten to make sure that the system on which Clang is running on is actually macOS. llvm-svn: 305680
2017-06-19[driver][macOS] Pick the system version for the deployment targetAlex Lorenz1-1/+20
if the SDK is newer than the system This commit improves the driver by making sure that it picks the system version for the deployment target when the version of the macOS SDK is newer than the system version. rdar://29449467 Differential Revision: https://reviews.llvm.org/D34175 llvm-svn: 305678
2017-06-16Fix a bug that warnings generated with -M or -MM flagsYuka Takahashi1-0/+3
This is a patch for bug: https://bugs.llvm.org/show_bug.cgi?id=6817 Warnings should not be emitted with -M and -MM flags, because this mode is only used for generate MakeFiles. llvm-svn: 305561
2017-06-12Revert r305164/5/7.Daniel Jasper2-59/+15
cc1as does not currently access the "--" version of this flag. At the very least this needs to be fixed and proper test cases need to be added. Simple reproducer: clang -Wa,--compress-debug-sections /tmp/test.cc Result: error: unknown argument: '--compress-debug-sections' llvm-svn: 305182
2017-06-11test: attempt to repair build botsSaleem Abdulrasool1-4/+7
Split the no-ias tests and give them a target to ensure that they go down the GNU toolchain path. Adjust the no compression support tests. llvm-svn: 305167
2017-06-11Driver: add support for `-gz` and `-gz=`Saleem Abdulrasool2-0/+52
These options control the behaviour of the compression of debug info sections on ELF targets. Our behaviour slightly diverges from the behaviour of GCC. `-gz` maps to the `-compress-debug-sections` rather than `-compress-debug-sections=zlib` or `-compress-debug-sections=zlib-gnu`. This small divergence allows us to be compatible across versions of binutils (=zlib support was introduced in 2.26, while earlier versions only support =zlib-gnu). This also allows users to not have to worry about the version of the assembler they may be using if they are not using the IAS. Previously, users would have had to go through the internal option `-compress-debug-sectionss` and pass that through to the assembler, which is no longer needed. llvm-svn: 305165
2017-06-11Driver: pass along [-]-[no]compress-debug-sections unfilteredSaleem Abdulrasool1-15/+4
Rather than validating the flags, pass them through without any validation. Arguments passed via -Wa or -Xassembler are passed directly to the assembler without validation. The validation was previously required since we did not provide proper driver level support for controlling the debug compression on ELF targets. A subsequent change will add support for the `-gz` and `-gz=` flags which provide proper driver level control of the ELF compressed debug sections. llvm-svn: 305164
2017-06-09Add -frewrite-imports flag.Richard Smith2-1/+8
If specified, when preprocessing, the contents of imported .pcm files will be included in preprocessed output. The resulting preprocessed file can then be compiled standalone without the module sources or .pcm files. llvm-svn: 305116
2017-06-09Revert of r305066 "Reapply Frontend support for Nios2 target"Nikolai Bozhenov1-19/+0
llvm-svn: 305068
2017-06-09Reapply "Frontend support for Nios2 target"Nikolai Bozhenov1-0/+19
Summary: - Implements TargetInfo class for Nios2 target. - Enables handling of -march and -mcpu options for Nios2 target. - Definition of Nios2 builtin functions. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D33356 Author: belickim <mateusz.belicki@intel.com> llvm-svn: 305066
2017-06-08[sanitizer-coverage] one more flavor of coverage: ↵Kostya Serebryany1-3/+7
-fsanitize-coverage=inline-8bit-counters. Experimental so far, not documenting yet. Reapplying revisions 304630, 304631, 304632, 304673, see PR33308 llvm-svn: 305026
2017-06-08Revert "Frontend support for Nios2 target"Nikolai Bozhenov1-19/+0
As it breaks many buildbots. llvm-svn: 305002
2017-06-08Frontend support for Nios2 target.Nikolai Bozhenov1-0/+19
Summary: - Implements TargetInfo class for Nios2 target. - Enables handling of -march and -mcpu options for Nios2 target. - Definition of Nios2 builtin functions. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D33356 Author: belickim <mateusz.belicki@intel.com> llvm-svn: 304994
2017-06-08[sanitizer-coverage] Allow using KASAN instrumentation with sancovAlexander Potapenko1-2/+2
llvm-svn: 304984
2017-06-07Reapply r304929 [mips] Add runtime options to enable/disable madd/sub.fmtPetar Jovanovic1-0/+7
The test in r304929 broke multiple buildbots as it expected mips target to be registered and available (which is not necessarily true). Updating the test with this condition. Original commit: [mips] Add runtime options to enable/disable madd.fmt and msub.fmt Add options to clang: -mmadd4 and -mno-madd4, use it to enable or disable generation of madd.fmt and similar instructions respectively, as per GCC. Patch by Stefan Maksimovic. llvm-svn: 304953
2017-06-07Revert r304929 [mips] Add runtime options to enable/disable madd/sub.fmtPetar Jovanovic1-7/+0
Revert r304929 since the test broke buildbots. Original commit: [mips] Add runtime options to enable/disable madd.fmt and msub.fmt Add options to clang: -mmadd4 and -mno-madd4, use it to enable or disable generation of madd.fmt and similar instructions respectively, as per GCC. Patch by Stefan Maksimovic. llvm-svn: 304935