summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
...
* Driver: fix an assertion with `-print-prog-name=`Saleem Abdulrasool2018-05-011-1/+7
| | | | | | | | | Fix an assertion when -print-prog-name= is invoked without parameter. Returns an empty string. Patch by Christian Bruel! llvm-svn: 331296
* Implement P0482R2, support for char8_t type.Richard Smith2018-05-011-0/+3
| | | | | | | | | | | | This is not yet part of any C++ working draft, and so is controlled by the flag -fchar8_t rather than a -std= flag. (The GCC implementation is controlled by a flag with the same name.) This implementation is experimental, and will be removed or revised substantially to match the proposal as it makes its way through the C++ committee. llvm-svn: 331244
* [Driver, CodeGen] rename options to disable an FP cast optimizationSanjay Patel2018-04-301-3/+3
| | | | | | | | | | | | | | As suggested in the post-commit thread for rL331056, we should match these clang options with the established vocabulary of the corresponding sanitizer option. Also, the use of 'strict' is well-known for these kinds of knobs, and we can improve the descriptive text in the docs. So this intends to match the logic of D46135 but only change the words. Matching LLVM commit to match this spelling of the attribute to follow shortly. Differential Revision: https://reviews.llvm.org/D46236 llvm-svn: 331209
* IWYU for llvm-config.h in clang. See r331124 for details.Nico Weber2018-04-303-1/+2
| | | | llvm-svn: 331177
* Remove unnecessary indirection. No behavior change.Nico Weber2018-04-301-12/+6
| | | | llvm-svn: 331176
* Remove unused includes of clang/Config/config.hNico Weber2018-04-285-5/+0
| | | | | | | | | | | | | | | | | | | | Found by opening config.h.cmake in vim, finding all defined macros with /define\(01\)\? \zs[A-Za-z0-9_]*<cr> :%s//\=setreg('A', submatch(0), 'V')/gn<cr> :put A<cr> and then joining them all with |, and passing that to git grep -E that_pattern 'clang/*.h' 'clang/*.cpp' 'clang/*.c' and diffing that output with the result of git grep Config/config.h 'clang/*.h' 'clang/*.cpp' 'clang/*.c' No intended behavior change. llvm-svn: 331124
* s/LLVM_ON_WIN32/_WIN32/, clangNico Weber2018-04-274-5/+5
| | | | | | | | | | | LLVM_ON_WIN32 is set exactly with MSVC and MinGW (but not Cygwin) in HandleLLVMOptions.cmake, which is where _WIN32 defined too. Just use the default macro instead of a reinvented one. See thread "Replacing LLVM_ON_WIN32 with just _WIN32" on llvm-dev and cfe-dev. No intended behavior change. llvm-svn: 331069
* [Driver, CodeGen] add options to enable/disable an FP cast optimizationSanjay Patel2018-04-271-0/+5
| | | | | | | | | | | | | | | | | | | | | | As discussed in the post-commit thread for: rL330437 ( http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20180423/545906.html ) We need a way to opt-out of a float-to-int-to-float cast optimization because too much existing code relies on the platform-specific undefined result of those casts when the float-to-int overflows. The LLVM changes associated with adding this function attribute are here: rL330947 rL330950 rL330951 Also as suggested, I changed the LLVM doc to mention the specific sanitizer flag that catches this problem: rL330958 Differential Revision: https://reviews.llvm.org/D46135 llvm-svn: 331041
* [Driver] Don't enable "-fregister-global-dtors-with-atexit" by defaultAkira Hatanaka2018-04-271-1/+1
| | | | | | | | | when compiling the kernel or kexts. Destructors should be registered with atexit by default only when we are compiling userland code. llvm-svn: 331010
* [ConfigFiles] Update argument strings when merging argrument listsSerge Pavlov2018-04-261-1/+4
| | | | | | | | | | | Implementation of `InputArgList` assumes its field `ArgStrings` contains strings for each argument exactly in the same order. This condition was broken when arguments from config file and from invocation were merged. This change fixes https://bugs.llvm.org/show_bug.cgi?id=37196 (Clang config files can crash argument handling). llvm-svn: 330926
* Switch to Clang's isDigit function.Richard Trieu2018-04-251-4/+4
| | | | | | | | std::isdigit can be overloaded, causing the template deduction to fail. Use Clang's isDigit function which to avoid this. Switch the other calls for consistency. llvm-svn: 330887
* Include <cctype> to get std::isdigit, fixes MSVC STL buildReid Kleckner2018-04-251-0/+1
| | | | llvm-svn: 330886
* [RISCV] More validations on the input value of -march=Ana Pazos2018-04-251-20/+270
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Supporting additional rules for parsing ISA string. - RISC-V ISA strings must be lowercase. E.g.: rv32IMC is not supported, rv32imc is correct. - Multi-letter extensions are to be separated by a single underscore '_'. The extension prefix counts as a letter. This means extensions that start with 's', 'sx' and 'sx' are all multi-letter. E.g.: xasb is a single non-standard extension named 'xasb' xa_sb are two extensions, the non-standard user level extension 'xa', and the supervisor level extension 'sb'. - Standard user-level extensions are specified following a canonical order, according to Table 22.1 in RISC-V User-Level ISA V2.2. - Non-standard user-level 'x' extensions, standard supervisor-level 's' extensions and non-standard supervisor-level 'sx' extensions are also specified following a canonical order according to Table 22.1 in RISC-V User-Level ISA V2.2: 'x' extensions, follwed by 's' extensions and then 'sx' extensions. - Extensions might have a version number. Underscores may be used to separate ISA subset components to improve readability and to provide disambiguation. E.g.: rv32i2_m3_a1_f2_d2 - Version numbers are divided into major and minor numbers, separated by a 'p'. If the minor version is 0, then 'p0' can be omitted. - Additional checks for dependent extensions and invalid extensions combinations. E.g.: 'e' requires rv32 'e' can't be combined with 'f' nor 'd' 'q' requires rv64 - TODO items have also been marked with comments in the code. Reviewers: asb, kito-cheng Reviewed By: asb Subscribers: edward-jones, mgrang, zzheng, rbar, johnrusso, simoncook, jordy.potman.lists, sabuasal, niosHD, shiva0217, cfe-commits Differential Revision: https://reviews.llvm.org/D45284 llvm-svn: 330880
* [driver][darwin] Do not infer -simulator environment for OS version env varsAlex Lorenz2018-04-251-3/+16
| | | | | | | | with non-simulator SDKs rdar://37955008 llvm-svn: 330878
* [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
OpenPOWER on IntegriCloud