hanchenye-llvm-project/clang/test/SemaObjCXX
Akira Hatanaka 8e57b07f66 Distinguish `__block` variables that are captured by escaping blocks
from those that aren't.

This patch changes the way __block variables that aren't captured by
escaping blocks are handled:

- Since non-escaping blocks on the stack never get copied to the heap
  (see https://reviews.llvm.org/D49303), Sema shouldn't error out when
  the type of a non-escaping __block variable doesn't have an accessible
  copy constructor.

- IRGen doesn't have to use the specialized byref structure (see
  https://clang.llvm.org/docs/Block-ABI-Apple.html#id8) for a
  non-escaping __block variable anymore. Instead IRGen can emit the
  variable as a normal variable and copy the reference to the block
  literal. Byref copy/dispose helpers aren't needed either.

This reapplies r343518 after fixing a use-after-free bug in function
Sema::ActOnBlockStmtExpr where the BlockScopeInfo was dereferenced after
it was popped and deleted.

rdar://problem/39352313

Differential Revision: https://reviews.llvm.org/D51564

llvm-svn: 343542
2018-10-01 21:51:28 +00:00
..
Inputs
NSString-type.mm
abstract-class-type-ivar.mm
arc-0x.mm
arc-bool-conversion.mm
arc-bridged-cast.mm
arc-libstdcxx.mm
arc-memfunc.mm
arc-nsconsumed-errors.mm
arc-objc-lifetime.mm
arc-overloading.mm
arc-ppe.mm
arc-ptr-comparison.mm
arc-system-header.mm
arc-templates.mm
arc-type-conversion.mm
arc-type-traits.mm
arc-unavailable-for-weakref.mm
arc-unbridged-cast.mm
argument-dependent-lookup.mm
attr-trivial-abi.mm [Sema] Produce diagnostics for attribute 'trivial_abi' that appears 2018-06-19 05:04:44 +00:00
base-type-as-written.mm
block-cleanup.mm
block-for-lambda-conversion.mm
block-variable-move.mm
blocks.mm Distinguish `__block` variables that are captured by escaping blocks 2018-10-01 21:51:28 +00:00
boxing-illegal-types.mm
capturing-flexible-array-in-block.mm
category-lookup.mm
class-templ-error-null-init.mm [Sema] Relax a failing assert in TemplateArgumentLoc 2018-07-31 00:18:30 +00:00
composite-objc-pointertype.mm
conditional-expr.mm
const-cast.mm
contextual-convert-to-id.mm
conversion-ranking.mm
conversion-to-objc-pointer-2.mm
conversion-to-objc-pointer.mm
crash.mm
cstyle-block-pointer-cast.mm
cstyle-cast.mm
cxx1y-lambda.mm
cxxoperator-selector.mm
debugger-cast-result-to-id.mm
debugger-support.mm
decltype.mm
deduction.mm
delay-parsing-cfunctions.mm
delay-parsing-cplusfuncs.mm
delay-parsing-func-tryblock.mm
dllexport.mm
dllimport.mm
exceptions-fragile.mm
exceptions.mm
expr-objcxx.mm
flexible-array.mm
foreach-block.mm
foreach.mm [cxx2a] P0614R1: Support init-statements in range-based for loops. 2018-09-28 18:44:09 +00:00
format-strings.mm
fragile-abi-object-assign.m
function-pointer-void-star.mm
gc-attributes.mm
goto.mm
instancetype.mm
instantiate-expr.mm
instantiate-message.mm
instantiate-method-return.mm [Sema][ObjC] Ensure that the return type of an ObjC method is a complete 2018-04-12 06:01:41 +00:00
instantiate-property-access.mm
instantiate-stmt.mm
interface-return-type.mm
is-base-of.mm
ivar-construct.mm
ivar-lookup.mm
ivar-reference-type.mm
ivar-struct.mm
linkage-spec.mm
lit.local.cfg
literals.mm
message.mm
microsoft-abi-byval.mm
missing-lhs-gun-extension.mm
namespace-lookup.mm
noescape.mm Distinguish `__block` variables that are captured by escaping blocks 2018-10-01 21:51:28 +00:00
null_objc_pointer.mm
nullability-completeness-cferror.mm
nullability-consistency-arrays.mm
nullability-consistency.mm
nullability-pragmas.mm
nullptr.mm
objc-boxed-expressions-nsvalue.mm
objc-container-subscripting.mm
objc-decls-inside-namespace.mm
objc-extern-c.mm
objc-pointer-conv.mm
objc-weak-type-traits.mm
objc-weak.mm
objc2-merge-gc-attribue-decl.mm
objcbridge-attribute-arc.mm
objcbridge-attribute.mm
objcbridge-related-attribute.mm
objcbridge-static-cast.mm
old-style-cast.mm
overload-gc.mm
overload.mm
parameterized_classes.mm
parameterized_classes_arc.mm
parameterized_classes_subst.mm Improve diagnostics and error recovery for template name lookup. 2018-05-11 02:43:08 +00:00
parameters.mm
pointer-to-objc-pointer-conv.mm
pr32725.mm
propert-dot-error.mm
properties.mm
property-invalid-type.mm
property-reference.mm
property-synthesis-error.mm
property-type-mismatch.mm
protocol-lookup.mm
pseudo-destructor.mm
references.mm
reinterpret-cast-objc-pointertype.mm
related-result-type-inference.mm
reserved-keyword-methods.mm
sel-address.mm
standard-conversion-to-bool.mm
static-cast.mm
synchronized.mm
typeloc-data-alignment.mm
typo-correction.mm
unknown-anytype.mm
vararg-non-pod.mm
vla.mm
void_to_obj.mm
warn-missing-super.mm
warn-objc-literal-conversion.mm
warn-strict-selector-match.mm
warn-thread-safety-analysis.mm Thread safety analysis: Handle ObjCIvarRefExpr in SExprBuilder::translate 2018-09-19 23:57:38 +00:00