summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* [OPENMP] Initial codegen for `target teams distribute simd` directive.Alexey Bataev2017-12-131-4/+15
| | | | | | | Host + generic device codegen for `target teams distribute simd` directive. llvm-svn: 320608
* [OPENMP] Support `reduction` clause on target-based directives.Alexey Bataev2017-12-131-3/+7
| | | | | | | OpenMP 5.0 added support for `reduction` clause in target-based directives. Patch adds this support to clang. llvm-svn: 320596
* [OPENMP] Fix handling of clauses in clause parsing mode.Alexey Bataev2017-12-131-2/+6
| | | | | | | The compiler may generate incorrect code if we try to capture the variable in clause parsing mode. llvm-svn: 320590
* [Sema] Ignore decls in namespaces when global decls are not wanted.Eric Liu2017-12-131-4/+7
| | | | | | | | | | | | | | Summary: ... in qualified code completion and decl lookup. Reviewers: ilya-biryukov, arphaman Reviewed By: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40562 llvm-svn: 320563
* [OpenMP] Diagnose function name on the link clauseKelvin Li2017-12-121-2/+13
| | | | | | | | | | | This patch is to add diagnose when a function name is specified on the link clause. According to the OpenMP spec, only the list items that exclude the function name are allowed on the link clause. Differential Revision: https://reviews.llvm.org/D40968 llvm-svn: 320521
* Revert a part of 320489 that was submitted unintentionally.Erich Keane2017-12-121-2/+1
| | | | llvm-svn: 320493
* Fix ICE when __has_unqiue_object_representations called with invalid declErich Keane2017-12-121-1/+2
| | | | llvm-svn: 320489
* [SemaCodeComplete] Allow passing out scope specifiers in qualified-id ↵Eric Liu2017-12-121-7/+19
| | | | | | | | | | | | | | completions via completion context. Reviewers: ilya-biryukov, arphaman Reviewed By: arphaman Subscribers: nik, cfe-commits Differential Revision: https://reviews.llvm.org/D40563 llvm-svn: 320471
* PR35586: Relax two asserts that are overly restrictiveErich Keane2017-12-111-2/+4
| | | | | | | | | The two asserts are too aggressive. In C++ mode, an enum is NOT considered an integral type, but an enum value is allowed to be an enum. This patch relaxes the two asserts to allow the enum value as well (as typechecking does). llvm-svn: 320411
* P0620 follow-up: deducing `auto` from braced-init-list in new exprZhihao Yuan2017-12-111-5/+12
| | | | | | | | | | | | | | | | | | | Summary: This is a side-effect brought in by p0620r0, which allows other placeholder types (derived from `auto` and `decltype(auto)`) to be usable in a `new` expression with a single-clause //braced-init-list// as its initializer (8.3.4 [expr.new]/2). N3922 defined its semantics. References: http://wg21.link/p0620r0 http://wg21.link/n3922 Reviewers: rsmith, aaron.ballman Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D39451 llvm-svn: 320401
* [Sema] Fix crash in unused-lambda-capture warning for VLAsMalcolm Parsons2017-12-111-0/+3
| | | | | | | | | | | | | | | | | | | | Summary: Clang was crashing when diagnosing an unused-lambda-capture for a VLA because From.getVariable() is null for the capture of a VLA bound. Warning about the VLA bound capture is not helpful, so only warn for the VLA itself. Fixes: PR35555 Reviewers: aaron.ballman, dim, rsmith Reviewed By: aaron.ballman, dim Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D41016 llvm-svn: 320396
* [CodeGen][X86] Fix handling of __fp16 vectors.Akira Hatanaka2017-12-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes a bug in IRGen where it generates completely broken code for __fp16 vectors on X86. For example when the following code is compiled: half4 hv0, hv1, hv2; // these are vectors of __fp16. void foo221() { hv0 = hv1 + hv2; } clang generates the following IR, in which two i16 vectors are added: @hv1 = common global <4 x i16> zeroinitializer, align 8 @hv2 = common global <4 x i16> zeroinitializer, align 8 @hv0 = common global <4 x i16> zeroinitializer, align 8 define void @foo221() { %0 = load <4 x i16>, <4 x i16>* @hv1, align 8 %1 = load <4 x i16>, <4 x i16>* @hv2, align 8 %add = add <4 x i16> %0, %1 store <4 x i16> %add, <4 x i16>* @hv0, align 8 ret void } To fix the bug, this commit uses the code committed in r314056, which modified clang to promote and truncate __fp16 vectors to and from float vectors in the AST. It also fixes another IRGen bug where a short value is assigned to an __fp16 variable without any integer-to-floating-point conversion, as shown in the following example: __fp16 a; short b; void foo1() { a = b; } @b = common global i16 0, align 2 @a = common global i16 0, align 2 define void @foo1() #0 { %0 = load i16, i16* @b, align 2 store i16 %0, i16* @a, align 2 ret void } rdar://problem/20625184 Differential Revision: https://reviews.llvm.org/D40112 llvm-svn: 320215
* Remove creation of out-of-bounds value of enumeration type (resulting in UB).Richard Smith2017-12-083-8/+8
| | | | | | | Also remove unnecessary initialization of out-parameters with this value, so that MSan is able to catch errors appropriately. llvm-svn: 320212
* Unify implementation of our two different flavours of -Wtautological-compare,Richard Smith2017-12-081-200/+159
| | | | | | | | | | | | | | | | | | | | | | | | | and fold together into a single function. In so doing, fix a handful of remaining bugs where we would report false positives or false negatives if we promote a signed value to an unsigned type for the comparison. This re-commits r320122 and r320124, minus two changes: * Comparisons between a constant and a non-constant expression of enumeration type never warn, not even if the constant is out of range. We should be warning about the creation of such a constant, not about its use. * We do not use more precise bit-widths for comparisons against bit-fields. The more precise diagnostics probably are the right thing, but we should consider moving them under their own warning flag. Other than the refactoring, this patch should only change the behavior for the buggy cases (where the warnings didn't take into account that promotion from signed to unsigned can leave a range of inaccessible values in the middle of the promoted type). llvm-svn: 320211
* Revert "Unify implementation of our two different flavours of ↵Hans Wennborg2017-12-081-155/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | -Wtautological-compare." > Unify implementation of our two different flavours of -Wtautological-compare. > > In so doing, fix a handful of remaining bugs where we would report false > positives or false negatives if we promote a signed value to an unsigned type > for the comparison. This caused a new warning in Chromium: ../../base/trace_event/trace_log.cc:1545:29: error: comparison of constant 64 with expression of type 'unsigned int' is always true [-Werror,-Wtautological-constant-out-of-range-compare] DCHECK(handle.event_index < TraceBufferChunk::kTraceBufferChunkSize); ~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'unsigned int' is really a 6-bit bitfield, which is why it's always less than 64. I thought we didn't use to warn (with out-of-range-compare) when comparing against the boundaries of a type? llvm-svn: 320162
* [OPENMP] Initial codegen for `target teams distribute` directive.Alexey Bataev2017-12-082-6/+28
| | | | | | Host + default devices codegen for `target teams distribute` directive. llvm-svn: 320149
* Revert r320124 "Fold together the in-range and out-of-range portions of ↵Hans Wennborg2017-12-081-35/+98
| | | | | | | | | | | | | | | | | | | | -Wtautological-compare." This broke Chromium: ../../base/trace_event/trace_log.cc:1545:29: error: comparison of constant 64 with expression of type 'unsigned int' is always true [-Werror,-Wtautological-constant-out-of-range-compare] DCHECK(handle.event_index < TraceBufferChunk::kTraceBufferChunkSize); ~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'unsigned int' is really a 6-bit bitfield, which is why it's always less than 63. Did this use to fall under the "in-range" case before? I thought we didn't use to warn when comparing against the boundaries of a type. llvm-svn: 320133
* Fold together the in-range and out-of-range portions of -Wtautological-compare.Richard Smith2017-12-081-98/+35
| | | | llvm-svn: 320124
* Unify implementation of our two different flavours of -Wtautological-compare.Richard Smith2017-12-081-145/+155
| | | | | | | | In so doing, fix a handful of remaining bugs where we would report false positives or false negatives if we promote a signed value to an unsigned type for the comparison. llvm-svn: 320122
* [OPENMP] Do not capture private variables in the target regions.Alexey Bataev2017-12-071-2/+4
| | | | | | | | Private variables are completely redefined in the outlined regions, so we don't need to capture them. Patch adds this behavior to the target-based regions. llvm-svn: 320078
* [ARM] ACLE parallel arithmetic and DSP style multiplicationsSjoerd Meijer2017-12-071-8/+13
| | | | | | | | | | | This is a follow up of r302131, in which we forgot to add SemaChecking tests. Adding these tests revealed two problems which have been fixed: - added missing intrinsic __qdbl, - properly range checking ssat16 and usat16. Differential Revision: https://reviews.llvm.org/D40888 llvm-svn: 320019
* Ignore pointers to incomplete types when diagnosing misaligned addressesRoger Ferrer Ibanez2017-12-071-2/+3
| | | | | | | | | This is a fix for PR35509 in which we crash because we attempt to compute the alignment of an incomplete type. Differential Revision: https://reviews.llvm.org/D40895 llvm-svn: 320017
* Allow conditions to be decomposed with structured bindingsZhihao Yuan2017-12-071-5/+9
| | | | | | | | | | | | | | | | | | | | | Summary: This feature was discussed but not yet proposed. It allows a structured binding to appear as a //condition// if (auto [ok, val] = f(...)) So the user can save an extra //condition// if the statement can test the value to-be-decomposed instead. Formally, it makes the value of the underlying object of the structured binding declaration also the value of a //condition// that is an initialized declaration. Considering its logicality which is entirely evident from its trivial implementation, I think it might be acceptable to land it as an extension for now before I write the paper. Reviewers: rsmith, faisalv, aaron.ballman Reviewed By: rsmith Subscribers: aaron.ballman, cfe-commits Differential Revision: https://reviews.llvm.org/D39284 llvm-svn: 320011
* Test commit accessZhihao Yuan2017-12-071-1/+1
| | | | llvm-svn: 320008
* Remove old concepts parsing codeHubert Tong2017-12-074-237/+1
| | | | | | | | | | | | | | | | | | Summary: This is so we can implement concepts per P0734R0. Relevant failing test cases are disabled. Reviewers: hubert.reinterpretcast, rsmith, saar.raz, nwilson Reviewed By: saar.raz Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40380 Patch by Changyu Li! llvm-svn: 319992
* Delete special-case "out-of-range" handling for bools, and just use the normalRichard Smith2017-12-061-115/+61
| | | | | | | | | | | codepath plus the new "minimum / maximum value of type" diagnostic to get the same effect. Move the warning for an in-range but tautological comparison of a constant (0 or 1) against a bool out of -Wtautological-constant-out-of-range-compare into the more-appropriate -Wtautological-constant-compare. llvm-svn: 319942
* [OPENMP] Initial codegen for `teams distribute simd` directive.Alexey Bataev2017-12-061-3/+15
| | | | | | Host + default devices codegen for `teams distribute simd` directive. llvm-svn: 319896
* Fix a bunch of wrong "tautological unsigned enum compare" diagnostics in C++.Richard Smith2017-12-061-3/+4
| | | | | | | An enumeration with a fixed underlying type can have any value in its underlying type, not just those spanned by the values of its enumerators. llvm-svn: 319875
* P0722R2: The first parameter in an implicit call to a destroying operatorRichard Smith2017-12-051-0/+9
| | | | | | delete should be a cv-unqualified pointer to the deleted object. llvm-svn: 319858
* [OPENMP] Fix implicit mapping analysis.Alexey Bataev2017-12-051-30/+47
| | | | | | | Fixed processing of implicitly mapped objects in target-based executable directives. llvm-svn: 319814
* [OPENMP] Remove non-required parameters for distribute simd outlinedAlexey Bataev2017-12-051-2/+2
| | | | | | region, NFC. llvm-svn: 319800
* [OPENMP] Fix assert fail after target implicit map checks.Alexey Bataev2017-12-051-36/+23
| | | | | | | | If the error is generated during analysis of implicitly or explicitly mapped variables, it may cause compiler crash because of incorrect analysis. llvm-svn: 319774
* Generalize "static data member instantiated" notification to cover variable ↵Richard Smith2017-12-055-80/+59
| | | | | | | | | templates too. While here, split the "point of instantiation changed" notification out from it; these two really are orthogonal changes. llvm-svn: 319727
* [OpenMP] Initial implementation of code generation for pragma 'teams ↵Carlo Bertolli2017-12-041-3/+15
| | | | | | | | | | distribute parallel for simd' on host https://reviews.llvm.org/D40795 This includes regression tests for all associated clauses. llvm-svn: 319696
* Now that C++17 is official (https://www.iso.org/standard/68564.html), start ↵Aaron Ballman2017-12-0416-60/+60
| | | | | | changing the C++1z terminology over to C++17. NFC intended, these are all mechanical changes. llvm-svn: 319688
* [OPENMP] Codegen for `distribute simd` directive.Alexey Bataev2017-12-041-2/+12
| | | | | | Initial codegen support for `distribute simd` directive. llvm-svn: 319661
* PR35456: Track definedness of variable template specializations separately fromRichard Smith2017-12-021-0/+9
| | | | | | | | | | whether they have an initializer. We cannot distinguish between a declaration of a variable template specialization and a definition of one that lacks an initializer without this, and would previously mistake the latter for the former. llvm-svn: 319605
* [c++17] When deducing the type of a non-type template parameter from the typeRichard Smith2017-12-011-2/+3
| | | | | | | | | of its argument, perform function-to-pointer and array-to-pointer decay on the parameter type first. Otherwise deduction will fail, as the type of the argument will be decayed. llvm-svn: 319584
* [OPENMP] Do not allow variables to be first|last-privates inAlexey Bataev2017-12-011-10/+5
| | | | | | | | distribute directives. OpenMP standard does not allow to mark the variables as firstprivate and lastprivate at the same time in distribute-based directives. Patch fixes this problem. llvm-svn: 319560
* Disallow a cleanup attribute from appertaining to a parameter (the attribute ↵Aaron Ballman2017-12-011-7/+1
| | | | | | only appertains to local variables and is silently a noop on parameters). This repurposes the unused (and syntactically incorrect) NormalVar attribute subject. llvm-svn: 319555
* [c++2a] P0515R3: Support for overloaded operator<=>.Richard Smith2017-12-012-0/+4
| | | | | | No CodeGen support for MSABI yet, we don't know how to mangle this there. llvm-svn: 319513
* [OpenMP] Diagnose undeclared variables on declare target clauseKelvin Li2017-11-301-1/+1
| | | | | | | | | | | | | Clang asserts on undeclared variables on the to or link clause in the declare target directive. The patch is to properly diagnose the error. // foo1 and foo2 are not declared #pragma omp declare target to(foo1) #pragma omp declare target link(foo2) Differential Revision: https://reviews.llvm.org/D40588 llvm-svn: 319458
* [OPENMP] Fix possible assert for target regions with incorrect innerAlexey Bataev2017-11-301-1/+14
| | | | | | | | | teams region. If the inner teams region is not correct, it may cause an assertion when processing outer target region. Patch fixes this problem. llvm-svn: 319450
* Fix __has_unique_object_representations implementationErich Keane2017-11-301-1/+1
| | | | | | | | | | As rsmith pointed out, the original implementation of this intrinsic missed a number of important situations. This patch fixe a bunch of shortcomings and implementation details to make it work correctly. Differential Revision: https://reviews.llvm.org/D39347 llvm-svn: 319446
* MS ABI: Treat explicit instantiation definitions of dllimport function ↵Hans Wennborg2017-11-291-1/+9
| | | | | | | | | | | templates as explicit instantiation decls (PR35435) This matches MSVC's behaviour, and we already do it for class templates since r270897. Differential revision: https://reviews.llvm.org/D40621 llvm-svn: 319386
* Perform a bounds check on a function's argument list before accessing any ↵Aaron Ballman2017-11-291-2/+17
| | | | | | | | index value specified by an 'argument_with_type_tag' attribute. Fixes PR28520. Patch by Matt Davis. llvm-svn: 319383
* [OPENMP] Allow only loop control variables in distribute simdAlexey Bataev2017-11-291-33/+12
| | | | | | | | | directives. According to the OpenMP standard, only loop control variables can be used in linear clauses of distribute-based simd directives. llvm-svn: 319362
* [OPENMP] General improvement of handling of `teams distribute`Alexey Bataev2017-11-291-2/+12
| | | | | | | | directive, NFC. Some general improvements in support of `teams distribute` directive. llvm-svn: 319320
* [OPENMP] Generalize capturing of clauses expressions.Alexey Bataev2017-11-281-84/+153
| | | | | | | The handling and capturing of the non-constant expressions of some of the capturable clauses in combined directives is generalized. llvm-svn: 319227
* [CUDA] Report "unsupported VLA" errors only on device side.Artem Belevich2017-11-281-8/+11
| | | | | | | | | | | | This fixes erroneously reported CUDA compilation errors in host-side code during device-side compilation. I've also restricted OpenMP-specific checks to trigger only if we're compiling with OpenMP enabled. Differential Revision: https://reviews.llvm.org/D40275 llvm-svn: 319201
OpenPOWER on IntegriCloud