aboutsummaryrefslogtreecommitdiff
path: root/lib/ARCMigrate
AgeCommit message (Collapse)Author
2012-11-14s/tranform/transform/Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167929 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-09Remove old driver code to grab the iOS simulator version from the -D option.Bob Wilson
We can now rely on the -mios-simulator-version-min command line option and remove the awful hack. <rdar://problem/10304510> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167603 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24Move PreprocessorOptions into the Lex library, and make it intrusivelyDouglas Gregor
reference-counted. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166587 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-23Use a .def file for most of the diagnostic options.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166520 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-23Make DiagnosticOptions intrusively reference-counted, and make sureDouglas Gregor
the various stakeholders bump up the reference count. In particular, the diagnostics engine now keeps the DiagnosticOptions object alive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166508 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-01Split library clangRewrite into clangRewriteCore and clangRewriteFrontend.Ted Kremenek
This is similar to how we divide up the StaticAnalyzer libraries to separate core functionality to what is clearly associated with Frontend actions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163050 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-31Fixed invalid iterators. Since the iterator is invalidated after the erase() ↵Joao Matos
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163007 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-23Fix undefined behavior: member function calls where 'this' is a null pointer.Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162430 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-21Screw around with ObjCRuntime some more, changing theJohn McCall
diagnostics for bad deployment targets and adding a few more predicates. Includes a patch by Jonathan Schleifer to enable ARC for ObjFW. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162252 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-10Update VerifyDiagnosticConsumer to only get directives during parsing.Jordan Rose
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161650 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-27clang/lib: [CMake] Update tblgen'd dependencies.NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160851 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-27clang/lib: [CMake] Reformat, alphabetize lists.NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160850 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-23Fix a typo (the the => the)Sylvestre Ledru
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160622 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-06Implement AST classes for comments, a real parser for Doxygen comments and aDmitri Gribenko
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159790 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-04Drop the ASTContext.h include from DeclFriend.h and DeclTemplate.h.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159723 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-04Drop the ASTContext.h include from Stmt.h and fix up transitive users.Benjamin Kramer
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159718 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-21Remove a goofy CMake hack and use the standard CMake facilities toChandler Carruth
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158888 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-20[arcmt]Argyrios Kyrtzidis
-Disable -pedantic-errors when migrating per Jordan's suggestion. -Use llvm_move() per John's suggestion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158785 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-20[arcmt] When migrating to ARC disable -Werror so as to only block migrationArgyrios Kyrtzidis
for "hard" ARC errors, not warnings. rdar://11691437 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158781 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-20Structured comment parsing, first step.Dmitri Gribenko
* Retain comments in the AST * Serialize/deserialize comments * Find comments attached to a certain Decl * Expose raw comment text and SourceRange via libclang git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158771 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-07Insert a space if necessary when suggesting CFBridgingRetain/Release.Jordan Rose
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> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158130 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-07[arcmt] At an unbridged cast error, if we're returning a load-of-ivar from a ↵Argyrios Kyrtzidis
+0 method, automatically insert a __bridge cast. radar://11560638 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158127 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-06Revert Decl's iterators back to pointer value_type rather than reference ↵David Blaikie
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158104 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-06Remove the last dead private member in clang.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158100 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-06Remove unused private member variables found by clang's new ↵Benjamin Kramer
-Wunused-private-field. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158086 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-01[arcmt] Use CFBridgingRetain/CFBridgingRelease instead of ↵Argyrios Kyrtzidis
__bridge_retained/__bridge_transfer when migrating. rdar://11569198 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157785 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-24[objcmt] Warn when modern objc migrator does not convert a NSNumber message ↵Argyrios Kyrtzidis
because it requires a cast. rdar://11525138 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157395 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-23[arcmt] Remove an unused -autorelease, without failing with error, for thisArgyrios Kyrtzidis
idiom that is used commonly in setters: [backingValue autorelease]; backingValue = [newValue retain]; // in general a +1 assign rdar://9914061 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157347 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-21[arcmt] Revert r156999 "Remove the "it is not safe to remove an unused ↵Argyrios Kyrtzidis
'autorelease' message" ARC migration error". Per feedback from John this is useful to have in general. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157198 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-17[arcmt] Remove the "it is not safe to remove an unused 'autorelease' ↵Argyrios Kyrtzidis
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156999 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-01Fix use of uninitialized variable caught by GCC's -Wmaybe-uninitialized.David Blaikie
Review by Doug Gregor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155880 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-01Remove ref/value inconsistency in redecl_iterator.David Blaikie
Similar to r155808 - this mistake has been made in a few iterators. Based on Chandler Carruth's feedback to r155808 I added an implicit conversion to Decl* to ease adoption/usage. Useful for the pointer comparison, but not the dyn_cast (due to template argument deduction causing the conversion not to be used) - there for future convenience, though. This idiom (op T* for iterators) seems to be fairly idiomatic within the LLVM codebase & I'll likely add it as I fix up the other iterators here. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155869 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-30Remove the ref/value inconsistency in filter_decl_iterator.David Blaikie
filter_decl_iterator had a weird mismatch where both op* and op-> returned T* making it difficult to generalize this filtering behavior into a reusable library of any kind. This change errs on the side of value, making op-> return T* and op* return T&. (reviewed by Richard Smith) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155808 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-31[arcmt] When fixing the "unassigned init call" ARC error, make sureArgyrios Kyrtzidis
to do a nil check for the result of the call. rdar://10950973 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153793 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-29[arcmt] Fix a bug where a property in a class extension, that did not existArgyrios Kyrtzidis
in the interface, got its attribute rewritten twice, resulting in 'weakweak' or 'strongstrong'. rdar://11047179 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153621 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-24Simplify some users of DenseMap::erase.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153389 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-17Kill cocoa::deriveNamingConvention and cocoa::followsFundamentalRule. They ↵Jordy Rose
are now just simple wrappers around method families, and method decls can cache method family lookups. Also, no one is using them right now. The one difference between ObjCMethodDecl::getMethodFamily and Selector::getMethodFamily is that the former will do some additional sanity checking, and since CoreFoundation types don't look like Objective-C objects, an otherwise interesting method will get a method family of OMF_None. Future clients that use method families should consider how they want to handle CF types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153000 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-16[arcmt] The hard-coded list of weak-incompatible classes is no longer necessary.Argyrios Kyrtzidis
rdar://10673816 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152879 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-16[arcmt] iOS is always safe to use 'weak'. rdar://10950825Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152878 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-11Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie
(Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152536 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-10Remove BlockDeclRefExpr and introduce a bit on DeclRefExpr toJohn McCall
track whether the referenced declaration comes from an enclosing local context. I'm amenable to suggestions about the exact meaning of this bit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152491 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-06Add new code migrator support for migrating existing Objective-C code to useTed Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152141 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-05[arcmt]Argyrios Kyrtzidis
-Make sure we don't change to '__weak' a __block variable used as output. -Make sure we don't apply __weak twice. Fixes rdar://10520757&10521362 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152020 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-01Move llvm/ADT/SaveAndRestore.h -> llvm/Support/SaveAndRestore.h.Argyrios Kyrtzidis
Needs llvm update. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151829 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-27Move "clang/Analysis/Support/SaveAndRestore.h" to "llvm/ADT/SaveAndRestore.h"Argyrios Kyrtzidis
to make it more widely available. Depends on llvm commit r151564 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151566 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-25[arcmt] GC migrator: don't try to remove redundant __strong, it doesArgyrios Kyrtzidis
more harm than good. Fixes rdar://10522805&10521433 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151424 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20Basic: import IntrusiveRefCntPtr<> into clang namespaceDylan Noblesmith
The class name is long enough without the llvm:: added. Also bring in RefCountedBase and RefCountedBaseVPTR. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150958 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05Basic: import SmallString<> into clang namespaceDylan Noblesmith
(I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149799 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05Basic: import OwningPtr<> into clang namespaceDylan Noblesmith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149798 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04Move a method from IdentifierTable.h out of line and remove the SmallString ↵Benjamin Kramer
include. Fix all the transitive include users. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149783 91177308-0d34-0410-b5e6-96231b3b80d8