summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Improve handling of floating point literals in OpenCL to only use double ↵Neil Hickey2016-11-142-9/+23
| | | | | | | | | | | | | | precision if the target supports fp64. This change makes sure single-precision floating point types are used if the cl_fp64 extension is not supported by the target. Also removed the check to see whether the OpenCL version is >= 1.2, as this has been incorporated into the extension setting code. Differential Revision: https://reviews.llvm.org/D24235 llvm-svn: 286815
* Remove some false positives when taking the address of packed membersRoger Ferrer Ibanez2016-11-141-15/+93
| | | | | | Differential Revision: https://reviews.llvm.org/D23657 llvm-svn: 286798
* [AVX-512] Replace masked dword and qword variable shift builtins with ↵Craig Topper2016-11-132-136/+78
| | | | | | | | unmasked builtins and a select. This is part of a set of changes to allow InstCombine in the backend to optimize variable shifts without having to know about masking. llvm-svn: 286757
* [X86] Remove extra escaped new lines in intrinsic headers left over from an ↵Craig Topper2016-11-133-113/+113
| | | | | | earlier conversion away from a macro. NFC llvm-svn: 286756
* Bitcode: Change module reader functions to return an llvm::Expected.Peter Collingbourne2016-11-132-5/+8
| | | | | | Differential Revision: https://reviews.llvm.org/D26562 llvm-svn: 286752
* Fix PR28366: Handle variables from enclosing local scopes more gracefully ↵Faisal Vali2016-11-132-3/+14
| | | | | | | | | | | | | | | | | | during constant expression evaluation. Only look for a variable's value in the constant expression evaluation activation frame, if the variable was indeed declared in that frame, otherwise it might be a constant expression and be usable within a nested local scope or emit an error. void f(char c) { struct X { static constexpr char f() { return c; // error gracefully here as opposed to crashing. } }; int I = X::f(); } llvm-svn: 286748
* [AMDGPU] Add f16 builtin functions (VI+)Konstantin Zhuravlyov2016-11-131-4/+12
| | | | | | Differential Revision: https://reviews.llvm.org/D26476 llvm-svn: 286741
* [AVX-512] Add returns to shift intrinsics that converted from macros in r286714.Craig Topper2016-11-131-3/+3
| | | | llvm-svn: 286738
* Revert r286735 due to test failureBrad Smith2016-11-131-4/+0
| | | | llvm-svn: 286736
* Link static PIE programs against rcrt0.o on OpenBSDBrad Smith2016-11-121-0/+4
| | | | | | Patch by Stefan Kempf. llvm-svn: 286735
* [AVX-512] Use scalar vfmsub/vfnmsub mask3 intrinsics instead of inverting ↵Craig Topper2016-11-121-16/+16
| | | | | | | | | | | | | | the mask argument of a vfmadd intrinsic. Summary: Inverting the mask argument does not reflect the intended semantics of the intrinsic. Reviewers: igorb, delena Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26019 llvm-svn: 286733
* Use descriptive message if list initializer is incorrectly parenthesized.Serge Pavlov2016-11-122-1/+48
| | | | | | | | | | | | | If initializer contains parentheses around braced list where it is not allowed, as in construct int({0}), clang issued message like `functional-style cast from 'void' to 'int' is not allowed`, which does not help much. Both gcc and msvc issue message `list-initializer for non-class type must not be parenthesized`, which is more descriptive. This change implements similar message for clang. Differential Revision: https://reviews.llvm.org/D25816 llvm-svn: 286721
* Add support of the next Ubuntu (17.04 - Zesty Zapus)Sylvestre Ledru2016-11-121-1/+3
| | | | llvm-svn: 286716
* clang-format: Support ObjC selectors with unnamed parameters.Daniel Jasper2016-11-122-9/+33
| | | | | | This fixes llvm.org/PR28063. llvm-svn: 286715
* [AVX-512] Convert the rest of the masked shift by immediate and by single ↵Craig Topper2016-11-124-338/+316
| | | | | | | | element builtins over to the newly added unmasked builtins and a select. This should also fix PR30691 since the new builtins are handled like the legacy builtins in the backend. llvm-svn: 286714
* [analyzer] Update 'Automated' to 'Automatic' from r286694.Devin Coughlin2016-11-121-1/+1
| | | | | | ARC is 'Automatic Reference Counting' and not 'Automated Reference Counting'. llvm-svn: 286700
* [c++1z] Support constant folding for __builtin_strchr and __builtin_memchr.Richard Smith2016-11-121-3/+62
| | | | llvm-svn: 286699
* [analyzer] Improve misleading RetainCountChcker diagnostic under ARCDevin Coughlin2016-11-121-4/+9
| | | | | | | | | | | | | | | | | | | | Under automated reference counting the analyzer treats a methods -- even those starting with 'copy' and friends -- as returning an unowned value. This is because ownership of CoreFoundation objects must be transferred to ARC with __bridge_transfer or CFBridgingRelease() before being returned as ARC-managed bridged objects. Unfortunately this could lead to a poor diagnostic inside copy methods under ARC where the analyzer would complain about a leak of a returned CF value inside a method "whose name does not start with 'copy'" -- even though the name did start with 'copy'. This commit improves the diagnostic under ARC to say inside a method "returned from a method managed by Automated Reference Counting". rdar://problem/28849667 llvm-svn: 286694
* [index] Rename SymbolSubKind -> SymbolProperty, NFC.Argyrios Kyrtzidis2016-11-111-50/+50
| | | | | | This better reflects what it represents. llvm-svn: 286680
* [c++1z] Add constant-folding support for strcmp, strncmp, and memcmp, toRichard Smith2016-11-111-0/+50
| | | | | | support constexpr char_traits. llvm-svn: 286678
* [tsan][clang] Introduce a function attribute to disable TSan checking at run ↵Anna Zaks2016-11-111-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | time This introduces a function annotation that disables TSan checking for the function at run time. The benefit over attribute((no_sanitize("thread"))) is that the accesses within the callees will also be suppressed. The motivation for this attribute is a guarantee given by the objective C language that the calls to the reference count decrement and object deallocation will be synchronized. To model this properly, we would need to intercept all ref count decrement calls (which are very common in ObjC due to use of ARC) and also every single message send. Instead, we propose to just ignore all accesses made from within dealloc at run time. The main downside is that this still does not introduce any synchronization, which means we might still report false positives if the code that relies on this synchronization is not executed from within dealloc. However, we have not seen this in practice so far and think these cases will be very rare. (This problem is similar in nature to https://reviews.llvm.org/D21609; unfortunately, the same solution does not apply here.) Differential Revision: https://reviews.llvm.org/D25857 llvm-svn: 286672
* Tread TSan LLVM flags to driver: add TSan controlling flags to clang.Evgeniy Stepanov2016-11-111-0/+28
| | | | | | | | | | | | | | | | | | Summary: New clang flags, all default to true: -f[no-]sanitize-thread-data-races -f[no-]sanitize-thread-stack-traces -f[no-]sanitize-thread-atomics Reviewers: dvyukov, pcc, eugenis Subscribers: pcc, cfe-commits Patch by Alex Shlyapnikov. Differential Revision: https://reviews.llvm.org/D26461 llvm-svn: 286669
* [PowerPC] Implement remaining permute builtins in altivec.h - Clang portionNemanja Ivanovic2016-11-111-0/+129
| | | | | | | | | This patch corresponds to review: https://reviews.llvm.org/D26479 It adds the remaining vector permute/rotate builtins to altivec.h. llvm-svn: 286650
* Remove double setting of invalid flag.Richard Trieu2016-11-111-2/+0
| | | | | | | | In r286630, Decl::setInvalidDecl will automatically set the invalid flag for BindingDecl for children in invalid DecompositionDecl. It no longer is necessary to do a separate setInvalidDecl when finalizing a BindingDecl. llvm-svn: 286641
* [analyzer] Teach RetainCountChecker about VTCompressionSessionEncodeFrame()Devin Coughlin2016-11-111-0/+8
| | | | | | | | | | | | | | | The context argument passed to VideoToolbox's VTCompressionSessionEncodeFrame() function is ultimately passed to a callback supplied when creating the compression session and so may be freed by that callback. To suppress false positives in this case, teach the retain count checker to stop tracking that argument. This isn't suppressed by the usual callback context mechanism because the call to VTCompressionSessionEncodeFrame() doesn't include the callback itself. rdar://problem/27685213 llvm-svn: 286633
* When a DecompositionDecl is marked invalid, also set the child BindingDecl's toRichard Trieu2016-11-111-1/+13
| | | | | | invalid. llvm-svn: 286630
* [PowerPC] Add vector conversion builtins to altivec.h - clang portionNemanja Ivanovic2016-11-111-1/+265
| | | | | | | | | This patch corresponds to review: https://reviews.llvm.org/D26308 It adds a number of vector type conversion builtins to altivec.h. llvm-svn: 286627
* Bitcode: Change getModuleSummaryIndex() to return an llvm::Expected.Peter Collingbourne2016-11-111-8/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D26539 llvm-svn: 286624
* [cfi] Enable cfi-icall on ARM and AArch64.Evgeniy Stepanov2016-11-111-0/+2
| | | | llvm-svn: 286613
* Add a new optimization option -Og Sylvestre Ledru2016-11-111-0/+3
| | | | | | | | | | | | | | Summary: Just like gcc, we should have the -Og option as more and more software are using it: https://llvm.org/bugs/show_bug.cgi?id=20765 Reviewers: echristo, dberlin, dblaikie, keith.walker.arm, rengolin Subscribers: aprantl, friss, mehdi_amini, RKSimon, probinson, majnemer, cfe-commits Differential Revision: https://reviews.llvm.org/D24998 llvm-svn: 286602
* [X86] Merge (near) duplicate scalar non-temporal store code. NFCI.Simon Pilgrim2016-11-111-20/+10
| | | | llvm-svn: 286595
* Fix for PR28523: unexpected compilation error.Alexey Bataev2016-11-114-10/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang emits error message for the following code: ``` template <class F> void parallel_loop(F &&f) { f(0); } int main() { int x; parallel_loop([&](auto y) { { x = y; }; }); } ``` $ clang++ --std=gnu++14 clang_test.cc -o clang_test clang_test.cc:9:7: error: reference to local variable 'x' declared in enclosing function 'main' x = y; ^ clang_test.cc:2:48: note: in instantiation of function template specialization 'main()::(anonymous class)::operator()<int>' requested here template <class F> void parallel_loop(F &&f) { f(0); } ^ clang_test.cc:6:3: note: in instantiation of function template specialization 'parallel_loop<(lambda at clang_test.cc:6:17)>' requested here parallel_loop([&](auto y) { ^ clang_test.cc:5:7: note: 'x' declared here int x; ^ 1 error generated. Patch fixes this issue. llvm-svn: 286584
* Mirror the llvm changes that split Bitcode/ReaderWriter.hTeresa Johnson2016-11-113-3/+4
| | | | | | | | | | The change in D26502 splits ReaderWriter.h, which contains the APIs into both the BitReader and BitWriter libraries, into BitcodeReader.h and BitcodeWriter.h. Change clang uses to the appropriate split header(s). llvm-svn: 286567
* Define __ANDROID_API__ when specified as part of an Android target.Stephen Hines2016-11-111-0/+2
| | | | | | | | | | | | | | | | | Summary: This macro should be defined only when the user directly specifies an API level as part of an Android target. For any regular Android target, we leave this macro undefined. Bug: https://llvm.org/bugs/show_bug.cgi?id=30940 Reviewers: eugenis, pirama Subscribers: tberghammer, cfe-commits, pirama, eugenis, danalbert Differential Revision: https://reviews.llvm.org/D26491 llvm-svn: 286543
* Don't require nullability on 'va_list', even when it's a pointer.Jordan Rose2016-11-111-28/+35
| | | | | | | | Take 3! This should finally fix the Hexagon, PPC, and Windows bots. rdar://problem/25846421 llvm-svn: 286542
* Revert "Speculative fix for va_list/nullability test on Hexagon and PPC."Jordan Rose2016-11-111-4/+0
| | | | | | | This reverts commit r286533. At this point an array really is still an array, but the problem is with /non-/array va_lists anyway. llvm-svn: 286541
OpenPOWER on IntegriCloud