summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/NSAPI.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Recommit "Add _Float16 as a C/C++ source language type"Sjoerd Meijer2017-09-081-0/+1
| | | | | | | | This is a recommit of r312781; in some build configurations variable names are omitted, so changed the new regression test accordingly. llvm-svn: 312794
* Revert "Add _Float16 as a C/C++ source language type"Sjoerd Meijer2017-09-081-1/+0
| | | | | | | The clang-with-lto-ubuntu bot didn't like the new regression test, revert while I investigate the issue. llvm-svn: 312784
* Add _Float16 as a C/C++ source language typeSjoerd Meijer2017-09-081-0/+1
| | | | | | | | | | | This adds _Float16 as a source language type, which is a 16-bit floating point type defined in C11 extension ISO/IEC TS 18661-3. In follow up patches documentation and more tests will be added. Differential Revision: https://reviews.llvm.org/D33719 llvm-svn: 312781
* [OpenCL] Correct ndrange_t implementationAnastasia Stulova2017-02-161-1/+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! llvm-svn: 295311
* Enable support for __float128 in Clang and enable it on pertinent platformsNemanja Ivanovic2016-05-091-0/+1
| | | | | | | | | | | | | | | | | | 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. llvm-svn: 268898
* Revert 266186 as it breaks anything that includes type_traits on some platformsNemanja Ivanovic2016-04-151-1/+0
| | | | | | | | | | 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). llvm-svn: 266460
* Enable support for __float128 in ClangNemanja Ivanovic2016-04-131-0/+1
| | | | | | | | | | | | | | | | 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. llvm-svn: 266186
* [OpenCL] Move OpenCLImageTypes.def from clangAST to clangBasic library.Alexey Bader2016-04-131-1/+1
| | | | | | | | | | 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. llvm-svn: 266180
* [OpenCL] Complete image types support.Alexey Bader2016-04-081-12/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 265783
* [OpenCL] Add new types for OpenCL 2.0.Alexey Bader2015-09-151-0/+10
| | | | | | | | Patch by Pedro Ferreira. Reviewers: pekka.jaaskelainen Differential Revision: http://reviews.llvm.org/D12855 llvm-svn: 247676
* [OPENMP 4.0] Initial support for array sections.Alexey Bataev2015-08-251-0/+1
| | | | | | | | Adds parsing/sema analysis/serialization/deserialization for array sections in OpenMP constructs (introduced in OpenMP 4.0). Currently it is allowed to use array sections only in OpenMP clauses that accepts list of expressions. Differential Revision: http://reviews.llvm.org/D10732 llvm-svn: 245937
* [ObjC] Circular containers: add support of subclassesAlex Denisov2015-08-061-1/+21
| | | | llvm-svn: 244193
* [ObjC] Add NSValue support for objc_boxed_expressionsAlex Denisov2015-06-261-1/+2
| | | | | | | | | | | | | Patch extends ObjCBoxedExpr to accept records (structs and unions): typedef struct __attribute__((objc_boxable)) _Color { int r, g, b; } Color; Color color; NSValue *boxedColor = @(color); // [NSValue valueWithBytes:&color objCType:@encode(Color)]; llvm-svn: 240761
* [modules] Stop trying to fake up a linear MacroDirective history.Richard Smith2015-04-291-0/+5
| | | | | | | | | | | | | | Modules builds fundamentally have a non-linear macro history. In the interest of better source fidelity, represent the macro definition information faithfully: we have a linear macro directive history within each module, and at any point we have a unique "latest" local macro directive and a collection of visible imported directives. This also removes the attendent complexity of attempting to create a correct MacroDirective history (which we got wrong in the general case). No functionality change intended. llvm-svn: 236176
* New ObjC warning: circular containers.Alex Denisov2015-03-041-1/+96
| | | | | | | | | | | | | | | | | | | | | This commit adds new warning to prevent user from creating 'circular containers'. Mutable collections from NSFoundation allows user to add collection to itself, e.g.: NSMutableArray *a = [NSMutableArray new]; [a addObject:a]; The code above leads to really weird behaviour (crashes, 'endless' recursion) and retain cycles (collection retains itself) if ARC enabled. Patch checks the following collections: - NSMutableArray, - NSMutableDictionary, - NSMutableSet, - NSMutableOrderedSet, - NSCountedSet. llvm-svn: 231265
* Objective-C. revert patch for rdar://17554063.Fariborz Jahanian2014-10-281-17/+0
| | | | llvm-svn: 220812
* Objective-C SDK modernizer. Patch to support modernizationFariborz Jahanian2014-10-061-0/+27
| | | | | | | | to NS_ENUM/NS_OPTION macros when typedef names are other than NSInteger/NSUInteger (int8_t, etc.). rdar://18532199 llvm-svn: 219173
* Objective-C modernization. Convert -initWithUTF8String messagingFariborz Jahanian2014-08-251-0/+4
| | | | | | with auto-boxing syntax for literals. rdar://18080352 llvm-svn: 216405
* Objective-C ARC. Adding declarations for Objective-C'sFariborz Jahanian2014-08-061-0/+17
| | | | | | new APIs for literals. nfc. wip. rdar://17554063 llvm-svn: 214993
* [C++11] Use 'nullptr'. AST edition.Craig Topper2014-05-121-3/+3
| | | | llvm-svn: 208517
* Use None rather than Optional<T>() where possible.David Blaikie2013-02-211-6/+6
| | | | llvm-svn: 175705
* Include llvm::Optional in clang/Basic/LLVM.hDavid Blaikie2013-02-201-12/+11
| | | | | | Post-commit CR feedback from Jordan Rose regarding r175594. llvm-svn: 175679
* Add OpenCL samplers as Clang builtin types and check sampler related ↵Guy Benyei2013-02-071-0/+1
| | | | | | restrictions. llvm-svn: 174601
* Implement OpenCL event_t as Clang builtin type, including event_t related ↵Guy Benyei2013-01-201-0/+1
| | | | | | OpenCL restrictions (OpenCL 1.2 spec 6.9) llvm-svn: 172973
* [objcmt] Rewrite a NSDictionary dictionaryWithObjects:forKeys: to a ↵Argyrios Kyrtzidis2013-01-161-0/+8
| | | | | | | | | | | | | | | | | | dictionary literal if we can see the elements of the arrays. for example: NSDictionary *dict = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"1", @"2", nil] forKeys:[NSArray arrayWithObjects:@"A", @"B", nil]]; --> NSDictionary *dict = @{ @"A" : @"1", @"B" : @"2" }; rdar://12428166 llvm-svn: 172679
* Re-commit r170428 changes with Linux style file endings.Guy Benyei2012-12-181-0/+6
| | | | | | Add OpenCL images as clang builtin types. llvm-svn: 170432
* Revert changes from r170428, as I accidentally changed the line endings of ↵Guy Benyei2012-12-181-420/+414
| | | | | | these files to Windows style. llvm-svn: 170431
* Add OpenCL images as clang builtin types.Guy Benyei2012-12-181-414/+420
| | | | llvm-svn: 170428
* Change the representation of builtin functions in the ASTEli Friedman2012-08-311-0/+1
| | | | | | | | | (__builtin_* etc.) so that it isn't possible to take their address. Specifically, introduce a new type to represent a reference to a builtin function, and a new cast kind to convert it to a function pointer in the operand of a call. Fixes PR13195. llvm-svn: 162962
* [objcmt] Don't migrate to subscripting syntax if the required methods have notArgyrios Kyrtzidis2012-06-041-0/+12
| | | | | | | | been declared on NSArray/NSDictionary. rdar://11581975 llvm-svn: 157951
* [objcmt] Rewrite messages to NSString's stringWithUTF8String:/stringWithCString:Argyrios Kyrtzidis2012-05-151-1/+47
| | | | | | | | | | | to use the @() boxing syntax. It will also rewrite uses of stringWithCString:encoding: where the encoding that is used is NSASCIIStringEncoding or NSUTF8StringEncoding. rdar://11438360 llvm-svn: 156868
* [objc] When boxing a BOOL/NSInteger/NSUInteger type, use the correspondingArgyrios Kyrtzidis2012-05-101-3/+46
| | | | | | | | numberWithBool:/numberWithInteger:/numberWithUnsignedInteger: NSNumber selectors. rdar://11428703 llvm-svn: 156583
* Added a new attribute, objc_root_class, which informs the compiler when a ↵Patrick Beard2012-04-061-0/+1
| | | | | | | | | root class is intentionally declared. The warning this inhibits, -Wobjc-root-class, is opt-in for now. However, all clang unit tests that would trigger the warning have been updated to use -Wno-objc-root-class. <rdar://problem/7446698> llvm-svn: 154187
* Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,Ted Kremenek2012-03-061-0/+311
NSNumber, and boolean literals. This includes both Sema and Codegen support. Included is also support for new Objective-C container subscripting. My apologies for the large patch. It was very difficult to break apart. The patch introduces changes to the driver as well to cause clang to link in additional runtime support when needed to support the new language features. Docs are forthcoming to document the implementation and behavior of these features. llvm-svn: 152137