llvm-project/clang/lib/ARCMigrate
John McCall 460ce58fa6 Define weak and __weak to mean ARC-style weak references, even in MRC.
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
2015-10-22 18:38:17 +00:00
..
ARCMT.cpp Define weak and __weak to mean ARC-style weak references, even in MRC. 2015-10-22 18:38:17 +00:00
ARCMTActions.cpp Introduce a PCHContainerOperations interface (NFC). 2015-06-20 18:53:08 +00:00
CMakeLists.txt Make clang's rewrite engine a core feature 2014-07-16 16:48:33 +00:00
FileRemapper.cpp Fix a small bug in clang where generating some temporary files would have an extra period before the extension. 2015-09-09 16:48:47 +00:00
Internals.h Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or just letting them be implicitly created. 2014-08-27 06:28:36 +00:00
Makefile
ObjCMT.cpp Replace double negation of !FileID.isInvalid() with FileID.isValid(). 2015-10-03 10:46:20 +00:00
PlistReporter.cpp Fix layering violation: include/clang/Basic/PlistSupport.h should not include 2015-01-28 20:14:54 +00:00
TransAPIUses.cpp [modules] Stop trying to fake up a linear MacroDirective history. 2015-04-29 23:20:19 +00:00
TransARCAssign.cpp s/tranform/transform/ 2012-11-14 15:08:31 +00:00
TransAutoreleasePool.cpp Revert r240270 ("Fixed/added namespace ending comments using clang-tidy"). 2015-06-22 23:07:51 +00:00
TransBlockObjCVariable.cpp [C++11] Replacing BlockDecl iterators capture_begin() and capture_end() with iterator_range captures(). Updating all of the usages of the iterators with range-based for loops. 2014-03-14 18:34:04 +00:00
TransEmptyStatementsAndDealloc.cpp [C++11] Use 'nullptr'. 2014-05-07 06:21:57 +00:00
TransGCAttrs.cpp [C++11] Use 'nullptr'. 2014-05-07 06:21:57 +00:00
TransGCCalls.cpp Get ARCMT/GC-check-warn-nsalloc.m working 2014-05-19 22:51:11 +00:00
TransProperties.cpp [C++11] Use 'nullptr'. 2014-05-07 06:21:57 +00:00
TransProtectedScope.cpp [C++11] Use 'nullptr'. 2014-05-07 06:21:57 +00:00
TransRetainReleaseDealloc.cpp [AST] Remove StmtRange in favor of an iterator_range. 2015-07-18 17:09:36 +00:00
TransUnbridgedCasts.cpp [C++11] Use 'nullptr'. 2014-05-07 06:21:57 +00:00
TransUnusedInitDelegate.cpp [modules] Stop trying to fake up a linear MacroDirective history. 2015-04-29 23:20:19 +00:00
TransZeroOutPropsInDealloc.cpp [C++11] Use 'nullptr'. 2014-05-07 06:21:57 +00:00
TransformActions.cpp Roll-back r250822. 2015-10-20 13:23:58 +00:00
Transforms.cpp Define weak and __weak to mean ARC-style weak references, even in MRC. 2015-10-22 18:38:17 +00:00
Transforms.h [modules] Stop trying to fake up a linear MacroDirective history. 2015-04-29 23:20:19 +00:00