summaryrefslogtreecommitdiffstats
path: root/clang/lib/Edit/RewriteObjCFoundationAPI.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove trailing spaceFangrui Song2018-07-301-9/+9
| | | | | | sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h} llvm-svn: 338291
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-091-4/+4
| | | | | | | | | | | | | | | | | | | This is similar to the LLVM change https://reviews.llvm.org/D46290. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46320 llvm-svn: 331834
* Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.Galina Kistanova2017-06-031-0/+4
| | | | llvm-svn: 304648
* Fix problems in "[OpenCL] Enabling the usage of CLK_NULL_QUEUE as compare ↵Egor Churaev2016-12-231-0/+1
| | | | | | | | | | | | | | operand." Summary: Fixed warnings in commit: https://reviews.llvm.org/rL290171 Reviewers: djasper, Anastasia Subscribers: yaxunl, cfe-commits, bader Differential Revision: https://reviews.llvm.org/D27981 llvm-svn: 290431
* [OpenCL] Generate opaque type for sampler_t and function call for the ↵Yaxun Liu2016-07-281-0/+1
| | | | | | | | | | | | | | | | initializer Currently Clang use int32 to represent sampler_t, which have been a source of issue for some backends, because in some backends sampler_t cannot be represented by int32. They have to depend on kernel argument metadata and use IPA to find the sampler arguments and global variables and transform them to target specific sampler type. This patch uses opaque pointer type opencl.sampler_t* for sampler_t. For each use of file-scope sampler variable, it generates a function call of __translate_sampler_initializer. For each initialization of function-scope sampler variable, it generates a function call of __translate_sampler_initializer. Each builtin library can implement its own __translate_sampler_initializer(). Since the real sampler type tends to be architecture dependent, allowing it to be initialized by a library function simplifies backend design. A typical implementation of __translate_sampler_initializer could be a table lookup of real sampler literal values. Since its argument is always a literal, the returned pointer is known at compile time and easily optimized to finally become some literal values directly put into image read instructions. This patch is partially based on Alexey Sotkin's work in Khronos Clang (https://github.com/KhronosGroup/SPIR/commit/3d4eec61623502fc306e8c67c9868be2b136e42b). Differential Revision: https://reviews.llvm.org/D21567 llvm-svn: 277024
* [Bugfix] Fix ICE on constexpr vector splat.George Burgess IV2016-01-131-0/+3
| | | | | | | | | | | | | In {CG,}ExprConstant.cpp, we weren't treating vector splats properly. This patch makes us treat splats more properly. Additionally, this patch adds a new cast kind which allows a bool->int cast to result in -1 or 0, instead of 1 or 0 (for true and false, respectively), so we can sanely model OpenCL bool->int casts in the AST. Differential Revision: http://reviews.llvm.org/D14877 llvm-svn: 257559
* Objective-C modernization. Convert -initWithUTF8String messagingFariborz Jahanian2014-08-251-1/+2
| | | | | | with auto-boxing syntax for literals. rdar://18080352 llvm-svn: 216405
* [C++11] Use 'nullptr'.Craig Topper2014-05-091-4/+4
| | | | llvm-svn: 208392
* Add front-end infrastructure now address space casts are in LLVM IR.David Tweed2013-12-111-0/+1
| | | | | | | | | | With the introduction of explicit address space casts into LLVM, there's a need to provide a new cast kind the front-end can create for C/OpenCL/CUDA and code to produce address space casts from those kinds when appropriate. Patch by Michele Scandale! llvm-svn: 197036
* ObjectiveC migrator: Remove semicolon after the typedefFariborz Jahanian2013-07-181-92/+0
| | | | | | | declaration when converting to NS_ENUM. This required some code refactoring. llvm-svn: 186619
* ObjectiveC migration. migration to NS_ENUM/SN_OPTIONFariborz Jahanian2013-07-181-0/+13
| | | | | | - wip. llvm-svn: 186604
* ObjectiveC migration: complete migrating classFariborz Jahanian2013-07-161-22/+22
| | | | | | | declaration to include list of protocols class conforms to. llvm-svn: 186443
* ObjC migrator: build conforming interfaceFariborz Jahanian2013-07-161-0/+32
| | | | | | declaration (not yet used). wip. llvm-svn: 186369
* ObjC migrator: Improve on hueristics.Fariborz Jahanian2013-07-101-5/+20
| | | | | | | | | | | | migrate to 'copy attribute if Object class implements NSCopying otherwise assume implied 'strong'. Remove lifetime qualifier on property as it has moved to property's attribute. Added TODO comment for future work by poking into setter implementation. llvm-svn: 186037
* objc migrator: More refinment of propertyFariborz Jahanian2013-07-101-9/+9
| | | | | | | attributes in migration. Specialli use of 'copy' attribute for retainable object types. llvm-svn: 185985
* [Objective-C migrator] replace candidate user setter/getter withFariborz Jahanian2013-07-081-1/+27
| | | | | | their equivalent property declaration. wip. llvm-svn: 185873
* [objc migrator]: More knobs to do migration toFariborz Jahanian2013-07-051-0/+6
| | | | | | use of objc's properties. llvm-svn: 185724
* Include llvm::Optional in clang/Basic/LLVM.hDavid Blaikie2013-02-201-3/+3
| | | | | | Post-commit CR feedback from Jordan Rose regarding r175594. llvm-svn: 175679
* Remove an unneeded const_castDmitri Gribenko2013-02-141-3/+2
| | | | llvm-svn: 175160
* 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-4/+158
| | | | | | | | | | | | | | | | | | 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
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-3/+3
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* 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] Check for classes that accept 'objectForKey:' (or the other selectorsArgyrios Kyrtzidis2012-07-061-5/+70
| | | | | | | | | | | | that the migrator handles) but return their instances as 'id', resulting in the compiler resolving 'objectForKey:' as the method from NSDictionary. When checking if we can convert to subscripting syntax, check whether the receiver is a result of a class method from a hardcoded list of such classes. In such a case return the specific class as the interface of the receiver. llvm-svn: 159788
* [objcmt] Allow migrating to subscripting syntax for other classesArgyrios Kyrtzidis2012-07-051-15/+25
| | | | | | | | | (apart from NSDictionary/NSArray) that implement objectForKey:/objectAtIndex/etc. and the subscripting methods as well. Part of rdar://11734969 llvm-svn: 159783
* Drop the ASTContext.h include from Stmt.h and fix up transitive users.Benjamin Kramer2012-07-041-0/+1
| | | | | | | | | | | | | | This required moving the ctors for IntegerLiteral and FloatingLiteral out of line which shouldn't change anything as they are usually called through Create methods that are already out of line. ASTContext::Deallocate has been a nop for a long time, drop it from ASTVector and make it independent from ASTContext.h Pass the StorageAllocator directly to AccessedEntity so it doesn't need to have a definition of ASTContext around. llvm-svn: 159718
* [objcmt] Have the modern objc migration warning change from:Argyrios Kyrtzidis2012-06-201-2/+3
| | | | | | | | | | | | | | | [NSNumber numberWithDouble:cppb]; warning: converting to boxing syntax requires a cast to something like: [NSNumber numberWithDouble:cppb]; warning: converting to boxing syntax requires casting 'bool' to 'double' This is way better to fully understand the warning. rdar://11705106 llvm-svn: 158783
* [objcmt] When checking whether the subscripting methods are declared useArgyrios Kyrtzidis2012-06-191-4/+4
| | | | | | | | | ObjCInterfaceDec::lookupInstanceMethod to make sure we check categories as well and update related tests. rdar://11695288 llvm-svn: 158697
* [objcmt] When in ARC mode, also convert "[[.. alloc] init]" messages to ↵Argyrios Kyrtzidis2012-06-061-9/+27
| | | | | | | | | | literals, since the change from +1 to +0 will be handled fine by ARC. rdar://11606358 llvm-svn: 158114
* [objcmt] Don't migrate to subscripting syntax if the required methods have notArgyrios Kyrtzidis2012-06-041-11/+40
| | | | | | | | been declared on NSArray/NSDictionary. rdar://11581975 llvm-svn: 157951
* [objcmt] Warn when modern objc migrator does not convert a NSNumber message ↵Argyrios Kyrtzidis2012-05-241-1/+7
| | | | | | | | because it requires a cast. rdar://11525138 llvm-svn: 157395
* [objcmt] Don't add redundant parentheses when migrating subscripting of an ivar.Argyrios Kyrtzidis2012-05-221-0/+2
| | | | | | rdar://11501256 llvm-svn: 157227
* [objcmt] Accept char arrays for rewriting to @() syntax.Argyrios Kyrtzidis2012-05-161-2/+4
| | | | | | Part of rdar://11438360 llvm-svn: 156880
* [objcmt] When using NSNumber numberWithInteger:/numberWithUnsignedInteger: beArgyrios Kyrtzidis2012-05-151-1/+9
| | | | | | | | more liberal in rewriting when the parameter is an enum constant. Part of rdar://11438360 llvm-svn: 156873
* [objcmt] Rewrite messages to NSString's stringWithUTF8String:/stringWithCString:Argyrios Kyrtzidis2012-05-151-1/+70
| | | | | | | | | | | 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
* [objcmt] Rewrite [NSNumber numberWith*] messages to the new @() boxing syntax.Argyrios Kyrtzidis2012-05-151-13/+141
| | | | | | | | | | | | | There are some caveats: -If an implicit cast (e.g. int -> float for numberWithFloat:) was required, the message will not get rewritten -If the message was with numberWithInteger:/numberWithUnsignedInteger:, which are very commonly used, be more liberal and allow the boxing syntax if the underlying type has same signedness and will not lose precision. Part of rdar://11438360 llvm-svn: 156844
* [objcmt] When rewriting to subscripting syntax, make sure we putArgyrios Kyrtzidis2012-05-141-2/+26
| | | | | | | | the receiver in parentheses when necessary. Part of rdar://11438360 llvm-svn: 156789
* [objcmt] When rewriting to array/dictionary literals, add an explicitArgyrios Kyrtzidis2012-05-141-0/+63
| | | | | | | | cast to 'id' for any argument that requires it. Part of rdar://11438360. llvm-svn: 156782
* Remove unused-but-set variable.Benjamin Kramer2012-03-131-5/+3
| | | | llvm-svn: 152633
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-1/+1
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Add new code migrator support for migrating existing Objective-C code to useTed Kremenek2012-03-061-0/+589
the new Objective-C NSArray/NSDictionary/NSNumber literal syntax. This introduces a new library, libEdit, which provides a new way to support migration of code that improves on the original ARC migrator. We now believe that most of its functionality can be refactored into the existing libraries, and thus this new library may shortly disappear. llvm-svn: 152141
OpenPOWER on IntegriCloud