summaryrefslogtreecommitdiff
path: root/lib/Sema/SemaType.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add SpellingNotCalculated to Attribute Enums to suppress UBSan warningsErich Keane2019-09-171-0/+2
| | | | | | | UBSan downstreams noticed that the assignment of SpellingNotCalculated to the spellings caused warnings. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372124 91177308-0d34-0410-b5e6-96231b3b80d8
* [NFCI]Create CommonAttributeInfo Type as base type of *Attr and ParsedAttr.Erich Keane2019-09-131-37/+31
| | | | | | | | | | | | In order to enable future improvements to our attribute diagnostics, this moves info from ParsedAttr into CommonAttributeInfo, then makes this type the base of the *Attr and ParsedAttr types. Quite a bit of refactoring took place, including removing a bunch of redundant Spelling Index propogation. Differential Revision: https://reviews.llvm.org/D67368 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371875 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema][ObjC] Mark C union fields that have non-trivial ObjC ownershipAkira Hatanaka2019-09-071-31/+1
| | | | | | | | | | | | | | | | | qualifications as unavailable if the union is declared in a system header r365985 stopped marking those fields as unavailable, which caused the union's NonTrivialToPrimitive* bits to be set to true. This patch restores the behavior prior to r365985, except that users can explicitly specify the ownership qualification of the field to instruct the compiler not to mark it as unavailable. rdar://problem/53420753 Differential Revision: https://reviews.llvm.org/D65256 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371276 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Diagnose default-initialization, destruction, and copying ofAkira Hatanaka2019-09-071-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | non-trivial C union types This recommits r365985, which was reverted because it broke a few projects using unions containing non-trivial ObjC pointer fields in system headers. We now have a patch to fix the problem (see https://reviews.llvm.org/D65256). Original commit message: This patch diagnoses uses of non-trivial C unions and structs/unions containing non-trivial C unions in the following contexts, which require default-initialization, destruction, or copying of the union objects, instead of disallowing fields of non-trivial types in C unions, which is what we currently do: - function parameters. - function returns. - assignments. - compound literals. - block captures except capturing of `__block` variables by non-escaping blocks. - local and global variable definitions. - lvalue-to-rvalue conversions of volatile types. See the discussion in https://reviews.llvm.org/D62988 for more background. rdar://problem/50679094 Differential Revision: https://reviews.llvm.org/D63753 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371275 91177308-0d34-0410-b5e6-96231b3b80d8
* [c++20] P1143R2: Add support for the C++20 'constinit' keyword.Richard Smith2019-09-041-2/+2
| | | | | | | | | | | | | This is mostly the same as the [[clang::require_constant_initialization]] attribute, but has a couple of additional syntactic and semantic restrictions. In passing, I added a warning for the attribute form being added after we have already seen the initialization of the variable (but before we see the definition); that case previously slipped between the cracks and the attribute was silently ignored. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@370972 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve behavior in the case of stack exhaustion.Richard Smith2019-08-261-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Clang performs various recursive operations (such as template instantiation), and may use non-trivial amounts of stack space in each recursive step (for instance, due to recursive AST walks). While we try to keep the stack space used by such steps to a minimum and we have explicit limits on the number of such steps we perform, it's impractical to guarantee that we won't blow out the stack on deeply recursive template instantiations on complex ASTs, even with only a moderately high instantiation depth limit. The user experience in these cases is generally terrible: we crash with no hint of what went wrong. Under this patch, we attempt to do better: * Detect when the stack is nearly exhausted, and produce a warning with a nice template instantiation backtrace, telling the user that we might run slowly or crash. * For cases where we're forced to trigger recursive template instantiation in arbitrarily-deeply-nested contexts, check whether we're nearly out of stack space and allocate a new stack (by spawning a new thread) after producing the warning. Reviewers: rnk, aaron.ballman Subscribers: mgorny, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66361 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@369940 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Fix addr space deduction for pointers/references to arrays.Anastasia Stulova2019-08-191-2/+16
| | | | | | | | | | | | | Rewrite the logic for detecting if we are deducing addr space of a pointee type to take into account special logic for arrays. For pointers/references to arrays we can have any number of parentheses expressions as well as nested pointers. Differential Revision: https://reviews.llvm.org/D66137 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@369251 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] Fix mismatched args constructing AddressSpaceAttr.Anton Bikineev2019-08-071-3/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D65589 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@368152 91177308-0d34-0410-b5e6-96231b3b80d8
* Give the 'signed/unsigned wchar_t' extension a warning flag, and followRichard Smith2019-07-291-2/+2
| | | | | | GCC 9 in promoting it to an error by default. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@367255 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[Sema] Diagnose default-initialization, destruction, and copying of"Akira Hatanaka2019-07-261-5/+0
| | | | | | | | | | | | | | | This reverts commit r365985. Prior to r365985, clang used to mark C union fields that have non-trivial ObjC ownership qualifiers as unavailable if the union was declared in a system header. r365985 stopped doing so, which caused the swift compiler to crash when it tried to import a non-trivial union. I have a patch that fixes the crash (https://reviews.llvm.org/D65256), but I'm temporarily reverting the original patch until we can decide on whether it's taking the right approach. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@367076 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL][PR42033] Fix addr space deduction with template parametersAnastasia Stulova2019-07-181-1/+3
| | | | | | | | | | | | | | | | | If dependent types appear in pointers or references we allow addr space deduction because the addr space in template argument will belong to the pointee and not the pointer or reference itself. We also don't diagnose addr space on a function return type after template instantiation. If any addr space for the return type was provided on a template parameter this will be diagnosed during the parsing of template definition. Differential Revision: https://reviews.llvm.org/D62584 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366417 91177308-0d34-0410-b5e6-96231b3b80d8
* Renamed and changed the wording of warn_cconv_ignoredSunil Srivastava2019-07-171-2/+2
| | | | | | | | | As discussed in D64780 the wording of this warning message is being changed to say 'is not supported' instead of 'ignored', and the diag ID itself is being changed to warn_cconv_not_supported. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366368 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix parameter name comments using clang-tidy. NFC.Rui Ueyama2019-07-161-1/+1
| | | | | | | | | | | | | | | | | | | | | This patch applies clang-tidy's bugprone-argument-comment tool to LLVM, clang and lld source trees. Here is how I created this patch: $ git clone https://github.com/llvm/llvm-project.git $ cd llvm-project $ mkdir build $ cd build $ cmake -GNinja -DCMAKE_BUILD_TYPE=Debug \ -DLLVM_ENABLE_PROJECTS='clang;lld;clang-tools-extra' \ -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DLLVM_ENABLE_LLD=On \ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ../llvm $ ninja $ parallel clang-tidy -checks='-*,bugprone-argument-comment' \ -config='{CheckOptions: [{key: StrictMode, value: 1}]}' -fix \ ::: ../llvm/lib/**/*.{cpp,h} ../clang/lib/**/*.{cpp,h} ../lld/**/*.{cpp,h} git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366177 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Diagnose default-initialization, destruction, and copying ofAkira Hatanaka2019-07-131-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | non-trivial C union types This patch diagnoses uses of non-trivial C unions and structs/unions containing non-trivial C unions in the following contexts, which require default-initialization, destruction, or copying of the union objects, instead of disallowing fields of non-trivial types in C unions, which is what we currently do: - function parameters. - function returns. - assignments. - compound literals. - block captures except capturing of `__block` variables by non-escaping blocks. - local and global variable definitions. - lvalue-to-rvalue conversions of volatile types. See the discussion in https://reviews.llvm.org/D62988 for more background. rdar://problem/50679094 Differential Revision: https://reviews.llvm.org/D63753 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365985 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++20] add Basic consteval specifierGauthier Harnisch2019-06-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: this revision adds Lexing, Parsing and Basic Semantic for the consteval specifier as specified by http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1073r3.html with this patch, the consteval specifier is treated as constexpr but can only be applied to function declaration. Changes: - add the consteval keyword. - add parsing of consteval specifier for normal declarations and lambdas expressions. - add the whether a declaration is constexpr is now represented by and enum everywhere except for variable because they can't be consteval. - adapt diagnostic about constexpr to print constexpr or consteval depending on the case. - add tests for basic semantic. Reviewers: rsmith, martong, shafik Reviewed By: rsmith Subscribers: eraman, efriedma, rnkovacs, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61790 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@363362 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL][PR42031] Prevent deducing addr space in type alias.Anastasia Stulova2019-06-051-0/+3
| | | | | | | | | | | Similar to typedefs we shouldn't deduce addr space in type alias. Differential Revision: https://reviews.llvm.org/D62591 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@362611 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid using NoThrow Exception Specifier in non-C++ Modes.Erich Keane2019-06-051-13/+12
| | | | | | | | | | | | | | | | | As reported in https://bugs.llvm.org/show_bug.cgi?id=42113, there are a number of locations in Clang where it is assumed that exception specifications are only valid in C++ mode. Since the original justification for the NoThrow Exception Specifier Type was C++ related, this patch just makes C mode use the attribute-based nothrow handling. Additionally, I noticed that the handling of non-prototype functions regressed the behavior of the nothrow attribute, in part because it is was listed in the function type macro(which I did in the previous patch). In reality, it should only be doing so in a conditional nature, so this patch removes it there and puts it directly in the switch to be handled correctly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@362607 91177308-0d34-0410-b5e6-96231b3b80d8
* Suppress nothrow/Exception spec conflict warning when we dont know the ES.Erich Keane2019-05-311-7/+7
| | | | | | | In any situation where the Exception Spec isn't clear, suppress the warning to avoid false positives. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@362243 91177308-0d34-0410-b5e6-96231b3b80d8
* Suppress nothrow/exception spec conflict warning when ES is parsed.Erich Keane2019-05-311-1/+3
| | | | | | | | | | | | | | The previously added warning ended up causing false positives when nothrow was used on member functions, where the exception specification wasn't yet parsed. So, throw() and noexcept(true) both were incorrectly warning. There doesn't seem to be a good way to force these to be parsed to identify which they are (and likely should not be), so suppress the warning. For now, unevaluated/uninstantiated are left as warnings as I am not creative enough to find a reproducer that causes a false positive for either. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@362236 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix "fallthrough annotation in unreachable code" warning.Richard Smith2019-05-301-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@362171 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Attribute NoThrow as an Exception Specifier TypeErich Keane2019-05-301-1/+57
| | | | | | | | | | | | | | | In response to https://bugs.llvm.org/show_bug.cgi?id=33235, it became clear that the current mechanism of hacking through checks for the exception specification of a function gets confused really quickly when there are alternate exception specifiers. This patch introcues EST_NoThrow, which is the equivilent of EST_noexcept when caused by EST_noThrow. The existing implementation is left in place to cover functions with no FunctionProtoType. Differential Revision: https://reviews.llvm.org/D62435 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@362119 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Fix file-scope const sampler variable for 2.0Yaxun Liu2019-05-271-1/+15
| | | | | | | | | | | | | | | | | | | | OpenCL spec v2.0 s6.13.14: Samplers can also be declared as global constants in the program source using the following syntax. const sampler_t <sampler name> = <value> This works fine for OpenCL 1.2 but fails for 2.0, because clang duduces address space of file-scope const sampler variable to be in global address space whereas spec v2.0 s6.9.b forbids file-scope sampler variable to be in global address space. The fix is not to deduce address space for file-scope sampler variables. Differential Revision: https://reviews.llvm.org/D62197 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361757 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Support pipe keyword in C++ modeSven van Haastregt2019-05-221-2/+4
| | | | | | | | | | | | Support the OpenCL C pipe feature in C++ for OpenCL mode, to preserve backwards compatibility with OpenCL C. Various changes had to be made in Parse and Sema to enable pipe-specific diagnostics, so enable a SemaOpenCL test for C++. Differential Revision: https://reviews.llvm.org/D62181 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361382 91177308-0d34-0410-b5e6-96231b3b80d8
* Test commitKevin Petit2019-05-151-1/+1
| | | | | | | | Remove stray space. Signed-off-by: Kevin Petit <kevin.petit@arm.com> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360783 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix for the greendragon bots.Leonard Chan2019-05-081-1/+3
| | | | | | Adds extra checks for ObjC GC and Ownership. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360225 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Add missing VisitMacroQualifiedTypeLoc to TypeSpecLocFillerLeonard Chan2019-05-071-0/+5
| | | | | | To hopefully fix greenbot failures git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360120 91177308-0d34-0410-b5e6-96231b3b80d8
* Recommit r359859 "[Attribute/Diagnostics] Print macro if definition is an ↵Leonard Chan2019-05-071-4/+46
| | | | | | | | attribute declaration" Updated with fix for read of uninitialized memory. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360109 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Fix for P41774 where `ExpectNoDerefChunk` is assigned twiceLeonard Chan2019-05-061-5/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360089 91177308-0d34-0410-b5e6-96231b3b80d8
* PR41183: Don't emit strict-prototypes warning for an implicit functionJames Y Knight2019-05-061-1/+4
| | | | | | | | | | | declaration. It should emit _only_ an implicit-function-declaration warning, not both of them. Differential Revision: https://reviews.llvm.org/D59711 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360084 91177308-0d34-0410-b5e6-96231b3b80d8
* [c++20] Implement P0428R2 - Familiar template syntax for generic lambdasHamza Sood2019-05-041-2/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D36527 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359967 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[Attribute/Diagnostics] Print macro if definition is an attribute ↵Leonard Chan2019-05-031-23/+4
| | | | | | | | declaration" This reverts commit fc40cbd9d8c63e65eed3590ba925321afe782e1d. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359859 91177308-0d34-0410-b5e6-96231b3b80d8
* [Attribute/Diagnostics] Print macro if definition is an attribute declarationLeonard Chan2019-05-021-4/+23
| | | | | | | | | | | | | If an address_space attribute is defined in a macro, print the macro instead when diagnosing a warning or error for incompatible pointers with different address_spaces. We allow this for all attributes (not just address_space), and for multiple attributes declared in the same macro. Differential Revision: https://reviews.llvm.org/D51329 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359826 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Deduce static data members to __global addr space.Anastasia Stulova2019-05-021-2/+4
| | | | | | | | | | | Similarly to static variables in OpenCL, static class data members should be deduced to __global addr space. Differential Revision: https://reviews.llvm.org/D61304 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359789 91177308-0d34-0410-b5e6-96231b3b80d8
* Use llvm::stable_sortFangrui Song2019-04-241-4/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359098 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Fix a use-after-deallocate of a ParsedAttrErik Pilkington2019-04-021-2/+2
| | | | | | | | | | | | | | | moveAttrFromListToList only makes sense when moving an attribute to a list with a pool that's either equivalent, or has a shorter lifetime. Therefore, using it to move a ParsedAttr from a declarator to a declaration specifier doesn't make sense, since the declaration specifier's pool outlives the declarator's. The patch adds a new function, ParsedAttributes::takeOneFrom, which transfers the attribute from one pool to another, fixing the use-after-deallocate. rdar://49175426 Differential revision: https://reviews.llvm.org/D60101 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357516 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Fix assertion when `auto` parameter in lambda has an attribute.Volodymyr Sapsai2019-03-291-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the assertion > no Attr* for AttributedType* > UNREACHABLE executed at llvm-project/clang/lib/Sema/SemaType.cpp:298! In `TypeProcessingState::getAttributedType` we put into `AttrsForTypes` types with `auto` but later in `TypeProcessingState::takeAttrForAttributedType` we use transformed types and that's why cannot find `Attr` corresponding to `AttributedType`. Fix by keeping `AttrsForTypes` up to date after replacing `AutoType`. rdar://problem/47689465 Reviewers: rsmith, arphaman, aaron.ballman Reviewed By: aaron.ballman Subscribers: jkorous, dexonsmith, jdoerfert, cfe-commits Differential Revision: https://reviews.llvm.org/D58659 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357298 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema][NFCI] Don't allocate storage for the various ↵Bruno Ricci2019-03-251-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CorrectionCandidateCallback unless we are going to do some typo correction The various CorrectionCandidateCallbacks are currently heap-allocated unconditionally. This was needed because of delayed typo correction. However these allocations represent currently 15.4% of all allocations (number of allocations) when parsing all of Boost (!), mostly because of ParseCastExpression, ParseStatementOrDeclarationAfterAttrtibutes and isCXXDeclarationSpecifier. Note that all of these callback objects are small. Let's not do this. Instead initially allocate the callback on the stack, and only do a heap allocation if we are going to do some typo correction. Do this by: 1. Adding a clone function to each callback, which will do a polymorphic clone of the callback. This clone function is required to be implemented by every callback (of which there is a fair amount). Make sure this is the case by making it pure virtual. 2. Use this clone function when we are going to try to correct a typo. This additionally cut the time of -fsyntax-only on all of Boost by 0.5% (not that much, but still something). No functional changes intended. Differential Revision: https://reviews.llvm.org/D58827 Reviewed By: rnk git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356925 91177308-0d34-0410-b5e6-96231b3b80d8
* Permit redeclarations of a builtin to specify calling convention.Erich Keane2019-03-211-12/+10
| | | | | | | | | | | | | | | | | | | | | After https://reviews.llvm.org/rL355317 we noticed that quite a decent amount of code redeclares builtins (memcpy in particular, I believe reduced from an MSVC header) with a calling convention specified. This gets particularly troublesome when the user specifies a new 'default' calling convention on the command line. When looking to add a diagnostic for this case, it was noticed that we had 3 other diagnostics that differed only slightly. This patch ALSO unifies those under a 'select'. Unfortunately, the order of words in ONE of these diagnostics was reversed ("'thiscall' calling convention" vs "calling convention 'thiscall'"), so this patch also standardizes on the former. Differential Revision: https://reviews.llvm.org/D59560 Change-Id: I79f99fe7c2301640755ffdd774b46eb44526bb22 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356663 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Fix a use-after-free of a _Nonnull ParsedAttrErik Pilkington2019-03-141-10/+12
| | | | | | | | | | | | | | We were allocating the implicit attribute in the declarator's attribute pool, but putting into the declaration specifier's ParsedAttributesView. If there are multiple declarators, then we'll use the attribute from the declaration specifier after clearing out the declarators attribute pool. Fix this by allocating the attribute in the declaration specifier's pool. rdar://48529718 Differential revision: https://reviews.llvm.org/D59327 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356187 91177308-0d34-0410-b5e6-96231b3b80d8
* [PR41007][OpenCL] Allow printf in C++ mode.Anastasia Stulova2019-03-121-1/+1
| | | | | | | | | | | As for OpenCL C, we need to allow using printf and toolchain variadic functions (prefixed by "__") in C++ mode. Differential Revision: https://reviews.llvm.org/D59219 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355915 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP]Delay emission of the error for unsupported types.Alexey Bataev2019-02-271-3/+6
| | | | | | | If the type is unsupported on the device side, it still must be emitted, but we should emit errors for operations with such types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355027 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Delayed diagnostics for VLA support.Alexey Bataev2019-02-221-9/+7
| | | | | | Generalized processing of the deferred diagnostics for OpenMP/CUDA code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354690 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[OPENMP] Delayed diagnostics for VLA support."Alexey Bataev2019-02-221-7/+9
| | | | | | | This reverts commit r354679 to fix the problem with the Windows buildbots git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354680 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Delayed diagnostics for VLA support.Alexey Bataev2019-02-221-9/+7
| | | | | | Generalized processing of the deferred diagnostics for OpenMP/CUDA code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354679 91177308-0d34-0410-b5e6-96231b3b80d8
* [CUDA][HIP] Do not diagnose use of _Float16Yaxun Liu2019-01-291-1/+4
| | | | | | | | | | | | r352221 caused regressions in CUDA/HIP since device function may use _Float16 whereas host does not support it. In this case host compilation should not diagnose usage of _Float16 in device functions or variables. For now just do not diagnose _Float16 for CUDA/HIP. In the future we should have more precise check. Differential Revision: https://reviews.llvm.org/D57369 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@352488 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename getTypeQualifiers to getMethodQualifiers.Anastasia Stulova2019-01-281-3/+3
| | | | | | | | | | Use more descriptive name for the method qualifiers getter. Differential Revision: https://reviews.llvm.org/D56792 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@352349 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable _Float16 for non ARM/SPIR TargetsErich Keane2019-01-251-1/+6
| | | | | | | | | | | | | | | As Discussed here: http://lists.llvm.org/pipermail/llvm-dev/2019-January/129543.html There are problems exposing the _Float16 type on architectures that haven't defined the ABI/ISel for the type yet, so we're temporarily disabling the type and making it opt-in. Differential Revision: https://reviews.llvm.org/D57188 Change-Id: I5db7366dedf1deb9485adb8948b1deb7e612a736 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@352221 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Fix Modified Type in address_space AttributedTypeLeonard Chan2019-01-241-26/+71
| | | | | | | | | | | This is a fix for https://reviews.llvm.org/D51229 where we pass the address_space qualified type as the modified type of an AttributedType. This change now instead wraps the AttributedType with either the address_space qualifier or a DependentAddressSpaceType. Differential Revision: https://reviews.llvm.org/D55447 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351997 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Allow address spaces as method qualifiers.Anastasia Stulova2019-01-211-49/+58
| | | | | | | | | | | | | | | | | Methods can now be qualified with address spaces to prevent undesirable conversions to generic or to provide custom implementation to be used if the object is located in certain memory segments. This commit extends parsing and standard C++ overloading to work for an address space of a method (i.e. implicit 'this' parameter). Differential Revision: https://reviews.llvm.org/D55850 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351747 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351636 91177308-0d34-0410-b5e6-96231b3b80d8