summaryrefslogtreecommitdiffstats
path: root/clang/lib/ARCMigrate
Commit message (Collapse)AuthorAgeFilesLines
* Replace TypeLoc llvm::cast support to be well-defined.David Blaikie2013-02-181-14/+14
| | | | | | | | | | | | | | The TypeLoc hierarchy used the llvm::cast machinery to perform undefined behavior by casting pointers/references to TypeLoc objects to derived types and then using the derived copy constructors (or even returning pointers to derived types that actually point to the original TypeLoc object). Some context is in this thread: http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-December/056804.html Though it's spread over a few months which can be hard to read in the mail archive. llvm-svn: 175462
* [arcmt] Make sure the function has an associated parameter for the argumentArgyrios Kyrtzidis2013-02-141-1/+1
| | | | | | | | before checking for its attributes. rdar://13192395 llvm-svn: 175184
* [arcmt] Make sure the objc migrators work fine when used with a PCH.Argyrios Kyrtzidis2013-02-051-2/+19
| | | | | | rdar://13140508 llvm-svn: 174386
* Re-sort all the headers. Lots of regressions have crept in here.Chandler Carruth2013-01-191-1/+1
| | | | | | | | | | Manually fix the order of UnwrappedLineParser.cpp as that one didn't have its associated header as the first header. This also uncovered a subtle inclusion order dependency as CLog.h didn't include LLVM.h to pick up using declarations it relied upon. llvm-svn: 172892
* [objcmt] Rewrite a NSDictionary dictionaryWithObjects:forKeys: to a ↵Argyrios Kyrtzidis2013-01-161-3/+23
| | | | | | | | | | | | | | | | | | 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
* Rework the traversal of Objective-C categories and extensions toDouglas Gregor2013-01-161-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | consider (sub)module visibility. The bulk of this change replaces myriad hand-rolled loops over the linked list of Objective-C categories/extensions attached to an interface declaration with loops using one of the four new category iterator kinds: visible_categories_iterator: Iterates over all visible categories and extensions, hiding any that have their "hidden" bit set. This is by far the most commonly used iterator. known_categories_iterator: Iterates over all categories and extensions, ignoring the "hidden" bit. This tends to be used for redeclaration-like traversals. visible_extensions_iterator: Iterates over all visible extensions, hiding any that have their "hidden" bit set. known_extensions_iterator: Iterates over all extensions, whether they are visible to normal name lookup or not. The effect of this change is that any uses of the visible_ iterators will respect module-import visibility. See the new tests for examples. Note that the old accessors for categories and extensions are gone; there are *Raw() forms for some of them, for those (few) areas of the compiler that have to manipulate the linked list of categories directly. This is generally discouraged. Part two of <rdar://problem/10634711>. llvm-svn: 172665
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-123-8/+8
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* [arcmt] Follow-up for r171484; make sure when adding brackets enclosing case ↵Argyrios Kyrtzidis2013-01-081-58/+136
| | | | | | | | | statements, that the case does not "contain" a declaration that is referenced "outside" of it, otherwise we will emit un-compilable code. llvm-svn: 171828
* Update CMakeLists.txtTed Kremenek2013-01-041-2/+2
| | | | llvm-svn: 171505
* Add file added in r171484 to CMakelists.txt.Filipe Cabecinhas2013-01-041-0/+1
| | | | llvm-svn: 171494
* [arcmt] Allow removing an -autorelease of a variable initialized in the ↵Argyrios Kyrtzidis2013-01-043-16/+58
| | | | | | | | previous statement. rdar://11074996 llvm-svn: 171485
* [arcmt] Adds brackets in case statements that "contain" initialization of ↵Argyrios Kyrtzidis2013-01-045-5/+135
| | | | | | | | | | retaining variable, thus emitting the "switch case is in protected scope" error. rdar://12952016 llvm-svn: 171484
* [arcmt] Don't error if an autoreleased variable is returned after the ↵Argyrios Kyrtzidis2013-01-041-18/+70
| | | | | | | | -autorelease. rdar://12952025 llvm-svn: 171482
* [arcmt] Rewrite uses of Block_copy/Block_release macros.Argyrios Kyrtzidis2013-01-031-9/+88
| | | | | | | | | | | | c = Block_copy(b); Block_release(c); ----> c = [b copy]; <removed> rdar://9408211 llvm-svn: 171454
* [arcmt] When capturing ARC errors, have a sanity check to make sureArgyrios Kyrtzidis2012-12-121-1/+2
| | | | | | the diagnostic has a valid location. llvm-svn: 170040
* [objc] For the ARC error that is emitted when a synthesized property ↵Argyrios Kyrtzidis2012-12-121-6/+12
| | | | | | | | | | | | | | | implementation has inconsistent ownership with the backing ivar, point the error location to the ivar. Pointing to the ivar (instead of the @synthesize) is better since this is where a fix is needed. Also provide the location of @synthesize via a note. This also fixes the problem where an auto-synthesized property would emit an error without any location. llvm-svn: 170039
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-049-23/+23
| | | | | | | | | | | | | 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
* Refactor recording the preprocessor conditional directive regions out ofArgyrios Kyrtzidis2012-12-041-8/+11
| | | | | | | | | PreprocessingRecord and into its own class, PPConditionalDirectiveRecord. Decoupling allows a client to use the functionality of PPConditionalDirectiveRecord without needing a PreprocessingRecord. llvm-svn: 169229
* Don't include Type.h in DeclarationName.h.Benjamin Kramer2012-12-012-1/+3
| | | | | | Recursively prune some includes. llvm-svn: 169094
* Pull the Attr iteration parts out of Attr.h, so including DeclBase.h doesn't ↵Benjamin Kramer2012-12-012-1/+3
| | | | | | | | | pull in all the generated Attr code. Required to pull some functions out of line, but this shouldn't have a perf impact. No functionality change. llvm-svn: 169092
* s/tranform/transform/Benjamin Kramer2012-11-1413-13/+13
| | | | llvm-svn: 167929
* Remove old driver code to grab the iOS simulator version from the -D option.Bob Wilson2012-11-091-44/+0
| | | | | | | We can now rely on the -mios-simulator-version-min command line option and remove the awful hack. <rdar://problem/10304510> llvm-svn: 167603
* Move PreprocessorOptions into the Lex library, and make it intrusivelyDouglas Gregor2012-10-241-1/+1
| | | | | | reference-counted. llvm-svn: 166587
* Use a .def file for most of the diagnostic options.Douglas Gregor2012-10-231-0/+2
| | | | llvm-svn: 166520
* Make DiagnosticOptions intrusively reference-counted, and make sureDouglas Gregor2012-10-231-9/+16
| | | | | | | the various stakeholders bump up the reference count. In particular, the diagnostics engine now keeps the DiagnosticOptions object alive. llvm-svn: 166508
* Split library clangRewrite into clangRewriteCore and clangRewriteFrontend.Ted Kremenek2012-09-013-3/+4
| | | | | | | This is similar to how we divide up the StaticAnalyzer libraries to separate core functionality to what is clearly associated with Frontend actions. llvm-svn: 163050
* Fixed invalid iterators. Since the iterator is invalidated after the erase() ↵Joao Matos2012-08-311-1/+1
| | | | | | call, we need to replace it with the new one returned. This was triggering an assert under MSVC 2012 and making all the ARCMT/ tests fail. llvm-svn: 163007
* Fix undefined behavior: member function calls where 'this' is a null pointer.Richard Smith2012-08-231-1/+1
| | | | llvm-svn: 162430
* Screw around with ObjCRuntime some more, changing theJohn McCall2012-08-212-2/+2
| | | | | | | | diagnostics for bad deployment targets and adding a few more predicates. Includes a patch by Jonathan Schleifer to enable ARC for ObjFW. llvm-svn: 162252
* Update VerifyDiagnosticConsumer to only get directives during parsing.Jordan Rose2012-08-101-6/+43
| | | | | | | | | | | | | | | | | | | | The old behavior was to re-scan any files (like modules) where we may have directives but won't actually be parsing during the -verify invocation. Now, we keep the old behavior in Debug builds as a sanity check (though modules are a known entity), and expect all legitimate directives to come from comments seen by the preprocessor. This also affects the ARC migration tool, which captures diagnostics in order to filter some out. This change adds an explicit cleanup to CaptureDiagnosticsConsumer in order to let its sub-consumer handle the real end of diagnostics. This was originally split into four patches, but the tests do not run cleanly without all four, so I've combined them into one commit. Patches by Andy Gibbs, with slight modifications from me. llvm-svn: 161650
* clang/lib: [CMake] Update tblgen'd dependencies.NAKAMURA Takumi2012-07-271-0/+4
| | | | llvm-svn: 160851
* clang/lib: [CMake] Reformat, alphabetize lists.NAKAMURA Takumi2012-07-271-1/+2
| | | | llvm-svn: 160850
* Fix a typo (the the => the)Sylvestre Ledru2012-07-231-1/+1
| | | | llvm-svn: 160622
* Implement AST classes for comments, a real parser for Doxygen comments and aDmitri Gribenko2012-07-061-0/+1
| | | | | | | | | | | | | | very simple semantic analysis that just builds the AST; minor changes for lexer to pick up source locations I didn't think about before. Comments AST is modelled along the ideas of HTML AST: block and inline content. * Block content is a paragraph or a command that has a paragraph as an argument or verbatim command. * Inline content is placed within some block. Inline content includes plain text, inline commands and HTML as tag soup. llvm-svn: 159790
* Drop the ASTContext.h include from DeclFriend.h and DeclTemplate.h.Benjamin Kramer2012-07-0413-10/+23
| | | | llvm-svn: 159723
* 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
* Remove a goofy CMake hack and use the standard CMake facilities toChandler Carruth2012-06-211-2/+8
| | | | | | | | | 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
* [arcmt]Argyrios Kyrtzidis2012-06-201-1/+2
| | | | | | | -Disable -pedantic-errors when migrating per Jordan's suggestion. -Use llvm_move() per John's suggestion. llvm-svn: 158785
* [arcmt] When migrating to ARC disable -Werror so as to only block migrationArgyrios Kyrtzidis2012-06-201-2/+12
| | | | | | | | for "hard" ARC errors, not warnings. rdar://11691437 llvm-svn: 158781
* Structured comment parsing, first step.Dmitri Gribenko2012-06-201-1/+1
| | | | | | | | | * Retain comments in the AST * Serialize/deserialize comments * Find comments attached to a certain Decl * Expose raw comment text and SourceRange via libclang llvm-svn: 158771
* Insert a space if necessary when suggesting CFBridgingRetain/Release.Jordan Rose2012-06-071-9/+16
| | | | | | | | | | | | This was a problem for people who write 'return(result);' Also fix ARCMT's corresponding code, though there's no test case for this because implicit casts like this are rejected by the migrator for being ambiguous, and explicit casts have no problem. <rdar://problem/11577346> llvm-svn: 158130
* [arcmt] At an unbridged cast error, if we're returning a load-of-ivar from a ↵Argyrios Kyrtzidis2012-06-075-7/+32
| | | | | | | | | | +0 method, automatically insert a __bridge cast. radar://11560638 llvm-svn: 158127
* Revert Decl's iterators back to pointer value_type rather than reference ↵David Blaikie2012-06-062-3/+3
| | | | | | | | | | | | | | value_type In addition, I've made the pointer and reference typedef 'void' rather than T* just so they can't get misused. I would've omitted them entirely but std::distance likes them to be there even if it doesn't use them. This rolls back r155808 and r155869. Review by Doug Gregor incorporating feedback from Chandler Carruth. llvm-svn: 158104
* Remove the last dead private member in clang.Benjamin Kramer2012-06-061-5/+3
| | | | llvm-svn: 158100
* Remove unused private member variables found by clang's new ↵Benjamin Kramer2012-06-063-12/+7
| | | | | | -Wunused-private-field. llvm-svn: 158086
* [arcmt] Use CFBridgingRetain/CFBridgingRelease instead of ↵Argyrios Kyrtzidis2012-06-013-17/+49
| | | | | | | | | | __bridge_retained/__bridge_transfer when migrating. rdar://11569198 llvm-svn: 157785
* [objcmt] Warn when modern objc migrator does not convert a NSNumber message ↵Argyrios Kyrtzidis2012-05-241-0/+1
| | | | | | | | because it requires a cast. rdar://11525138 llvm-svn: 157395
* [arcmt] Remove an unused -autorelease, without failing with error, for thisArgyrios Kyrtzidis2012-05-234-18/+129
| | | | | | | | | | | idiom that is used commonly in setters: [backingValue autorelease]; backingValue = [newValue retain]; // in general a +1 assign rdar://9914061 llvm-svn: 157347
* [arcmt] Revert r156999 "Remove the "it is not safe to remove an unused ↵Argyrios Kyrtzidis2012-05-211-0/+11
| | | | | | | | | | 'autorelease' message" ARC migration error". Per feedback from John this is useful to have in general. llvm-svn: 157198
* [arcmt] Remove the "it is not safe to remove an unused 'autorelease' ↵Argyrios Kyrtzidis2012-05-171-11/+0
| | | | | | | | | | | | | | message" ARC migration error. This is more trouble that it is worth; autoreleasing a value without holding on it is a valid use-case, we should not "punish" correct code for the minority of broken/fragile programs that depend on the behavior of -autorelease. rdar://9914061 llvm-svn: 156999
OpenPOWER on IntegriCloud