summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [CUDA] Use the right section and constant names for fatbins when compiling ↵Justin Lebar2016-11-181-3/+8
| | | | | | | | | | | | for macos. Reviewers: tra Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26777 llvm-svn: 287287
* [CUDA] Initialize our header search using the host triple.Justin Lebar2016-11-181-2/+9
| | | | | | | | | | | | | | | | Summary: This used to work because system headers are found in a (somewhat) predictable set of locations on Linux. But this is not the case on MacOS; without this change, we don't look in the right places for our headers when doing device-side compilation on Mac. Reviewers: tra Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26776 llvm-svn: 287286
* [CUDA] Driver changes to support CUDA compilation on MacOS.Justin Lebar2016-11-184-111/+201
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Compiling CUDA device code requires us to know the host toolchain, because CUDA device-side compiles pull in e.g. host headers. When we only supported Linux compilation, this worked because CudaToolChain, which is responsible for device-side CUDA compilation, inherited from the Linux toolchain. But in order to support MacOS, CudaToolChain needs to take a HostToolChain pointer. Because a CUDA toolchain now requires a host TC, we no longer will create a CUDA toolchain from Driver::getToolChain -- you have to go through CreateOffloadingDeviceToolChains. I am *pretty* sure this is correct, and that previously any attempt to create a CUDA toolchain through getToolChain() would eventually have resulted in us throwing "error: unsupported use of NVPTX for host compilation". In any case hacking getToolChain to create a CUDA+host toolchain would be wrong, because a Driver can be reused for multiple compilations, potentially with different host TCs, and getToolChain will cache the result, causing us to potentially use a stale host TC. So that's the main change in this patch. In addition, we have to pull CudaInstallationDetector out of Generic_GCC and into a top-level class. It's now used by the Generic_GCC and MachO toolchains. Reviewers: tra Subscribers: rryan, hfinkel, sfantao Differential Revision: https://reviews.llvm.org/D26774 llvm-svn: 287285
* Minor changes in x86 intrinsics headers; NFCEkaterina Romanova2016-11-174-15/+36
| | | | | | | | | | | | | | | | | | | | | | | | I made several changes for consistency with the rest of x86 instrinsics header files. Some of these changes help to render doxygen comments better. 1. avxintrin.h – Moved the opening bracket on a separate line for several intrinsics (for consistency with the rest of the intrinsics). 2. emmintrin.h - Moved the doxygen comment next to the body of the function; - Added braces after extern "C" even though there is only one declaration each time 3. xmmintrin.h - Moved the doxygen comment next to the body of the function; - Added intrinsic prototypes for a couple of macro definitions into the doxygen comment; - Added braces after extern "C" even though there is only one declaration each time 4. ammintrin.h – Removed extra line between the doxygen comment and the body of the functions (for consistency with the rest of the files). Desk reviewed by Paul Robinson. llvm-svn: 287278
* [Preprocessor] Support for '-dI' flagBruno Cardoso Lopes2016-11-172-8/+27
| | | | | | | | | | | | | | | | | Re-introduce r285411. Implement the -dI as supported by GCC: Output ‘#include’ directives in addition to the result of preprocessing. This change aims to add this option, pass it through to the preprocessor via the options class, and when inclusions occur we output some information (+ test cases). Patch by Steve O'Brien! Differential Revision: https://reviews.llvm.org/D26089 llvm-svn: 287275
* [CrashReproducer][Darwin] Suggest attaching .crash diagnostic fileBruno Cardoso Lopes2016-11-171-0/+115
| | | | | | | | | | | | | | | | | | | | | | | In addition to the preprocessed sources file and reproducer script, also point to the .crash diagnostic files on Darwin. Example: PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang-4.0: note: diagnostic msg: /var/folders/bk/1hj20g8j4xvdj5gd25ywhd3m0000gq/T/RegAllocGreedy-238f28.cpp clang-4.0: note: diagnostic msg: /var/folders/bk/1hj20g8j4xvdj5gd25ywhd3m0000gq/T/RegAllocGreedy-238f28.cache clang-4.0: note: diagnostic msg: /var/folders/bk/1hj20g8j4xvdj5gd25ywhd3m0000gq/T/RegAllocGreedy-238f28.sh clang-4.0: note: diagnostic msg: /var/folders/bk/1hj20g8j4xvdj5gd25ywhd3m0000gq/T/RegAllocGreedy-238f28.crash When no match is found for the .crash, point the user to a directory where those can be found. Example: clang-4.0: note: diagnostic msg: Crash backtrace is located in clang-4.0: note: diagnostic msg: /Users/bruno/Library/Logs/DiagnosticReports/clang-4.0_<YYYY-MM-DD-HHMMSS>_<hostname>.crash clang-4.0: note: diagnostic msg: (choose the .crash file that corresponds to your crash) rdar://problem/27286266 llvm-svn: 287262
* Fixes for r287241. Use placement new. Apply clang-format.Malcolm Parsons2016-11-173-8/+6
| | | | llvm-svn: 287258
* ObjC Module: try to make objc module deterministic.Manman Ren2016-11-171-2/+8
| | | | | | | Make sure that comparing selectors in DeclarationName does its job. rdar://problem/28988750 llvm-svn: 287244
* Use unique_ptr for cached tokens for default arguments in C++.Malcolm Parsons2016-11-175-16/+16
| | | | | | | | | | | | | | | | | Summary: This changes pointers to cached tokens for default arguments in C++ from raw pointers to unique_ptrs. There was a fixme in the code where the cached tokens are created about using a smart pointer. The change is straightforward, though I did have to track down and fix a memory corruption caused by the change. memcpy was being used to copy parameter information. This duplicated the unique_ptr, which led to the cached token buffer being deleted prematurely. Patch by David Tarditi! Reviewers: malcolm.parsons Subscribers: arphaman, malcolm.parsons, cfe-commits Differential Revision: https://reviews.llvm.org/D26435 llvm-svn: 287241
* Sema: correct typo correction for ivars in @implementationSaleem Abdulrasool2016-11-171-3/+10
| | | | | | | | | | | | The previous typo correction handling assumed that ivars are only declared in the interface declaration rather than as a private ivar in the implementation. Adjust the handling to permit both interfaces. Assert earlier that the interface has been acquired to ensure that we can identify when both possible casts have failed. Addresses PR31040! llvm-svn: 287238
* [OPENMP] Fixed codegen for 'omp cancel' construct.Alexey Bataev2016-11-172-8/+112
| | | | | | | If 'omp cancel' construct is used in a worksharing construct it may cause hanging of the software in case if reduction clause is used. Patch fixes this problem by avoiding extra reduction processing for branches that were canceled. llvm-svn: 287227
* [Sema] Fix a bug in enable_if condition instantiation.George Burgess IV2016-11-171-3/+2
| | | | | | | | | | | During template instantiation, we currently fall back to just calling Sema::SubstExpr for enable_if attributes that aren't value-dependent or type-dependent. Since Sema::SubstExpr strips off any implicit casts we've added to an expression, it's possible that this behavior will leave us with an enable_if condition that's just a DeclRefExpr. Conditions like that deeply confuse Sema::CheckEnableIf. llvm-svn: 287187
* Insert a type check before reading vtable.Ivan Krasin2016-11-171-11/+22
| | | | | | | | | | | | | | | Summary: this is to prevent a situation when a pointer is invalid or null, but we get to reading from vtable before we can check that (possibly causing a segfault without a good diagnostics). Reviewers: pcc Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26559 llvm-svn: 287181
* Add warning when assigning enums to bitfields without an explicit unsigned ↵Reid Kleckner2016-11-161-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | underlying type Summary: Add a warning when assigning enums to bitfields without an explicit unsigned underlying type. This is to prevent problems with MSVC compatibility, since the Microsoft ABI defaults to storing enums with a signed type, causing inconsistencies with saving to/reading from bitfields. Also disabled the warning in the dr0xx.cpp test which throws the error, and added a test for the warning. The warning can be disabled with -Wno-signed-enum-bitfield. Patch by Sasha Bermeister! Reviewers: rnk, aaron.ballman Subscribers: mehdi_amini, aaron.ballman, cfe-commits, thakis, dcheng Differential Revision: https://reviews.llvm.org/D24289 llvm-svn: 287177
* [analyzer] Remove unused check::RegionChanges::wantsRegionChangeUpdate callbackAnna Zaks2016-11-164-29/+4
| | | | | | | | | | | Remove the check::RegionChanges::wantsRegionChangeUpdate callback as it is no longer used (since checkPointerEscape has been added). A patch by Krzysztof Wiśniewski! Differential Revision: https://reviews.llvm.org/D26759 llvm-svn: 287175
* Use the member function location in enable_if diagnostics.George Burgess IV2016-11-161-2/+2
| | | | | | | | | | | | | | Before: <stdin>:3:3: error: no matching member function for call to 'bar' Foo().bar(); ^ After: <stdin>:3:9: error: no matching member function for call to 'bar' Foo().bar(); ^ llvm-svn: 287154
* Rangify for loops, NFC.Yaron Keren2016-11-161-11/+8
| | | | llvm-svn: 287138
* Fix PR31029 by attaching an artificial debug location to msabi thunks.Adrian Prantl2016-11-161-0/+3
| | | | | | This was a latent bug that was recently uncovered by r286400. llvm-svn: 287134
* [Frontend] Allow attaching an external sema source to compiler instance and ↵Benjamin Kramer2016-11-162-0/+14
| | | | | | | | | | | extra diags to TypoCorrections This can be used to append alternative typo corrections to an existing diag. include-fixer can use it to suggest includes to be added. Differential Revision: https://reviews.llvm.org/D26745 llvm-svn: 287128
* Remove duplicate condition (PR30648). NFCI.Simon Pilgrim2016-11-161-2/+1
| | | | | | We only need to check that the bitstream entry is a Record. llvm-svn: 287114
* Add a little endian variant of TCE.Pekka Jaaskelainen2016-11-165-2/+52
| | | | llvm-svn: 287112
* Rangify for loop, NFC.Yaron Keren2016-11-161-6/+4
| | | | llvm-svn: 287102
* [OpenCL] Use the semantic spelling of the Access attribute, rather than a ↵Joey Gouly2016-11-161-12/+15
| | | | | | | | | string. Also fix a latent bug, due to an incorrect traversal of the AttributeList. llvm-svn: 287100
* [X86][AVX512] Replace lossless i32/u32 to f64 conversion intrinsics with ↵Simon Pilgrim2016-11-162-56/+41
| | | | | | | | | | | | | | generic IR Both the (V)CVTDQ2PD (i32 to f64) and (V)CVTUDQ2PD (u32 to f64) conversion instructions are lossless and can be safely represented as generic __builtin_convertvector calls instead of x86 intrinsics without affecting final codegen. This patch removes the clang builtins and their use in the headers - a future patch will deal with removing the llvm intrinsics. This is an extension patch to D20528 which dealt with the equivalent sse/avx cases. Differential Revision: https://reviews.llvm.org/D26686 llvm-svn: 287088
* Improve handling of __FUNCTION__ and other predefined expression for ↵Mehdi Amini2016-11-162-15/+26
| | | | | | | | | | | | | | Objective-C Blocks Instead of always displaying the mangled name, try to do better and get something closer to regular functions. Recommit r287039 (that was reverted in r287039) with a tweak to be more generic, and test fixes! Differential Revision: https://reviews.llvm.org/D26522 llvm-svn: 287085
* [Driver] Infer the correct option to ld64 for -fembed-bitcodeSteven Wu2016-11-162-25/+19
| | | | | | | | | | | | | | | | | | Summary: -fembed-bitcode infers -bitcode_bundle to ld64 but it is not correctly passed when using LTO. LTO is a special case of -fembed-bitcode which it doesn't require embed the bitcode in a special section in the object file but it requires linker to save that as part of the final executable. rdar://problem/29274226 Reviewers: mehdi_amini Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26690 llvm-svn: 287084
* Revert "[OPENMP] Fixed codegen for 'omp cancel' construct."Vitaly Buka2016-11-162-63/+6
| | | | | | | | | | | | | | | | Summary: r286944 introduced bugs detected by ASAN as use-after-return. r287025 have not fixed them completely. This reverts commit r286944 and r287025. Reviewers: ABataev Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26720 llvm-svn: 287069
* Outline evaluation of calls to builtins to avoid inflating stack usage for theRichard Smith2016-11-161-1/+19
| | | | | | | common case of a call to a non-builtin, particularly for unoptimized ASan builds (where the per-variable stack usage can be quite high). llvm-svn: 287066
* [analyzer] NumberObjectConversion: Workaround for a linker error with modules.Artem Dergachev2016-11-151-19/+19
| | | | | | | | | | A combination of C++ modules, variadic functions with more than one argument, and const globals in headers (all three being necessary) causes some releases of clang to misplace the matcher objects, which causes the linker to fail. No functional change - the extra allOf() matcher is no-op here. llvm-svn: 287045
* Revert "Improve handling of __FUNCTION__ and other predefined expression for ↵Mehdi Amini2016-11-152-25/+14
| | | | | | | | Objective-C Blocks" This reverts commit r287039, tests are broken. llvm-svn: 287043
* Improve handling of __FUNCTION__ and other predefined expression for ↵Mehdi Amini2016-11-152-14/+25
| | | | | | | | | | | Objective-C Blocks Instead of always displaying the mangled name, try to do better and get something closer to regular functions. Differential Revision: https://reviews.llvm.org/D26522 llvm-svn: 287039
* [OPENMP] Fix stack use after delete, NFC.Alexey Bataev2016-11-151-5/+4
| | | | | | Fixed possible use of stack variable after deletion. llvm-svn: 287025
* [Modules] Replace arrays with init lists.Benjamin Kramer2016-11-151-9/+5
| | | | | | | Thi way the compiler can pick the optimal storage duration. It's also more readable. No functional change intended. llvm-svn: 287005
* [analyzer] Add check for when block is called with too few arguments.Devin Coughlin2016-11-151-8/+13
| | | | | | | | | The CallAndMessageChecker has an existing check for when a function pointer is called with too few arguments. Extend this logic to handle the block case, as well. While we're at it, do a drive-by grammar correction ("less" --> "fewer") on the diagnostic text. llvm-svn: 287001
* Fixed spelling in comments. NFCI.Simon Pilgrim2016-11-151-1/+1
| | | | llvm-svn: 286996
* vector load store with length (left justified) clang portionZaara Syeda2016-11-152-7/+191
| | | | llvm-svn: 286994
* test commmitZaara Syeda2016-11-151-1/+0
| | | | llvm-svn: 286977
* [clang-format] Fixed line merging of more than two linesCameron Desrochers2016-11-151-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D19063 llvm-svn: 286973
* [PowerPC] Implement BE VSX load/store builtins - clang portion.Tony Jiang2016-11-152-2/+186
| | | | | | | | | | | | This patch implements all the overloads for vec_xl_be and vec_xst_be. On BE, they behaves exactly the same with vec_xl and vec_xst, therefore they are simply implemented by defining a matching macro. On LE, they are implemented by defining new builtins and intrinsics. For int/float/long long/double, it is just a load (lxvw4x/lxvd2x) or store(stxvw4x/stxvd2x). For char/char/short, we also need some extra shuffling before or after call the builtins to get the desired BE order. For int128, simply call vec_xl or vec_xst. llvm-svn: 286971
* [OPENMP] Fix for PR30632: Name mangling issue.Alexey Bataev2016-11-151-3/+4
| | | | | | | | Reworked fix after comments from Richard Smith. We must skip all CapturedDecl-based contexts when trying to get correct mangling number context. llvm-svn: 286953
* [OPENMP] Fixed codegen for 'omp cancel' construct.Alexey Bataev2016-11-152-6/+64
| | | | | | | | | If 'omp cancel' construct is used in a worksharing construct it may cause hanging of the software in case if reduction clause is used. Patch fixes this problem by avoiding extra reduction processing for branches that were canceled. llvm-svn: 286944
* [analyzer] Rename assumeWithinInclusiveRange*()Dominic Chen2016-11-154-8/+8
| | | | | | | | | | | | Summary: The name is slightly confusing, since the constraint is not necessarily within the range unless `Assumption` is true. Split out renaming for ConstraintManager.h from D26061 Reviewers: zaks.anna, dcoughlin Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26644 llvm-svn: 286927
* [analyzer] Minor optimization: avoid setting state if unchangedDominic Chen2016-11-151-4/+6
| | | | | | | | | | | | Summary: Split out optimization from D26061 Reviewers: zaks.anna, dcoughlin Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26642 llvm-svn: 286925
* [analyzer] Fix crash in NullabilityChecker calling block with too few argumentsDevin Coughlin2016-11-141-3/+4
| | | | | | | | | Fix a crash when checking parameter nullability on a block invocation with fewer arguments than the block declaration requires. rdar://problem/29237566 llvm-svn: 286901
* [PPC] altivec.h functions for converting half precision to single precision.Sean Fertile2016-11-141-0/+21
| | | | | | | | | | Adds 2 vector functions for converting from a vector of unsigned short to a vector of float. One converts the low 4 halfwords and one converts the high 4 halfwords. Differential Revision: https://reviews.llvm.org/D26534 llvm-svn: 286863
* [OpenCL] Fix for integer parameters of enqueue_kernelAnastasia Stulova2016-11-142-42/+36
| | | | | | | | | | | | | | Make handling integer parameters more flexible: - For the number of events argument allow to pass larger integers than 32 bits as soon as compiler can prove that the range fits in 32 bits. If not, the diagnostic will be given. - Change type of the arguments specifying the sizes of the corresponding block arguments to be size_t. Review: https://reviews.llvm.org/D26509 llvm-svn: 286849
* [OpenCL] Change to clk_event parameter in enqueue_kernel.Anastasia Stulova2016-11-142-17/+17
| | | | | | | | | - Accept NULL pointer as a valid parameter value for clk_event. - Generate clk_event_t arguments of internal __enqueue_kernel_XXX function as pointers in generic address space. Review: https://reviews.llvm.org/D26507 llvm-svn: 286836
* [PPC] add extract sig/exp test data class for vec float and vec double.Sean Fertile2016-11-141-1/+59
| | | | | | | | | | Add vector extract exponent/significand functions to altivec.h, as well as functions (and related constants) to test the data class of vector float and vector double. Differential Revision: https://reviews.llvm.org/D26271 llvm-svn: 286830
* [OpenCL] always use SPIR address spaces for kernel_arg_addr_space MDPekka Jaaskelainen2016-11-141-3/+19
| | | | | | | | | | | | | | | It doesn't make sense to use the target's address space ids in this context as this is metadata that should be referring to the "logical" OpenCL address spaces. For flat AS machines like all "CPUs" in general, the logical AS info gets lost as there's only one address space (0). This commit changes the logic such that we always use the SPIR address space ids for the argument metadata. It thus allows implementing the clGetKernelArgInfo() and the other detection needs. https://reviews.llvm.org/D26157 llvm-svn: 286819
* Revert "Improve handling of floating point literals in OpenCL to only use ↵Renato Golin2016-11-142-23/+9
| | | | | | | | double precision if the target supports fp64." This reverts commit r286815, as it broke all ARM and AArch64 bots. llvm-svn: 286818
OpenPOWER on IntegriCloud