summaryrefslogtreecommitdiffstats
path: root/clang/lib/ARCMigrate
Commit message (Collapse)AuthorAgeFilesLines
...
* [objcmt] Don't add an #import of Foundation unnecessarily, if the NS_ENUM ↵Argyrios Kyrtzidis2016-07-151-0/+5
| | | | | | macro is already defined. llvm-svn: 275589
* Apply clang-tidy's misc-move-constructor-init throughout Clang.Benjamin Kramer2016-05-271-2/+3
| | | | | | No functionality change intended, maybe a tiny performance improvement. llvm-svn: 270996
* Fix some Clang-tidy readability-redundant-control-flow warnings; other minor ↵Eugene Zelenko2016-02-101-11/+7
| | | | | | | | fixes. Differential revision: http://reviews.llvm.org/D17060 llvm-svn: 260414
* [Frontend] Make the memory management of FrontendAction pointers explicit by ↵Argyrios Kyrtzidis2016-02-072-8/+9
| | | | | | using unique_ptr. llvm-svn: 260048
* Class Property: class property and instance property can have the same name.Manman Ren2016-01-281-1/+2
| | | | | | | | | | | | | | | | | | | Add "enum ObjCPropertyQueryKind" to a few APIs that used to only take the name of the property: ObjCPropertyDecl::findPropertyDecl, ObjCContainerDecl::FindPropertyDeclaration, ObjCInterfaceDecl::FindPropertyVisibleInPrimaryClass, ObjCImplDecl::FindPropertyImplDecl, and Sema::ActOnPropertyImplDecl. ObjCPropertyQueryKind currently has 3 values: OBJC_PR_query_unknown, OBJC_PR_query_instance, OBJC_PR_query_class This extra parameter specifies that we are looking for an instance property with the given name, or a class property with the given name, or any property with the given name (if both exist, the instance property will be returned). rdar://23891898 llvm-svn: 259070
* Remove autoconf supportChris Bieneman2016-01-261-18/+0
| | | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "This is the way [autoconf] ends Not with a bang but a whimper." -T.S. Eliot Reviewers: chandlerc, grosbach, bob.wilson, echristo Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D16472 llvm-svn: 258862
* Use instance_properties instead of properties. NFC.Manman Ren2016-01-262-3/+3
| | | | | | | | | | | All current properties are instance properties. This is the second patch in a series of patches to support class properties in addition to instance properties in objective-c. rdar://23891898 llvm-svn: 258824
* Fix funciton->function typo.Eric Christopher2015-12-161-2/+2
| | | | llvm-svn: 255840
* Refactor: Simplify boolean conditional return statements in lib/ARCMigrateAlexander Kornienko2015-11-065-47/+18
| | | | | | | | Patch by Richard Thomson! (+a couple of modifications to address comments) Differential revision: http://reviews.llvm.org/D10009 llvm-svn: 252261
* Stop back-patching 'readonly' Objective-C properties with 'readwrite' ones.Douglas Gregor2015-11-031-22/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | A 'readonly' Objective-C property declared in the primary class can effectively be shadowed by a 'readwrite' property declared within an extension of that class, so long as the types and attributes of the two property declarations are compatible. Previously, this functionality was implemented by back-patching the original 'readonly' property to make it 'readwrite', destroying source information and causing some hideously redundant, incorrect code. Simplify the implementation to express how this should actually be modeled: as a separate property declaration in the extension that shadows (via the name lookup rules) the declaration in the primary class. While here, correct some broken Fix-Its, eliminate a pile of redundant code, clean up the ARC migrator's handling of properties declared in extensions, and fix debug info's naming of methods that come from categories. A wonderous side effect of doing this write is that it eliminates the "AddedObjCPropertyInClassExtension" method from the AST mutation listener, which in turn eliminates the last place where we rewrite entire declarations in a chained PCH file or a module file. This change (which fixes rdar://problem/18475765) will allow us to eliminate the rewritten-decls logic from the serialization library, and fixes a crash (rdar://problem/23247794) illustrated by the test/PCH/chain-categories.m example. llvm-svn: 251874
* Watch and TV OS: wire up basic ABI choicesTim Northover2015-10-302-1/+5
| | | | | | | This sets the mostly expected Darwin default ABI options for these two platforms. Active changes from these defaults for watchOS are in a later patch. llvm-svn: 251708
* Define weak and __weak to mean ARC-style weak references, even in MRC.John McCall2015-10-222-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, __weak was silently accepted and ignored in MRC mode. That makes this a potentially source-breaking change that we have to roll out cautiously. Accordingly, for the time being, actual support for __weak references in MRC is experimental, and the compiler will reject attempts to actually form such references. The intent is to eventually enable the feature by default in all non-GC modes. (It is, of course, incompatible with ObjC GC's interpretation of __weak.) If you like, you can enable this feature with -Xclang -fobjc-weak but like any -Xclang option, this option may be removed at any point, e.g. if/when it is eventually enabled by default. This patch also enables the use of the ARC __unsafe_unretained qualifier in MRC. Unlike __weak, this is being enabled immediately. Since variables are essentially __unsafe_unretained by default in MRC, the only practical uses are (1) communication and (2) changing the default behavior of by-value block capture. As an implementation matter, this means that the ObjC ownership qualifiers may appear in any ObjC language mode, and so this patch removes a number of checks for getLangOpts().ObjCAutoRefCount that were guarding the processing of these qualifiers. I don't expect this to be a significant drain on performance; it may even be faster to just check for these qualifiers directly on a type (since it's probably in a register anyway) than to do N dependent loads to grab the LangOptions. rdar://9674298 llvm-svn: 251041
* Roll-back r250822.Angel Garcia Gomez2015-10-203-3/+3
| | | | | | | | | | Summary: It breaks the build for the ASTMatchers Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D13893 llvm-svn: 250827
* Apply modernize-use-default to clang.Angel Garcia Gomez2015-10-203-3/+3
| | | | | | | | | | | | Summary: Replace empty bodies of default constructors and destructors with '= default'. Reviewers: bkramer, klimek Subscribers: klimek, alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13890 llvm-svn: 250822
* Replace double negation of !FileID.isInvalid() with FileID.isValid().Yaron Keren2015-10-031-3/+3
| | | | | | +couple more of double-negated !SourceLocation.isInvalid() unfixed in r249228. llvm-svn: 249235
* Replace double-negated !SourceLocation.isInvalid() with ↵Yaron Keren2015-10-031-3/+3
| | | | | | SourceLocation.isValid(). llvm-svn: 249228
* Fix a small bug in clang where generating some temporary files would have an ↵Argyrios Kyrtzidis2015-09-092-2/+2
| | | | | | | | extra period before the extension. Patch by Cameron Esfahani! llvm-svn: 247160
* Remove and forbid raw_svector_ostream::flush() calls.Yaron Keren2015-08-132-3/+0
| | | | | | | | | | After r244870 flush() will only compare two null pointers and return, doing nothing but wasting run time. The call is not required any more as the stream and its SmallString are always in sync. Thanks to David Blaikie for reviewing. llvm-svn: 244928
* Use llvm::reverse to make a bunch of loops use foreach. NFC.Pete Cooper2015-07-301-4/+3
| | | | | | | | | | | | | | | | In llvm commit r243581, a reverse range adapter was added which allows us to change code such as for (auto I = Fields.rbegin(), E = Fields.rend(); I != E; ++I) { in to for (const FieldDecl *I : llvm::reverse(Fields)) This commit changes a few of the places in clang which are eligible to use this new adapter. llvm-svn: 243663
* [AST] Remove StmtRange in favor of an iterator_range.Benjamin Kramer2015-07-181-4/+4
| | | | | | | | | StmtRange was just a convenient wrapper for two StmtIterators before we had real range support. This removes some of the implicit conversions StmtRange had leading to slightly more verbose code but also should make more obvious what's going on. No functional change intended. llvm-svn: 242615
* Make the clang module container format selectable from the command line.Adrian Prantl2015-07-171-4/+6
| | | | | | | | | | | | | - introduces a new cc1 option -fmodule-format=[raw,obj] with 'raw' being the default - supports arbitrary module container formats that libclang is agnostic to - adds the format to the module hash to avoid collisions - splits the old PCHContainerOperations into PCHContainerWriter and a PCHContainerReader. Thanks to Richard Smith for reviewing this patch! llvm-svn: 242499
* Switch users of the 'for (StmtRange range = stmt->children(); range; ↵Benjamin Kramer2015-07-021-2/+2
| | | | | | | | | ++range)‘ pattern to range for loops. The pattern was born out of the lack of range-based for loops in C++98 and is somewhat obscure. No functionality change intended. llvm-svn: 241300
* Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko2015-06-223-7/+7
| | | | llvm-svn: 240353
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-223-7/+7
| | | | | | | | | | | | The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. llvm-svn: 240270
* Introduce a PCHContainerOperations interface (NFC).Adrian Prantl2015-06-202-46/+48
| | | | | | | | | | | | | | | | A PCHContainerOperations abstract interface provides operations for creating and unwrapping containers for serialized ASTs (precompiled headers and clang modules). The default implementation is RawPCHContainerOperations, which uses a flat file for the output. The main application for this interface will be an ObjectFilePCHContainerOperations implementation that uses LLVM to wrap the module in an ELF/Mach-O/COFF container to store debug info alongside the AST. rdar://problem/20091852 llvm-svn: 240225
* Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial typesBenjamin Kramer2015-05-291-1/+1
| | | | | | | | | | | | | | | | | | | | If the type isn't trivially moveable emplace can skip a potentially expensive move. It also saves a couple of characters. Call sites were found with the ASTMatcher + some semi-automated cleanup. memberCallExpr( argumentCountIs(1), callee(methodDecl(hasName("push_back"))), on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))), hasArgument(0, bindTemporaryExpr( hasType(recordDecl(hasNonTrivialDestructor())), has(constructExpr()))), unless(isInTemplateInstantiation())) No functional change intended. llvm-svn: 238601
* Switch PPCallbacks to take the new MacroDefinition instead of ↵Richard Smith2015-05-041-1/+1
| | | | | | MacroDirective*, in order to preserve full information on module macro expansion. llvm-svn: 236404
* [modules] Stop trying to fake up a linear MacroDirective history.Richard Smith2015-04-296-31/+25
| | | | | | | | | | | | | | 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
* Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko2015-04-112-5/+3
| | | | | | | | | | | | | | | | | | | | Summary: The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix Reviewers: dblaikie Reviewed By: dblaikie Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D8926 llvm-svn: 234678
* [Objective-C SDK modernizer]. Patch to convert setter/getterFariborz Jahanian2015-04-021-5/+8
| | | | | | | methods in protocols to their respective property declarations. rdar://19372798 llvm-svn: 233977
* [SDK modernizer PATCH]. Fixes a bug whereby a call to superFariborz Jahanian2015-03-231-5/+0
| | | | | | | was not converted to property-dot syntax by removing an unused code. rdar://19140267 llvm-svn: 233019
* [SDK modernizer] Patch to fix type of the typed enums whenFariborz Jahanian2015-03-021-3/+3
| | | | | | migrating to NS_ENUM typedef. rdar://19994496 llvm-svn: 231036
* Cleanup: remove artificial division between lookup results and const lookupRichard Smith2015-02-211-2/+2
| | | | | | | results. No-one was ever modifying a lookup result, and it would not be reasonable to do so. llvm-svn: 230123
* Fix layering violation: include/clang/Basic/PlistSupport.h should not includeRichard Smith2015-01-281-6/+8
| | | | | | files from include/clang/Lex. Clean up module map. llvm-svn: 227361
* Objective-C SDK modernizer to use NS_ENUM/NS_OPTIONS macrosFariborz Jahanian2015-01-261-2/+17
| | | | | | with typed enums. rdar://19352510 llvm-svn: 227104
* Objective-C moderinzer [qoi], add space on rhs when needed whenFariborz Jahanian2015-01-231-0/+4
| | | | | | | converting to property-dot syntax for setters. rdar://19381786 llvm-svn: 226944
* Objective-C modernizer. Avoid using property-dot syntax whenFariborz Jahanian2015-01-231-0/+4
| | | | | | | receiver type is not valid for property-dot syntz use. rdar://19381786 llvm-svn: 226927
* Objective-C SDK modernizer. When modernizing an enum to Fariborz Jahanian2014-12-101-4/+13
| | | | | | | NS_ENUM/NS_OPTIONS use the underlying type if there is no associated type. rdar://19198042 llvm-svn: 223934
* Objective-C SDK modernizer. Modernize to use Fariborz Jahanian2014-12-091-6/+12
| | | | | | | property-dot-syntax when receiver is 'super'. rdar://19140267 llvm-svn: 223846
* clang-format a recent commit I madeDavid Blaikie2014-11-191-1/+1
| | | | llvm-svn: 222317
* Standardize on StringMap::insert, removing uses of StringMap::GetOrCreateValue.David Blaikie2014-11-192-7/+6
| | | | llvm-svn: 222306
* Objective-C SDK modernization tool. Use its own optionFariborz Jahanian2014-10-311-1/+1
| | | | | | | | ,-objcmt-migrate-property-dot-syntax, when migarting to use property-dot syntax in place of messaging expression. rdar://18839124 llvm-svn: 221001
* Objective-C SDK modernization. import Foundation evenFariborz Jahanian2014-10-091-7/+4
| | | | | | | when a previous definition of NS_OPTION is available ; e.g. from a pch. enhancement to rdar://18498550 llvm-svn: 219448
* Objective-C SDK modernization. convert message expression Fariborz Jahanian2014-10-091-0/+105
| | | | | | to Objective-C dot-syntax. rdar://18498572 llvm-svn: 219424
* Objective-C SDK modernization. When modernizing toFariborz Jahanian2014-10-071-7/+25
| | | | | | | | use NS_ENUM/NS_OPTIONS macros, add an import of Foundation.h (or its module) as necessary. rdar://18498550 llvm-svn: 219225
* Objective-C SDK modernizer. Patch to support modernizationFariborz Jahanian2014-10-061-16/+26
| | | | | | | | to NS_ENUM/NS_OPTION macros when typedef names are other than NSInteger/NSUInteger (int8_t, etc.). rdar://18532199 llvm-svn: 219173
* Objective-C Modernizer. Patch to remove dangling spaceFariborz Jahanian2014-10-011-2/+6
| | | | | | | before the semicolon wahen modernizing to use NS_ENUM/NS_OPTIONS macros. rdar://18498539 llvm-svn: 218809
* Objective-C SDK modernizer. Do not modernize an enum Fariborz Jahanian2014-09-151-1/+1
| | | | | | | which already has the underlying interger type specification. // rdar://1826225 llvm-svn: 217783
* Use the simpler version of llvm::sys::fs::exists.Rafael Espindola2014-09-111-6/+2
| | | | | | | In all these cases it looks like the intention was to handle error in a similar way to the file not existing. llvm-svn: 217614
* Unique_ptrify PPCallbacks ownership.Craig Topper2014-09-102-3/+3
| | | | | | Unique_ptr creation stil needs to be moved earlier at some of the call sites. llvm-svn: 217474
OpenPOWER on IntegriCloud