summaryrefslogtreecommitdiffstats
path: root/lib/AST/Type.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merging r309058:Hans Wennborg2017-07-261-0/+9
| | | | | | | | | | | | | | | | | | | ------------------------------------------------------------------------ r309058 | majnemer | 2017-07-25 16:33:58 -0700 (Tue, 25 Jul 2017) | 9 lines [CodeGen] Correctly model std::byte's aliasing properties std::byte, when defined as an enum, needs to be given special treatment with regards to its aliasing properties. An array of std::byte is allowed to be used as storage for other types. This fixes PR33916. Differential Revision: https://reviews.llvm.org/D35824 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_50@309135 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64] Add support for __builtin_ms_va_list on aarch64Martin Storsjo2017-07-171-1/+1
| | | | | | | | | | | Move builtins from the x86 specific scope into the global scope. Their use is still limited to x86_64 and aarch64 though. This allows wine on aarch64 to properly handle variadic functions. Differential Revision: https://reviews.llvm.org/D34475 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308218 91177308-0d34-0410-b5e6-96231b3b80d8
* Use ARC parsing rules for ns_returns_retained in MRC so that code canJohn McCall2017-07-151-0/+2
| | | | | | | | be shared without warnings. Build AttributedTypes to leave breadcrumbs for tools like the static analyzer. Warn about attempting to use the attribute with incompatible return types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308092 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] Remove double semicolons. NFC.Mandeep Singh Grang2017-06-061-1/+1
| | | | | | | | | | | | | | Reviewers: rsmith, craig.topper, efriedma Reviewed By: efriedma Subscribers: efriedma, cfe-commits Tags: #clang-c Differential Revision: https://reviews.llvm.org/D33926 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304823 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not issue -Wnullability-completeness for dependent types that are not ↵Richard Smith2017-05-191-9/+7
| | | | | | written as pointer types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303451 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Implement Core 2094: Trivial copy/move constructor for class with ↵Eric Fiselier2017-05-091-5/+2
| | | | | | | | | | | | | | | | volatile member Summary: This patch implements http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#2094 which reverts Core 496. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D32984 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302593 91177308-0d34-0410-b5e6-96231b3b80d8
* [Objective-C] Fix "repeated use of weak" warning with -fobjc-weakBrian Kelley2017-03-291-1/+5
| | | | | | | | | | | | | | Summary: -Warc-repeated-use-of-weak should produce the same warnings with -fobjc-weak as it does with -objc-arc. Also check for ObjCWeak along with ObjCAutoRefCount when recording the use of an evaluated weak variable. Add a -fobjc-weak run to the existing arc-repeated-weak test case and adapt it slightly to work in both modes. Reviewers: rsmith, doug.gregor, jordan_rose, rjmccall Reviewed By: rjmccall Subscribers: arphaman, rjmccall, cfe-commits Differential Revision: https://reviews.llvm.org/D31005 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299011 91177308-0d34-0410-b5e6-96231b3b80d8
* [Objective-C] Fix __weak type traits with -fobjc-weakBrian Kelley2017-03-291-60/+8
| | | | | | | | | | | | | | Summary: Similar to ARC, in ObjCWeak Objective-C object pointers qualified with a weak lifetime are not POD or trivial types. Update the type trait code to reflect this. Copy and adapt the arc-type-traits.mm test case to verify correctness. Reviewers: rsmith, doug.gregor, rjmccall Reviewed By: rjmccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D31004 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299010 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Correct ndrange_t implementationAnastasia Stulova2017-02-161-3/+0
| | | | | | | | | | | | | | | | Removed ndrange_t as Clang builtin type and added as a struct type in the OpenCL header. Use type name to do the Sema checking in enqueue_kernel and modify IR generation accordingly. Review: D28058 Patch by Dmitry Borisenkov! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295311 91177308-0d34-0410-b5e6-96231b3b80d8
* Speculatively revert r295118 to see if it's what's causing the modules ↵Richard Smith2017-02-151-4/+2
| | | | | | selfhost buildbots to fail. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295146 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not implicitly instantiate the definition of a class template specializationRichard Smith2017-02-141-2/+4
| | | | | | | | | | | | | | | | that has been explicitly specialized! We assume in various places that we can tell the template specialization kind of a class type by looking at the declaration produced by TagType::getDecl. That was previously not quite true: for an explicit specialization, we could have first seen a template-id denoting the specialization (with a use that does not trigger an implicit instantiation of the defintiion) and then seen the first explicit specialization declaration. TagType::getDecl would previously return an arbitrary declaration when called on a not-yet-defined class; it now consistently returns the most recent declaration in that case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295118 91177308-0d34-0410-b5e6-96231b3b80d8
* PR0091R3: Implement parsing support for using templates as types.Richard Smith2017-01-261-11/+19
| | | | | | | | | | | | | | | | This change adds a new type node, DeducedTemplateSpecializationType, to represent a type template name that has been used as a type. This is modeled around AutoType, and shares a common base class for representing a deduced placeholder type. We allow deduced class template types in a few more places than the standard does: in conditions and for-range-declarators, and in new-type-ids. This is consistent with GCC and with discussion on the core reflector. This patch does not yet support deduced class template types being named in typename specifiers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293207 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement DR1265 (wg21.link/cwg1265).Richard Smith2017-01-131-16/+29
| | | | | | | | | | | | | Diasllow a declaration using the 'auto' type specifier from using two different meanings of it at once, or from declaring multiple functions with deduced return types or introducing multiple trailing return types. The standard does not technically disallow the multiple trailing return types case if all the declarators declare variables (such as function pointers with trailing return types), but we disallow that too, following the clear intent. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291880 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix two clang-tidy misc-move-forwarding-reference warningsMalcolm Parsons2016-12-061-1/+1
| | | | | | Patch by Michael Sharpe. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288813 91177308-0d34-0410-b5e6-96231b3b80d8
* regcall: Implement regcall Calling Conv in clangErich Keane2016-11-021-0/+3
| | | | | | | | | | | This patch implements the register call calling convention, which ensures as many values as possible are passed in registers. CodeGen changes were committed in https://reviews.llvm.org/rL284108. Differential Revision: https://reviews.llvm.org/D25204 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285849 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement name mangling proposal for exception specifications from ↵Richard Smith2016-10-261-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cxx-abi-dev 2016-10-11. This has the following ABI impact: 1) Functions whose parameter or return types are non-throwing function pointer types have different manglings in c++1z mode from prior modes. This is necessary because c++1z permits overloading on the noexceptness of function pointer parameter types. A warning is issued for cases that will change manglings in c++1z mode. 2) Functions whose parameter or return types contain instantiation-dependent exception specifications change manglings in all modes. This is necessary to support overloading on / SFINAE in these exception specifications, which a careful reading of the standard indicates has essentially always been permitted. Note that, in order to be affected by these changes, the code in question must specify an exception specification on a function pointer/reference type that is written syntactically within the declaration of another function. Such declarations are very rare, and I have so far been unable to find any code that would be affected by this. (Note that such things will probably become more common in C++17, since it's a lot easier to get a noexcept function type as a function parameter / return type there.) This change does not affect the set of symbols produced by a build of clang, libc++, or libc++abi. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285150 91177308-0d34-0410-b5e6-96231b3b80d8
* [c++1z] Use canonical expression equivalence to determine whether two differentRichard Smith2016-10-181-3/+3
| | | | | | | | | | dependent noexcept specifications result in the same canonical function type. We still use non-canonical hashing when deduplicating type sugar so that diagnostics will point to the right place. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284457 91177308-0d34-0410-b5e6-96231b3b80d8
* P0012R1: Make exception specifications be part of the type system. ThisRichard Smith2016-10-161-11/+24
| | | | | | | | implements the bulk of the change (modifying the type system to include exception specifications), but not all the details just yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284337 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-commit r283722, reverted in r283750, with a fix for a CUDA-specific use ofRichard Smith2016-10-101-0/+9
| | | | | | | | | | | | past-the-end iterator. Original commit message: P0035R4: Semantic analysis and code generation for C++17 overaligned allocation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@283789 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "P0035R4: Semantic analysis and code generation for C++17 overaligned ↵Daniel Jasper2016-10-101-9/+0
| | | | | | | | | | | | allocation." This reverts commit r283722. Breaks: Clang.SemaCUDA.device-var-init.cu Clang.CodeGenCUDA.device-var-init.cu http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/884/ git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@283750 91177308-0d34-0410-b5e6-96231b3b80d8
* P0035R4: Semantic analysis and code generation for C++17 overalignedRichard Smith2016-10-101-0/+9
| | | | | | | allocation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@283722 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC Generics: Start using ObjCTypeParamType.Manman Ren2016-09-131-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For ObjC type parameter, we used to have TypedefType that is canonicalized to id or the bound type. We can't represent "T <protocol>" and thus will lose the type information in the following example: @interface MyMutableDictionary<KeyType, ObjectType> : NSObject - (void)setObject:(ObjectType)obj forKeyedSubscript:(KeyType <NSCopying>)key; @end MyMutableDictionary<NSString *, NSString *> *stringsByString; NSNumber *n1, *n2; stringsByString[n1] = n2; --> no warning on type mismatch of the key. To fix the problem, we introduce a new type ObjCTypeParamType that supports a list of protocol qualifiers. We create ObjCTypeParamType for ObjCTypeParamDecl when we create ObjCTypeParamDecl. We also substitute ObjCTypeParamType instead of TypedefType on an ObjCTypeParamDecl. rdar://24619481 rdar://25060179 Differential Revision: http://reviews.llvm.org/D23080 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281358 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC generics: Add ObjCTypeParamType in the type system.Manman Ren2016-09-131-0/+27
| | | | | | | | | | | | | | | | | | We also need to add ObjCTypeParamTypeLoc. ObjCTypeParamType supports the representation of "T <protocol>" where T is a type parameter. Before this, we use TypedefType to represent the type parameter for ObjC. ObjCTypeParamType has "ObjCTypeParamDecl *OTPDecl" and it extends from ObjCProtocolQualifiers. It is a non-canonical type and is canonicalized to the underlying type with the protocol qualifiers. rdar://24619481 rdar://25060179 Differential Revision: http://reviews.llvm.org/D23079 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281355 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a class ObjCProtocolQualifiers to wrap APIs for ObjC protocol list.Manman Ren2016-09-131-6/+3
| | | | | | | | | | | | | | | | Now ObjCObjectType extends from ObjCProtocolQualifiers. We save number of protocols in ObjCProtocolQualifiers. This is in preparation of adding a new type class ObjCTypeParamType that can take protocol qualifiers. rdar://24619481 rdar://25060179 Differential Revision: http://reviews.llvm.org/D23078 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281351 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r279351 and r279357 due to bot failuresManman Ren2016-08-201-3/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@279358 91177308-0d34-0410-b5e6-96231b3b80d8
* [NFC] Add a class ObjCProtocolQualifiers to wrap APIs for ObjC protocol list.Manman Ren2016-08-201-6/+3
| | | | | | | | | | | | | | This is in preparation of adding a new type class ObjCTypeParamType that can take protocol qualifiers. ObjCProtocolQualifiers will be shared between ObjCObjectType and ObjCTypeParamType. rdar://24619481 rdar://25060179 Differential Revision: http://reviews.llvm.org/D23078 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@279351 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C diagnostics: isObjCNSObjectType should check through AttributedType.Manman Ren2016-08-151-3/+11
| | | | | | | | | | | | | For the following example: typedef __attribute__((NSObject)) CGColorRef ColorAttrRef; @property (strong, nullable) ColorAttrRef color; The property type should be ObjC NSObject type and the compiler should not emit error: property with 'retain (or strong)' attribute must be of object type rdar://problem/27747154 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@278742 91177308-0d34-0410-b5e6-96231b3b80d8
* [NFC] Header cleanupMehdi Amini2016-07-181-2/+1
| | | | | | | | | | Summary: Removed unused headers, replaced some headers with forward class declarations Patch by: Eugene <claprix@yandex.ru> Differential Revision: https://reviews.llvm.org/D20100 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275882 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Use ArrayRef in more interfacesDavid Majnemer2016-07-071-27/+26
| | | | | | | | | ArrayRef is a little better than passing around a pointer/length pair. No functional change is intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274732 91177308-0d34-0410-b5e6-96231b3b80d8
* AMDGPU: Set amdgpu_kernel calling convention for OpenCL kernels.Nikolay Haustov2016-06-301-1/+1
| | | | | | | | | | | | | | | | | | Summary: Summary: Change Clang calling convention SpirKernel to OpenCLKernel. Set calling convention OpenCLKernel for amdgcn as well. Add virtual method .getOpenCLKernelCallingConv() to TargetCodeGenInfo and use it to set target calling convention for AMDGPU and SPIR. Update tests. Reviewers: rsmith, tstellarAMD, Anastasia, yaxunl Subscribers: kzhuravl, cfe-commits Differential Revision: http://reviews.llvm.org/D21367 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274220 91177308-0d34-0410-b5e6-96231b3b80d8
* [ObjC] Remove _Atomic from return type and parameter type ofAkira Hatanaka2016-05-261-0/+6
| | | | | | | | | | | | | | | objective-c properties. This fixes an assert in CodeGen that fires when the getter and setter functions for an objective-c property of type _Atomic(_Bool) are synthesized. rdar://problem/26322972 Differential Revision: http://reviews.llvm.org/D20407 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@270808 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Add missing const qualifiers to AstContext in Type.cppEtienne Bergeron2016-05-131-9/+9
| | | | | | | | | | | | | | | | Summary: Add some missing const qualifiers to AstContext. The ASTContext can't be modified with accessors. There is no behavior change. This patch is cleanup only. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20226 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269418 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable support for __float128 in Clang and enable it on pertinent platformsNemanja Ivanovic2016-05-091-3/+5
| | | | | | | | | | | | | | | | | | | This patch corresponds to reviews: http://reviews.llvm.org/D15120 http://reviews.llvm.org/D19125 It adds support for the __float128 keyword, literals and target feature to enable it. Based on the latter of the two aforementioned reviews, this feature is enabled on Linux on i386/X86 as well as SystemZ. This is also the second attempt in commiting this feature. The first attempt did not enable it on required platforms which caused failures when compiling type_traits with -std=gnu++11. If you see failures with compiling this header on your platform after this commit, it is likely that your platform needs to have this feature enabled. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268898 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 266186 as it breaks anything that includes type_traits on some platformsNemanja Ivanovic2016-04-151-5/+3
| | | | | | | | | | | Since this patch provided support for the __float128 type but disabled it on all platforms by default, some platforms can't compile type_traits with -std=gnu++11 since there is a specialization with __float128. This reverts the patch until D19125 is approved (i.e. we know which platforms need this support enabled). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266460 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable support for __float128 in ClangNemanja Ivanovic2016-04-131-3/+5
| | | | | | | | | | | | | | | | | This patch corresponds to review: http://reviews.llvm.org/D15120 It adds support for the __float128 keyword, literals and a target feature to enable it. This support is disabled by default on all targets and any target that has support for this type is free to add it. Based on feedback that I've received from target maintainers, this appears to be the right thing for most targets. I have not heard from the maintainers of X86 which I believe supports this type. I will subsequently investigate the impact of enabling this on X86. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266186 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Move OpenCLImageTypes.def from clangAST to clangBasic library.Alexey Bader2016-04-131-2/+2
| | | | | | | | | | Putting OpenCLImageTypes.def to clangAST library violates layering requirement: "It's not OK for a Basic/ header to include an AST/ header". This fixes the modules build. Differential revision: http://reviews.llvm.org/D18954 Reviewers: Richard Smith, Vassil Vassilev. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266180 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Complete image types support.Alexey Bader2016-04-081-36/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I. Current implementation of images is not conformant to spec in the following points: 1. It makes no distinction with respect to access qualifiers and therefore allows to use images with different access type interchangeably. The following code would compile just fine: void write_image(write_only image2d_t img); kernel void foo(read_only image2d_t img) { write_image(img); } // Accepted code which is disallowed according to s6.13.14. 2. It discards access qualifier on generated code, which leads to generated code for the above example: call void @write_image(%opencl.image2d_t* %img); In OpenCL2.0 however we can have different calls into write_image with read_only and wite_only images. Also generally following compiler steps have no easy way to take different path depending on the image access: linking to the right implementation of image types, performing IR opts and backend codegen differently. 3. Image types are language keywords and can't be redeclared s6.1.9, which can happen currently as they are just typedef names. 4. Default access qualifier read_only is to be added if not provided explicitly. II. This patch corrects the above points as follows: 1. All images are encapsulated into a separate .def file that is inserted in different points where image handling is required. This avoid a lot of code repetition as all images are handled the same way in the code with no distinction of their exact type. 2. The Cartesian product of image types and image access qualifiers is added to the builtin types. This simplifies a lot handling of access type mismatch as no operations are allowed by default on distinct Builtin types. Also spec intended access qualifier as special type qualifier that are combined with an image type to form a distinct type (see statement above - images can't be created w/o access qualifiers). 3. Improves testing of images in Clang. Author: Anastasia Stulova Reviewers: bader, mgrang. Subscribers: pxli168, pekka.jaaskelainen, yaxunl. Differential Revision: http://reviews.llvm.org/D17821 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265783 91177308-0d34-0410-b5e6-96231b3b80d8
* Canonicalize UnaryTransformType types when they don't have a known ↵Vassil Vassilev2016-03-301-11/+18
| | | | | | | | | | | underlying type. Fixes https://llvm.org/bugs/show_bug.cgi?id=26014 Reviewed by Richard Smith. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264937 91177308-0d34-0410-b5e6-96231b3b80d8
* Add attributes for preserve_mostcc/preserve_allcc calling conventions to the ↵Roman Levenstein2016-03-161-0/+6
| | | | | | | | | | | | | | | C/C++ front-end Till now, preserve_mostcc/preserve_allcc calling convention attributes were only available at the LLVM IR level. This patch adds attributes for preserve_mostcc/preserve_allcc calling conventions to the C/C++ front-end. The code was mostly written by Juergen Ributzka. I just added support for the AArch64 target and tests. Differential Revision: http://reviews.llvm.org/D18025 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263647 91177308-0d34-0410-b5e6-96231b3b80d8
* Semantic analysis for the swiftcall calling convention.John McCall2016-03-031-0/+3
| | | | | | | I've tried to keep the infrastructure behind parameter ABI treatments fairly general. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262587 91177308-0d34-0410-b5e6-96231b3b80d8
* Generalize the consumed-parameter array on FunctionProtoTypeJohn McCall2016-03-011-6/+7
| | | | | | | | | to allow arbitrary data to be associated with a parameter. Also, fix a bug where we apparently haven't been serializing this information for the last N years. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262278 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Pipe type supportXiuli Pan2016-01-091-0/+5
| | | | | | | | | | | | | | | Summary: Support for OpenCL 2.0 pipe type. This is a bug-fix version for bader's patch reviews.llvm.org/D14441 Reviewers: pekka.jaaskelainen, Anastasia Subscribers: bader, Anastasia, cfe-commits Differential Revision: http://reviews.llvm.org/D15603 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257254 91177308-0d34-0410-b5e6-96231b3b80d8
* Test CommitXiuli Pan2016-01-091-1/+1
| | | | | | | Fix a typo git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257252 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't actually add the __unsafe_unretained qualifier in MRC;John McCall2015-11-191-0/+24
| | | | | | | | | | | driving a canonical difference between that and an unqualified type is a really bad idea when both are valid. Instead, remember that it was there in a non-canonical way, then look for that in the one place we really care about it: block captures. The net effect closely resembles the behavior of a decl attribute, except still closely following ARC's standard qualifier parsing rules. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253534 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for GCC's '__auto_type' extension, per the GCC manual:Richard Smith2015-11-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | https://gcc.gnu.org/onlinedocs/gcc/Typeof.html Differences from the GCC extension: * __auto_type is also permitted in C++ (but only in places where it could appear in C), allowing its use in headers that might be shared across C and C++, or used from C++98 * __auto_type can be combined with a declarator, as with C++ auto (for instance, "__auto_type *p") * multiple variables can be declared in a single __auto_type declaration, with the C++ semantics (the deduced type must be the same in each case) This patch also adds a missing restriction on applying typeof to a bit-field, which GCC has historically rejected in C (due to lack of clarity as to whether the operand should be promoted). The same restriction also applies to __auto_type in C (in both GCC and Clang). This also fixes PR25449. Patch by Nicholas Allegra! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252690 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert part of r248660 as using None didn't work with the ArrayRef being ↵Craig Topper2015-09-261-2/+2
| | | | | | returned as an Optional. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248661 91177308-0d34-0410-b5e6-96231b3b80d8
* Use None to avoid re-mentioning the ArrayRef type to call the default ↵Craig Topper2015-09-261-2/+2
| | | | | | constructor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248660 91177308-0d34-0410-b5e6-96231b3b80d8
* Forbid qualifiers on ObjC generic parameters and arguments, butJohn McCall2015-09-231-0/+41
| | | | | | | | | | | | | | silently ignore them on arguments when they're provided indirectly (.e.g behind a template argument or typedef). This is mostly just good language design --- specifying that a generic argument is __weak doesn't actually do anything --- but it also prevents assertions when trying to apply a different ownership qualifier. rdar://21612439 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248436 91177308-0d34-0410-b5e6-96231b3b80d8
* Run clang-format to unify the switch statement style as suggest here: ↵Alexey Bader2015-09-151-44/+87
| | | | | | | | http://reviews.llvm.org/D12855#246073. NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247678 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Add new types for OpenCL 2.0.Alexey Bader2015-09-151-0/+30
| | | | | | | | Patch by Pedro Ferreira. Reviewers: pekka.jaaskelainen Differential Revision: http://reviews.llvm.org/D12855 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247676 91177308-0d34-0410-b5e6-96231b3b80d8