summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
...
* [Driver] Reland "Android triples are not aliases for other triples."Dan Albert2018-04-251-50/+76
| | | | | | | | | Fixed directory separators in tests to be compatible with both Windows and !Windows. This reverts commit aa423850afa4c16a53c4c492fe254dcad3d5a53e. llvm-svn: 330873
* [Driver] Fix implicit config files from prefixed symlinksMartin Storsjo2018-04-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | If -no-canonical-prefixes isn't used, the clang executable name used is the one of the actual executable, not the name of the symlink that the user invoked. In these cases, the target prefix was overridden based on the clang executable name. (On the other hand the implicit -target option that such a symlink adds, is added as an actual command line parameter in tools/driver/driver.cop, before resolving the symlink and finding the actual clang executable. Use the original ClangNameParts (set from argv[0] in tools/driver/driver.cpp) if it seems to be initialized propery. All existing tests of this feature used -no-canonical-prefixes (possibly because it also makes the driver look in the directory of the symlink instead of the directory of the executable); add another one that uses --config-user-dir= to specify the directory instead. (For actual users of such symlinks, outisde of the test suite, the directory is probably the same for both.) This makes this feature work more like what the documentation describes. Differential Revision: https://reviews.llvm.org/D45964 llvm-svn: 330871
* Revert "[Driver] Android triples are not aliases for other triples."Dan Albert2018-04-241-76/+50
| | | | | | | | Revering while I diagnose the failures. This reverts commit 82dc3bf2157da280420f80e654292cb05e0dc5f7. llvm-svn: 330780
* [Driver] Android triples are not aliases for other triples.Dan Albert2018-04-241-50/+76
| | | | | | | | | | | | | | | | Summary: Android targets should never use tools/libraries for non-Android targets or vice versa. Reviewers: srhines, george.burgess.iv, eugenis Reviewed By: eugenis Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45597 llvm-svn: 330770
* [CUDA] Enable CUDA compilation with CUDA-9.2Artem Belevich2018-04-241-0/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D45827 llvm-svn: 330753
* [GCC] Don't keep a StringRef to a temporary std::stringMartin Storsjo2018-04-241-1/+1
| | | | | | | | | | This fixes failures in asan builds and possibly other buildbots as well, after SVN r330696. Prior to that revision, the std::string was stored in another variable, before assigning to a StringRef. llvm-svn: 330710
* [GCC] Match a GCC version with a patch suffix without a third version componentMartin Storsjo2018-04-241-3/+11
| | | | | | | | | | | | | | Previously it would only accept a string as a GCC version if it had either two components and no suffix, or three components with an optional suffix. Debian and ubuntu provided mingw compilers have lib/gcc/target entries like "5.3-posix" and "5.3-win32". This doesn't try to make any specific preference between them (other than lexical sorting of the suffix). Differential Revision: https://reviews.llvm.org/D45505 llvm-svn: 330696
* [CodeGen] Reland r330442: Add an option to suppress output of llvm.identMikhail Maltsev2018-04-231-0/+3
| | | | | | | The test case in the original patch was overly contrained and failed on PPC targets. llvm-svn: 330575
* [XRay] Change std::sort to llvm::sort in response to r327219Mandeep Singh Grang2018-04-231-1/+1
| | | | | | | | | | | r327219 added wrappers to std::sort which randomly shuffle the container before sorting. This will help in uncovering non-determinism caused due to undefined sorting order of objects having the same key. To make use of that infrastructure we need to invoke llvm::sort instead of std::sort. llvm-svn: 330561
* Revert r330442, CodeGen/no-ident-version.c is failing on PPCMikhail Maltsev2018-04-201-3/+0
| | | | llvm-svn: 330451
* [CodeGen] Add an option to suppress output of llvm.identMikhail Maltsev2018-04-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | Summary: By default Clang outputs its version (including git commit hash, in case of trunk builds) into object and assembly files. It might be useful to have an option to disable this, especially for debugging purposes. This patch implements new command line flags -Qn and -Qy (the names are chosen for compatibility with GCC). -Qn disables output of the 'llvm.ident' metadata string and the 'producer' debug info. -Qy (enabled by default) does the opposite. Reviewers: faisalv, echristo, aprantl Reviewed By: aprantl Subscribers: aprantl, cfe-commits, JDevlieghere, rogfer01 Differential Revision: https://reviews.llvm.org/D45255 llvm-svn: 330442
* [Driver] Support for -save-stats in AddGoldPlugin.Florian Hahn2018-04-207-41/+67
| | | | | | | | | | | | | | This patch updates AddGoldPlugin to pass stats-file to the Gold plugin, if -save-stats is passed. It also moves the save-stats option handling to a helper function tools::getStatsFileName. Reviewers: tejohnson, mehdi_amini, compnerd Reviewed By: tejohnson, compnerd Differential Revision: https://reviews.llvm.org/D45771 llvm-svn: 330422
* Implement proper support for `-falign-functions`Saleem Abdulrasool2018-04-193-0/+44
| | | | | | | | | | | | | | | | This implements support for the previously ignored flag `-falign-functions`. This allows the frontend to request alignment on function definitions in the translation unit where they are not explicitly requested in code. This is compatible with the GCC behaviour and the ICC behaviour. The scalar value passed to `-falign-functions` aligns functions to a power-of-two boundary. If flag is used, the functions are aligned to 16-byte boundaries. If the scalar is specified, it must be an integer less than or equal to 4096. If the value is not a power-of-two, the driver will round it up to the nearest power of two. llvm-svn: 330378
* OpenBSD add C++ runtime in a driver's standpointDean Michael Berris2018-04-192-0/+10
| | | | | | | | | | | | | | Summary: - Since 6.2 release, on supporters platforms clang is shipped with both libcxx and libcxxabi. Reviewers: dberris, alekseyshl, EricWF Reviewed By: dberris Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45662 llvm-svn: 330310
* [NVPTX, CUDA] Added support for m8n32k16 and m32n8k16 variants of wmma ↵Artem Belevich2018-04-181-10/+12
| | | | | | | | | | instructions. The new instructions were added added for sm_70+ GPUs in CUDA-9.1. Differential Revision: https://reviews.llvm.org/D45068 llvm-svn: 330296
* [HIP] Add driver input type for HIPYaxun Liu2018-04-182-6/+19
| | | | | | | | | Patch by Greg Rodgers. Revised by Yaxun Liu. Differential Revision: https://reviews.llvm.org/D45489 llvm-svn: 330279
* [MinGW] Try to fix asan testing after r330244Martin Storsjo2018-04-181-6/+5
| | | | | | Twines shouldn't be stored as they can refer to temporaries. llvm-svn: 330277
* [NVPTX] Emit debug info in DWARF-2 by default for Cuda devices.Alexey Bataev2018-04-182-3/+38
| | | | | | | | | | | | | | Summary: NVPTX target supports debug info in DWARF-2 format. Patch adds emission of debug info in DWARF-2 by default. Reviewers: tra, jlebar Subscribers: aprantl, JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D42581 llvm-svn: 330272
* [MinGW] Look for a cross sysroot relative to the clang binaryMartin Storsjo2018-04-182-1/+25
| | | | | | | | | If found, prefer this over looking for a similar gcc later in the system path. Differential Revision: https://reviews.llvm.org/D45504 llvm-svn: 330244
* [Modules] Turn on system header validation for implicit modulesBruno Cardoso Lopes2018-04-181-1/+7
| | | | | | | | | | After r300027 implicit builds might fail when updating the SDK on darwin. Make validation of system headers default when implicit modules is on and allow modules to be rebuild when system headers change. rdar://problem/19767523 llvm-svn: 330240
* [XRay] Add clang builtin for xray typed events.Keith Wyss2018-04-171-0/+7
| | | | | | | | | | | | | | | | | | | Summary: A clang builtin for xray typed events. Differs from __xray_customevent(...) by the presence of a type tag that is vended by compiler-rt in typical usage. This allows xray handlers to expand logged events with their type description and plugins to process traced events based on type. This change depends on D45633 for the intrinsic definition. Reviewers: dberris, pelikan, rnk, eizan Subscribers: cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D45716 llvm-svn: 330220
* [Driver] Use the per-API level Android library directories.Dan Albert2018-04-171-0/+16
| | | | | | | | | | | | | | | | Summary: Android sysroots contain libraries for each OS version, as well as a handful of unversioned libraries in the typical multiarch directory. Reviewers: srhines, eugenis, george.burgess.iv Reviewed By: eugenis Subscribers: javed.absar, cfe-commits Differential Revision: https://reviews.llvm.org/D45290 llvm-svn: 330213
* Remove unused variableTeresa Johnson2018-04-171-1/+1
| | | | | | Fixes unused variable error introduced in r330194. llvm-svn: 330210
* Add a command line option 'fregister_global_dtors_with_atexit' toAkira Hatanaka2018-04-171-0/+5
| | | | | | | | | | | | | | | | | | | | | register destructor functions annotated with __attribute__((destructor)) using __cxa_atexit or atexit. Register destructor functions annotated with __attribute__((destructor)) calling __cxa_atexit in a synthesized constructor function instead of emitting references to the functions in a special section. The primary reason for adding this option is that we are planning to deprecate the __mod_term_funcs section on Darwin in the future. This feature is enabled by default only on Darwin. Users who do not want this can use command line option 'fno_register_global_dtors_with_atexit' to disable it. rdar://problem/33887655 Differential Revision: https://reviews.llvm.org/D45578 llvm-svn: 330199
* [ThinLTO] Pass -save-temps to LTO backend for distributed ThinLTO buildsTeresa Johnson2018-04-172-2/+20
| | | | | | | | | | | | | | | | | | | | | | | Summary: The clang driver option -save-temps was not passed to the LTO config, so when invoking the ThinLTO backends via clang during distributed builds there was no way to get LTO to save temp files. Getting this to work with ThinLTO distributed builds also required changing the driver to avoid a separate compile step to emit unoptimized bitcode when the input was already bitcode under -save-temps. Not only is this unnecessary in general, it is problematic for ThinLTO backends since the temporary bitcode file to the backend would not match the module path in the combined index, leading to incorrect ThinLTO backend index-based optimizations. Reviewers: pcc Subscribers: mehdi_amini, inglorion, eraman, cfe-commits Differential Revision: https://reviews.llvm.org/D45217 llvm-svn: 330194
* [Hexagon] Emit a warning when -fvectorize is given without -mhvxKrzysztof Parzyszek2018-04-162-7/+15
| | | | llvm-svn: 330150
* [mips] Prevent PIC to be set to level 2Aleksandar Beserminji2018-04-161-6/+11
| | | | | | | | | | MIPS does not use PIC level 2 for historical reasons, even with -fPIC/-mxgot/multigot options. This patch prevents PIC to be set to level 2 for MIPS. Differential Revision: https://reviews.llvm.org/D44381 llvm-svn: 330118
* [Driver] Export profiling symbols for -exported_symbols_listVedant Kumar2018-04-131-0/+2
| | | | | | | | | When profiling is enabled and -exported_symbols_list is specified for the Darwin linker, export the requisite set of profiling symbols. rdar://39427167 llvm-svn: 330077
* hwasan: add -fsanitize=kernel-hwaddress flagAndrey Konovalov2018-04-132-7/+25
| | | | | | | | | This patch adds -fsanitize=kernel-hwaddress flag, that essentially enables -hwasan-kernel=1 -hwasan-recover=1 -hwasan-match-all-tag=0xff. Differential Revision: https://reviews.llvm.org/D45046 llvm-svn: 330044
* [XRay][clang] Make -fxray-modes= additiveDean Michael Berris2018-04-131-11/+12
| | | | | | | | | | | | | | | | | | | | | Summary: This allows us to do the following: clang -fxray-modes=none ... -fxray-modes=xray-basic It's important to be able to do this in cases where we'd like to specialise the configuration for the invocation of the compiler, in various scripting environments. This is related to llvm.org/PR37066, a follow-up to D45474. Reviewers: eizan, kpw, pelikan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45610 llvm-svn: 329989
* [XRay][clang] Add flag to choose instrumentation bundlesDean Michael Berris2018-04-131-3/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change addresses http://llvm.org/PR36926 by allowing users to pick which instrumentation bundles to use, when instrumenting with XRay. In particular, the flag `-fxray-instrumentation-bundle=` has four valid values: - `all`: the default, emits all instrumentation kinds - `none`: equivalent to -fnoxray-instrument - `function`: emits the entry/exit instrumentation - `custom`: emits the custom event instrumentation These can be combined either as comma-separated values, or as repeated flag values. Reviewers: echristo, kpw, eizan, pelikan Reviewed By: pelikan Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D44970 llvm-svn: 329985
* Remove -cc1 option "-backend-option".Eli Friedman2018-04-121-9/+9
| | | | | | | | | It means the same thing as -mllvm; there isn't any reason to have two options which do the same thing. Differential Revision: https://reviews.llvm.org/D45109 llvm-svn: 329965
* [MinGW] Look for libc++ headers in a triplet prefixed path as wellMartin Storsjo2018-04-121-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | This makes it consistent with libstdc++ and the other default include directories. If these headers are found in both locations and one isn't a symlink to the other, this will cause errors due to libc++ headers having wrapper headers for some standard C headers, wrappers that do #include_next the actual one. If the same libc++ standard C wrapper header exists in more than one include directory before the real system one, the header include guard will stop it from doing another #include_next to pick up the real one, breaking things. As this is a rather uncommon situation, this should be acceptable and toolchain maintainers can adapt accordingly if necessary. Also simplify some of the existing code with a local variable. Differential Revision: https://reviews.llvm.org/D45500 llvm-svn: 329946
* [RISCV] Fix logic to check if frame pointer should be usedMandeep Singh Grang2018-04-121-8/+3
| | | | | | | | | | | | | | Summary: The logic was broken for Linux triples as it returns true in the switch for Triple.isOSLinux(). Reviewers: asb, apazos Reviewed By: asb Subscribers: kito-cheng, shiva0217, cfe-commits Differential Revision: https://reviews.llvm.org/D45237 llvm-svn: 329941
* [Hexagon] Enable auto-vectorization only when -fvectorize was givenKrzysztof Parzyszek2018-04-121-0/+7
| | | | llvm-svn: 329923
* Driver: Add gcc search path for RHEL devtoolset-7Tom Stellard2018-04-111-0/+1
| | | | | | | | | | | | Reviewers: bruno Reviewed By: bruno Subscribers: bruno, cfe-commits Differential Revision: https://reviews.llvm.org/D44130 llvm-svn: 329854
* [Driver] Don't forward -m[no-]unaligned-access options to GCC when ↵Chad Rosier2018-04-111-0/+7
| | | | | | | | assembling/linking Differential Revision: https://reviews.llvm.org/D45092 llvm-svn: 329810
* [PowerPC] Option for secure plt modeStrahinja Petrovic2018-04-112-0/+17
| | | | | | | | | This patch enables option for secure plt mode in clang (-msecure-plt). Differential Revision: https://reviews.llvm.org/D44921 llvm-svn: 329795
* Adding fuzzer flags support to OpenBSD driverDean Michael Berris2018-04-111-1/+4
| | | | | | | | | | | | | | Summary: - Following-up the sanitizer's part commit https://reviews.llvm.org/rCRT329631, we enable fuzzer flags. Reviewers: brad, thakis, dberris Reviewed By: dberris Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D44878 llvm-svn: 329779
* [XRay][clang+compiler-rt] Support build-time mode selectionDean Michael Berris2018-04-112-6/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch implements the `-fxray-modes=` flag which allows users building with XRay instrumentation to decide which modes to pre-package into the binary being linked. The default is the status quo, which will link all the available modes. For this to work we're also breaking apart the mode implementations (xray-fdr and xray-basic) from the main xray runtime. This gives more granular control of which modes are pre-packaged, and picked from clang's invocation. This fixes llvm.org/PR37066. Note that in the future, we may change the default for clang to only contain the profiling implementation under development in D44620, when that implementation is ready. Reviewers: echristo, eizan, chandlerc Reviewed By: echristo Subscribers: mgorny, mgrang, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D45474 llvm-svn: 329772
* Revert "Handle the default case"Petr Hosek2018-04-101-2/+0
| | | | | | This reverts commit r329758. llvm-svn: 329760
* Handle the default casePetr Hosek2018-04-101-0/+2
| | | | | | | | This was omitted in D45422 resulting in a warning. Differential Revision: https://reviews.llvm.org/D45499 llvm-svn: 329758
* [Driver] Handle the default case missed in r329748.Chad Rosier2018-04-101-0/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D45499 llvm-svn: 329754
* [Driver] Allow drivers to add multiple libc++ include pathsPetr Hosek2018-04-1021-59/+89
| | | | | | | | | | | This allows toolchain drivers to add multiple libc++ include paths akin to libstdc++. This is useful in multiarch setup when some headers might be in target specific include directory. There should be no functional change. Differential Revision: https://reviews.llvm.org/D45422 llvm-svn: 329748
* [CUDA] Added --[no-]cuda-include-ptx=sm_XX|all option.Artem Belevich2018-04-101-0/+19
| | | | | | | | | | | | | | Currently we always include PTX into the fatbin along with the GPU code.It about doubles the size of the GPU binary we need to carry in the executable. These options allow control inclusion of PTX into GPU binary. This patch does not change the defaults, though we may consider making no-PTX the default in the future. Differential Revision: https://reviews.llvm.org/D45495 llvm-svn: 329737
* [XRay][llvm+clang] Consolidate attribute list filesDean Michael Berris2018-04-091-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This change consolidates the always/never lists that may be provided to clang to externally control which functions should be XRay instrumented by imbuing attributes. The files follow the same format as defined in https://clang.llvm.org/docs/SanitizerSpecialCaseList.html for the sanitizer blacklist. We also deprecate the existing `-fxray-instrument-always=` and `-fxray-instrument-never=` flags, in favour of `-fxray-attr-list=`. This fixes http://llvm.org/PR34721. Reviewers: echristo, vlad.tsyrklevich, eugenis Reviewed By: vlad.tsyrklevich Subscribers: llvm-commits, cfe-commits Differential Revision: https://reviews.llvm.org/D45357 llvm-svn: 329543
* [Driver] Update GCC libraries detection logic for Gentoo.Manoj Gupta2018-04-072-23/+80
| | | | | | | | | | | | | | | | | Summary: 1. Find GCC's LDPATH from the actual GCC config file. 2. Avoid picking libraries from a similar named tuple if the exact tuple is installed. Reviewers: mgorny, chandlerc, thakis, rnk Reviewed By: mgorny, rnk Subscribers: cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D45233 llvm-svn: 329512
* Recommit r329442: Generate Libclang invocation reproducers using a newAlex Lorenz2018-04-071-9/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | -cc1gen-reproducer driver option The recommit fixes: - An MSAN failure (CCPrintOptions wasn't initialized in the Driver) - Ensures that the strings in the libclang invocation files are escaped Original message: This commit is a follow up to the previous work that recorded Libclang invocations into temporary files: r319702. It adds a new -cc1 mode to clang: -cc1gen-reproducer. The goal of this mode is to generate Clang reproducer files for Libclang tool invocation. The JSON format in the invocation files is not really intended to be stable, so Libclang and Clang should be of the same version when generating reproducers. The new mode emits the information about the temporary files and Libclang-specific information to stdout using JSON. rdar://35322614 Differential Revision: https://reviews.llvm.org/D40983 llvm-svn: 329465
* Revert r329442 "Generate Libclang invocation reproducers using a newAlex Lorenz2018-04-061-10/+2
| | | | | | | | -cc1gen-reproducer driver option" The tests are failing on some bots llvm-svn: 329447
* Generate Libclang invocation reproducers using a new -cc1gen-reproducerAlex Lorenz2018-04-061-2/+10
| | | | | | | | | | | | | | | | | | | | driver option This commit is a follow up to the previous work that recorded Libclang invocations into temporary files: r319702. It adds a new -cc1 mode to clang: -cc1gen-reproducer. The goal of this mode is to generate Clang reproducer files for Libclang tool invocation. The JSON format in the invocation files is not really intended to be stable, so Libclang and Clang should be of the same version when generating reproducers. The new mode emits the information about the temporary files and Libclang-specific information to stdout using JSON. rdar://35322614 Differential Revision: https://reviews.llvm.org/D40983 llvm-svn: 329442
OpenPOWER on IntegriCloud