summaryrefslogtreecommitdiff
path: root/lib/Frontend/CompilerInvocation.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert commits r332160, r332164, r332236.Douglas Yung2018-05-161-10/+0
| | | | | | | It was decided this is the wrong approach to fix this issue. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332421 91177308-0d34-0410-b5e6-96231b3b80d8
* Force the PS4 clang ABI version to 6.Douglas Yung2018-05-121-0/+10
| | | | | | | | | | | | | | The PS4 requires clang ABI version 6 for compatibility reasons. This change forces this and if the user specifies a different version when the PS4 target is specified, the compiler emits a warning that the specified version is being ignored. Reviewers: probinson Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D46767 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332160 91177308-0d34-0410-b5e6-96231b3b80d8
* [CUDA] Added -f[no-]cuda-short-ptr optionArtem Belevich2018-05-091-0/+2
| | | | | | | | | The option enables use of 32-bit pointers for accessing const/local/shared memory. The feature is disabled by default. Differential Revision: https://reviews.llvm.org/D46148 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331938 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Restrict various keywords in OpenCL C++ modeSven van Haastregt2018-05-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Restrict the following keywords in the OpenCL C++ language mode, according to Sections 2.2 & 2.9 of the OpenCL C++ 1.0 Specification. - dynamic_cast - typeid - register (already restricted in OpenCL C, update the diagnostic) - thread_local - exceptions (try/catch/throw) - access qualifiers read_only, write_only, read_write Support the `__global`, `__local`, `__constant`, `__private`, and `__generic` keywords in OpenCL C++. Leave the unprefixed address space qualifiers such as global available, i.e., do not mark them as reserved keywords in OpenCL C++. libclcxx provides explicit address space pointer classes such as `global_ptr` and `global<T>` that are implemented using the `__`-prefixed qualifiers. Differential Revision: https://reviews.llvm.org/D46022 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331874 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-091-1/+1
| | | | | | | | | | | | | | | | | | | This is similar to the LLVM change https://reviews.llvm.org/D46290. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46320 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331834 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Factor out language version printingSven van Haastregt2018-05-081-5/+2
| | | | | | | | | | Generate a printable OpenCL language version number in a single place and select between the OpenCL C or OpenCL C++ version accordingly. Differential Revision: https://reviews.llvm.org/D46382 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331766 91177308-0d34-0410-b5e6-96231b3b80d8
* [ThinLTO] Support opt remarks options with distributed ThinLTO backendsTeresa Johnson2018-05-051-1/+3
| | | | | | | | | | | | | | | | | Summary: Passes down the necessary code ge options to the LTO Config to enable -fdiagnostics-show-hotness and -fsave-optimization-record in the ThinLTO backend for a distributed build. Also, remove warning about not having PGO when the input is IR. Reviewers: pcc Subscribers: mehdi_amini, inglorion, eraman, cfe-commits Differential Revision: https://reviews.llvm.org/D46464 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331592 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-cl] Print /showIncludes to stderr, if used in combination with /E, ↵Erich Keane2018-05-041-1/+11
| | | | | | | | | | | | | | | | | | /EP or /P This replicates 'cl.exe' behavior and allows for both preprocessor output and dependency information to be extraced with a single compiler invocation. This is especially useful for compiler caching with tools like Mozilla's sccache. See: https://github.com/mozilla/sccache/issues/246 Patch By: fxb Differential Revision: https://reviews.llvm.org/D46394 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331533 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Enable c++ exceptions outside of the target constructs iff they areAlexey Bataev2018-05-021-0/+1
| | | | | | | | | | enabled for the host. If the compilation for the host enables C++ exceptions, but they are not supported by the device, we still need to allow the code with the exception handling constructs outside of the target regions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331372 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement P0482R2, support for char8_t type.Richard Smith2018-05-011-0/+1
| | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331244 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver, CodeGen] rename options to disable an FP cast optimizationSanjay Patel2018-04-301-1/+2
| | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331209 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver, CodeGen] add options to enable/disable an FP cast optimizationSanjay Patel2018-04-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331041 91177308-0d34-0410-b5e6-96231b3b80d8
* [HIP] Add hip input kind and codegen for kernel launchingYaxun Liu2018-04-251-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | HIP is a language similar to CUDA (https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_kernel_language.md ). The language syntax is very similar, which allows a hip program to be compiled as a CUDA program by Clang. The main difference is the host API. HIP has a set of vendor neutral host API which can be implemented on different platforms. Currently there is open source implementation of HIP runtime on amdgpu target (https://github.com/ROCm-Developer-Tools/HIP). This patch adds support of input kind and language standard hip. When hip file is compiled, both LangOpts.CUDA and LangOpts.HIP is turned on. This allows compilation of hip program as CUDA in most cases and only special handling of hip program is needed LangOpts.HIP is checked. This patch also adds support of kernel launching of HIP program using HIP host API. When -x hip is not specified, there is no behaviour change for CUDA. Patch by Greg Rodgers. Revised and lit test added by Yaxun Liu. Differential Revision: https://reviews.llvm.org/D44984 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330790 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Reject virtual functions for OpenCL C++Sven van Haastregt2018-04-231-0/+1
| | | | | | | Differential Revision: https://reviews.llvm.org/D45873 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330579 91177308-0d34-0410-b5e6-96231b3b80d8
* [CodeGen] Reland r330442: Add an option to suppress output of llvm.identMikhail Maltsev2018-04-231-0/+2
| | | | | | | | The test case in the original patch was overly contrained and failed on PPC targets. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330575 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r330442, CodeGen/no-ident-version.c is failing on PPCMikhail Maltsev2018-04-201-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330451 91177308-0d34-0410-b5e6-96231b3b80d8
* [CodeGen] Add an option to suppress output of llvm.identMikhail Maltsev2018-04-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330442 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement proper support for `-falign-functions`Saleem Abdulrasool2018-04-191-0/+3
| | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330378 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330220 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a command line option 'fregister_global_dtors_with_atexit' toAkira Hatanaka2018-04-171-0/+2
| | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330199 91177308-0d34-0410-b5e6-96231b3b80d8
* [ThinLTO] Pass -save-temps to LTO backend for distributed ThinLTO buildsTeresa Johnson2018-04-171-2/+9
| | | | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330194 91177308-0d34-0410-b5e6-96231b3b80d8
* [XRay][clang] Add flag to choose instrumentation bundlesDean Michael Berris2018-04-131-2/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329985 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove -cc1 option "-backend-option".Eli Friedman2018-04-121-1/+0
| | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329965 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Added -std/-cl-std=c++Anastasia Stulova2018-04-121-1/+4
| | | | | | | | | | This is std option for OpenCL C++ v1.0. Differential Revision: https://reviews.llvm.org/D45363 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329911 91177308-0d34-0410-b5e6-96231b3b80d8
* [XRay][llvm+clang] Consolidate attribute list filesDean Michael Berris2018-04-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329543 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake option to allow enabling experimental new pass manager by defaultPetr Hosek2018-04-061-1/+1
| | | | | | | | | This CMake flag allows setting the default value for the -f[no]-experimental-new-pass-manager flag. Differential Revision: https://reviews.llvm.org/D44330 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329366 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable -fmerge-all-constants as default.Manoj Gupta2018-04-051-1/+1
| | | | | | | | | | | | | | | | | | | Summary: "-fmerge-all-constants" is a non-conforming optimization and should not be the default. It is also causing miscompiles when building Linux Kernel (https://lkml.org/lkml/2018/3/20/872). Fixes PR18538. Reviewers: rjmccall, rsmith, chandlerc Reviewed By: rsmith, chandlerc Subscribers: srhines, cfe-commits Differential Revision: https://reviews.llvm.org/D45289 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329300 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -fclang-abi-compat=6 flag for upcoming ABI changes.Richard Smith2018-04-021-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329000 91177308-0d34-0410-b5e6-96231b3b80d8
* [ObjC++] Make parameter passing and function return compatible with ObjCAkira Hatanaka2018-03-281-27/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ObjC and ObjC++ pass non-trivial structs in a way that is incompatible with each other. For example: typedef struct { id f0; __weak id f1; } S; // this code is compiled in c++. extern "C" { void foo(S s); } void caller() { // the caller passes the parameter indirectly and destructs it. foo(S()); } // this function is compiled in c. // 'a' is passed directly and is destructed in the callee. void foo(S a) { } This patch fixes the incompatibility by passing and returning structs with __strong or weak fields using the C ABI in C++ mode. __strong and __weak fields in a struct do not cause the struct to be destructed in the caller and __strong fields do not cause the struct to be passed indirectly. Also, this patch fixes the microsoft ABI bug mentioned here: https://reviews.llvm.org/D41039?id=128767#inline-364710 rdar://problem/38887866 Differential Revision: https://reviews.llvm.org/D44908 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328731 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] Change std::sort to llvm::sort in response to r327219Mandeep Singh Grang2018-03-271-2/+2
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328636 91177308-0d34-0410-b5e6-96231b3b80d8
* [Frontend] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2018-03-261-84/+110
| | | | | | other minor fixes (NFC). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328584 91177308-0d34-0410-b5e6-96231b3b80d8
* [vfs] Don't bail out after a missing -ivfsoverlay fileBen Langmuir2018-03-231-5/+4
| | | | | | | | | | | | | This make -ivfsoverlay behave more like other fatal errors (e.g. missing -include file) by skipping the missing file instead of bailing out of the whole compilation. This makes it possible for libclang to still provide some functionallity as well as to correctly produce the fatal error diagnostic (previously we lost the diagnostic in libclang since there was no TU to tie it to). rdar://33385423 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328337 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Honor -fmodule-name when handling private framework modulesBruno Cardoso Lopes2018-03-201-1/+2
| | | | | | | | | | | | | | | | When skipping building the module for a private framework module, LangOpts.CurrentModule isn't enough for implict modules builds; for instance, in case a private module is built while building a public one, LangOpts.CurrentModule doesn't reflect the -fmodule-name being passed down, but instead the module name which triggered the build. Store the actual -fmodule-name in LangOpts.ModuleName and actually check a name was provided during compiler invocation in order to skip building the private module. rdar://problem/38434694 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328053 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding nocf_check attribute for cf-protection fine tuningOren Ben Simhon2018-03-171-0/+6
| | | | | | | | | | The patch adds nocf_check target independent attribute for disabling checks that were enabled by cf-protection flag. The attribute can be appertained to functions and function pointers. Attribute name follows GCC's similar attribute name. Differential Revision: https://reviews.llvm.org/D41880 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@327768 91177308-0d34-0410-b5e6-96231b3b80d8
* [FrontEnd] Allow overriding the default C/C++ -std via CMake varsMichal Gorny2018-03-061-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide two new CMake cache variables -- CLANG_DEFAULT_STD_C and CLANG_DEFAULT_STD_CXX -- that can be used to override the default C/ObjC and C++/ObjC++ standards appropriately. They can be set to one of the identifiers from LangStandards.def, or left unset (the default) to respect the current platform default. This option is mostly intended for compiler vendors that may wish to adjust the defaults their compilers are using. For example, Gentoo planned to use it to set clang and gcc to matching standards, so that we could maintain as much compatibility between different compilers as possible. The code relies on explicit identifiers rather than the string aliases for simplicity. This saves us from the necessity of parsing aliases at build-time or adding additional processing at runtime. For the latter case, it also adds trivial value check -- if incorrect value is passed, the code simply fails to compile through referencing an undefined constant. If the variable is used to redefine the default standard, the explicit value overrides the special case for PS4. It is done this way mostly following other kinds of variables where 'platform defaults' are redefined. Differential Revision: https://reviews.llvm.org/D34365 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326836 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an option to disable tail-call optimization for escaping blocks.Akira Hatanaka2018-03-021-0/+2
| | | | | | | | | | | | | This makes it easier to debug crashes and hangs in block functions since users can easily find out where the block is called from. The option doesn't disable tail-calls from non-escaping blocks since non-escaping blocks are not as hard to debug as escaping blocks. rdar://problem/35758207 Differential Revision: https://reviews.llvm.org/D43841 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326530 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Pass -f[no-]emulated-tls and set up ExplicitEmulatedTLSChih-Hung Hsieh2018-03-011-2/+6
| | | | | | | | | | | | | Since LLVM r326341, default EmulatedTLS mode is decided in backend according to target triple. Any front-end should pass -f[no]-emulated-tls to backend and set up ExplicitEmulatedTLS only when the flags are used. Differential Revision: https://reviews.llvm.org/D43965 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326499 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenMP] Extend NVPTX SPMD implementation of combined constructsCarlo Bertolli2018-02-281-0/+4
| | | | | | | | | | | Differential Revision: https://reviews.llvm.org/D43852 This patch extends the SPMD implementation to all target constructs and guards this implementation under a new flag. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326368 91177308-0d34-0410-b5e6-96231b3b80d8
* [CUDA] Include single GPU binary, NFCI.Jonas Hahnfeld2018-02-281-2/+2
| | | | | | | | | Binaries for multiple architectures are combined by fatbinary, so the current code was effectively not needed. Differential Revision: https://reviews.llvm.org/D43461 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326342 91177308-0d34-0410-b5e6-96231b3b80d8
* [DebugInfo] Support DWARF v5 source code embedding extensionScott Linder2018-02-261-0/+1
| | | | | | | | | | | | | | In DWARF v5 the Line Number Program Header is extensible, allowing values with new content types. This vendor extension to DWARF v5 allows source text to be embedded directly in the line tables of the debug line section. Add new flag (-g[no-]embed-source) to Driver and CC1 which indicates that source should be passed through to LLVM during CodeGen. Differential Revision: https://reviews.llvm.org/D42766 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326102 91177308-0d34-0410-b5e6-96231b3b80d8
* [RISCV] Enable __int128_t and __uint128_t through clang flagMandeep Singh Grang2018-02-251-0/+1
| | | | | | | | | | | | | | | | Summary: If the flag -fforce-enable-int128 is passed, it will enable support for __int128_t and __uint128_t types. This flag can then be used to build compiler-rt for RISCV32. Reviewers: asb, kito-cheng, apazos, efriedma Reviewed By: asb, efriedma Subscribers: shiva0217, efriedma, jfb, dschuff, sdardis, sbc100, jgravelle-google, aheejin, rbar, johnrusso, simoncook, jordy.potman.lists, sabuasal, niosHD, cfe-commits Differential Revision: https://reviews.llvm.org/D43105 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326045 91177308-0d34-0410-b5e6-96231b3b80d8
* Support for the mno-stack-arg-probe flagHans Wennborg2018-02-231-0/+2
| | | | | | | | | | | | Adds support for this flag. There is also another piece for llvm (separate review). More info: https://bugs.llvm.org/show_bug.cgi?id=36221 By Ruslan Nikolaev! Differential Revision: https://reviews.llvm.org/D43108 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@325901 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Add '-cl-uniform-work-group-size' compile optionAlexey Sotkin2018-02-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: OpenCL 2.0 specification defines '-cl-uniform-work-group-size' option, which requires that the global work-size be a multiple of the work-group size specified to clEnqueueNDRangeKernel and allows optimizations that are made possible by this restriction. The patch introduces the support of this option. To keep information about whether an OpenCL kernel has uniform work group size or not, clang generates 'uniform-work-group-size' function attribute for every kernel: - "uniform-work-group-size"="true" for OpenCL 1.2 and lower, - "uniform-work-group-size"="true" for OpenCL 2.0 and higher if '-cl-uniform-work-group-size' option was specified, - "uniform-work-group-size"="false" for OpenCL 2.0 and higher if no '-cl-uniform-work-group-size' options was specified. If the function is not an OpenCL kernel, 'uniform-work-group-size' attribute isn't generated. Patch by: krisb Reviewers: yaxunl, Anastasia, b-sumner Reviewed By: yaxunl, Anastasia Subscribers: nhaehnle, yaxunl, Anastasia, cfe-commits Differential Revision: https://reviews.llvm.org/D43570 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@325771 91177308-0d34-0410-b5e6-96231b3b80d8
* ASan+operator new[]: Add an option for more thorough operator new[] cookie ↵Filipe Cabecinhas2018-02-121-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | poisoning Summary: Right now clang is skipping array cookie poisoning for any operator new[] which is not part of the set of replaceable global allocation functions. This commit adds a flag to tell clang to poison all operator new[] cookies. A previous review was poisoning all array cookies unconditionally, but there is an edge case which would stop working under ASan (a custom operator new[] saves whatever pointer it returned, and then accesses it). This newer revision adds a command line argument to toggle this feature. Original revision: https://reviews.llvm.org/D41301 Compiler-rt test revision with an explanation of the edge case: https://reviews.llvm.org/D41664 Reviewers: rjmccall, kcc, rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D43013 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324884 91177308-0d34-0410-b5e6-96231b3b80d8
* [CUDA] Add option to generate relocatable device codeJonas Hahnfeld2018-02-121-0/+2
| | | | | | | | | | | As a first step, pass '-c/--compile-only' to ptxas so that it doesn't complain about references to external function. This will successfully generate object files, but they won't work at runtime because the registration routines need to adapted. Differential Revision: https://reviews.llvm.org/D42921 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324878 91177308-0d34-0410-b5e6-96231b3b80d8
* [Templight] Template Instantiation ObserverGabor Horvath2018-02-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | This patch adds a base-class called TemplateInstantiationObserver which gets notified whenever a template instantiation is entered or exited during semantic analysis. This is a base class used to implement the template profiling and debugging tool called Templight (https://github.com/mikael-s-persson/templight). The patch also makes a few more changes: * ActiveTemplateInstantiation class is moved out of the Sema class (so it can be used with inclusion of Sema.h). * CreateFrontendAction function in front-end utilities is given external linkage (not longer a hidden static function). * TemplateInstObserverChain data member added to Sema class to hold the list of template-inst observers. * Notifications to the template-inst observer are added at the key places where templates are instantiated. Patch by: Abel Sinkovics! Differential Revision: https://reviews.llvm.org/D5767 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324808 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Show full analyzer invocation for reproducibility in HTML reportsGeorge Karpenkov2018-01-231-0/+8
| | | | | | | | | | | | Analyzing problems which appear in scan-build results can be very difficult, as after the launch no exact invocation is stored, and it's super-hard to launch the debugger. With this patch, the exact analyzer invocation appears in the footer, and can be copied to debug/check reproducibility/etc. rdar://35980230 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323245 91177308-0d34-0410-b5e6-96231b3b80d8
* Use an enum value instead of a string.Rafael Espindola2018-01-181-5/+13
| | | | | | | | The old StringSwitch use was also broken. It assumed that a StringSwitch returns Optional<T> instead of T and was missing a .Default. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@322792 91177308-0d34-0410-b5e6-96231b3b80d8
* Reland "Emit Function IDs table for Control Flow Guard"Adrian McCarthy2018-01-091-0/+2
| | | | | | | | | | | | | | | | | Adds option /guard:cf to clang-cl and -cfguard to cc1 to emit function IDs of functions that have their address taken into a section named .gfids$y for compatibility with Microsoft's Control Flow Guard feature. The original patch didn't have the lit.local.cfg file that restricts the new test to x86, thus the new test was failing on the non-x86 bots. Differential Revision: https://reviews.llvm.org/D40531 The reverts r322008, which was a revert of r322005. This reverts commit a05b89f9aca70597dc79fe97bc49b50b51f525ba. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@322136 91177308-0d34-0410-b5e6-96231b3b80d8
* [Frontend] Remove unused FileMgr in pp arg parseBrian Gesiak2018-01-091-7/+1
| | | | | | | | | | | | | | | | | | | | | Summary: A FIXME added 8 years ago (2010) in https://reviews.llvm.org/rL118203 mentioned that a FileManager should not need to be used when parsing preprocessor arguments. In fact, its only use was removed 6 years ago (2012), in https://reviews.llvm.org/rL166452. Remove the unused variable and the obsolete FIXME. Test Plan: `check-clang` Reviewers: v.g.vassilev Reviewed By: v.g.vassilev Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D41867 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@322118 91177308-0d34-0410-b5e6-96231b3b80d8