summaryrefslogtreecommitdiffstats
path: root/clang/lib/Edit
Commit message (Collapse)AuthorAgeFilesLines
* [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
* Fix uninitialized variable use bug found by the clairvoyant static analyzer.Argyrios Kyrtzidis2012-06-271-0/+1
| | | | | | | Commit::canReplaceText would not initialize its out 'Len' parameter before returning true and it would be used uninitialized in Commit::replaceText. llvm-svn: 159306
* Remove a goofy CMake hack and use the standard CMake facilities toChandler Carruth2012-06-211-2/+6
| | | | | | | | | express library-level dependencies within Clang. This is no more verbose really, and plays nicer with the rest of the CMake facilities. It should also have no change in functionality. llvm-svn: 158888
* [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-142-1/+67
| | | | | | | | 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-112-2/+2
| | | | | | | | | | (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-065-0/+1284
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