hanchenye-llvm-project/clang/test/ARCMT
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
..
Inputs
designated-init-in-header
whitelisted
with space
Common.h
GC-check-warn-nsalloc.m
GC-check.m
GC-no-arc-runtime.m Define weak and __weak to mean ARC-style weak references, even in MRC. 2015-10-22 18:38:17 +00:00
GC-no-arc-runtime.m.result
GC-no-finalize-removal.m
GC-no-finalize-removal.m.result
GC.h
GC.m
GC.m.result
api.m
api.m.result
assign-prop-no-arc-runtime.m
assign-prop-no-arc-runtime.m.result
assign-prop-with-arc-runtime.m
assign-prop-with-arc-runtime.m.result
atautorelease-2.m
atautorelease-2.m.result
atautorelease-3.m
atautorelease-3.m.result
atautorelease-check.m
atautorelease.m
atautorelease.m.result
autoreleases.m
autoreleases.m.result
block_copy_release.m
block_copy_release.m.result
check-api.m
check-with-pch.m Revert "Revert r241620 and follow-up commits" and move the initialization 2015-07-08 01:00:30 +00:00
check-with-serialized-diag.m
checking-in-arc.m
checking.m Some minor ARC diagnostic improvements. 2015-10-21 18:06:38 +00:00
cxx-checking.mm
cxx-rewrite.mm
cxx-rewrite.mm.result
dealloc.m
dealloc.m.result
dispatch.m
dispatch.m.result
driver-migrate.m
init.m
init.m.result
lit.local.cfg
migrate-emit-errors.m
migrate-on-pch-and-module.m Revert "Revert r241620 and follow-up commits" and move the initialization 2015-07-08 01:00:30 +00:00
migrate-plist-output.m
migrate-space-in-path.m
migrate-with-pch.m
migrate.m
no-canceling-bridge-to-bridge-cast.m
nonobjc-to-objc-cast-2.m
nonobjc-to-objc-cast.m Allow (Object *)kMyGlobalCFObj casts without bridging 2015-02-25 20:09:06 +00:00
nonobjc-to-objc-cast.m.result Allow (Object *)kMyGlobalCFObj casts without bridging 2015-02-25 20:09:06 +00:00
objcmt-arc-cf-annotations.m
objcmt-arc-cf-annotations.m.result
objcmt-atomic-property.m
objcmt-atomic-property.m.result
objcmt-boxing.m
objcmt-boxing.m.result
objcmt-designated-initializer.m
objcmt-designated-initializer.m.result
objcmt-instancetype-2.m
objcmt-instancetype-2.m.result
objcmt-instancetype-unnecessary-diff.m
objcmt-instancetype.m
objcmt-instancetype.m.result
objcmt-migrate-all.m
objcmt-migrate-all.m.result
objcmt-ns-macros.m [SDK modernizer] Patch to fix type of the typed enums when 2015-03-02 23:58:02 +00:00
objcmt-ns-macros.m.result [SDK modernizer] Patch to fix type of the typed enums when 2015-03-02 23:58:02 +00:00
objcmt-ns-nonatomic-iosonly.m
objcmt-ns-nonatomic-iosonly.m.result
objcmt-ns-returns-inner-pointer.m
objcmt-ns-returns-inner-pointer.m.result
objcmt-numeric-literals.m
objcmt-numeric-literals.m.result
objcmt-property-availability.m
objcmt-property-availability.m.result
objcmt-property-dot-syntax.m [SDK modernizer PATCH]. Fixes a bug whereby a call to super 2015-03-23 20:52:26 +00:00
objcmt-property-dot-syntax.m.result [SDK modernizer PATCH]. Fixes a bug whereby a call to super 2015-03-23 20:52:26 +00:00
objcmt-property.m [Objective-C SDK modernizer]. Patch to convert setter/getter 2015-04-02 21:36:03 +00:00
objcmt-property.m.result [Objective-C SDK modernizer]. Patch to convert setter/getter 2015-04-02 21:36:03 +00:00
objcmt-protocol-conformance.m
objcmt-protocol-conformance.m.result
objcmt-subscripting-literals-in-arc.m
objcmt-subscripting-literals-in-arc.m.result
objcmt-subscripting-literals.m [Edit] Fix issue with tracking what macro argument inputs have been edited. 2015-09-11 20:09:11 +00:00
objcmt-subscripting-literals.m.result [Edit] Fix issue with tracking what macro argument inputs have been edited. 2015-09-11 20:09:11 +00:00
objcmt-subscripting-unavailable.m
objcmt-subscripting-unavailable.m.result
objcmt-undefined-ns-macros.m Objective-C SDK modernization. When modernizing to 2014-10-07 19:01:46 +00:00
objcmt-undefined-ns-macros.m.result Objective-C SDK modernizer. When modernizing an enum to 2014-12-10 18:25:24 +00:00
objcmt-with-pch.m Revert "Revert r241620 and follow-up commits" and move the initialization 2015-07-08 01:00:30 +00:00
objcmt-with-pch.m.result Revert "Revert r241620 and follow-up commits" and move the initialization 2015-07-08 01:00:30 +00:00
protected-scope.m
protected-scope.m.result
releases-driver.m
releases-driver.m.result
releases.m
releases.m.result
remove-dealloc-method.m
remove-dealloc-method.m.result
remove-dealloc-zerouts.m
remove-dealloc-zerouts.m.result
remove-statements.m
remove-statements.m.result
retains.m
retains.m.result
rewrite-block-var.m
rewrite-block-var.m.result
safe-arc-assign.m
safe-arc-assign.m.result
verify.m
with-arc-mode-modify.m
with-arc-mode-modify.m.result