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 [Sema][ObjC] Look for either objc_bridge or objc_bridge_mutable when 2017-10-24 23:38:14 +00:00
NSString-type.mm
abstract-class-type-ivar.mm
arc-0x.mm
arc-bool-conversion.mm
arc-bridged-cast.mm [Sema][ObjC] Check whether a variable has a definition, rather than 2017-04-11 22:01:33 +00:00
arc-libstdcxx.mm
arc-memfunc.mm
arc-nsconsumed-errors.mm Improve some infrastructure for extended parameter infos and 2016-03-03 00:10:03 +00:00
arc-objc-lifetime.mm
arc-overloading.mm Reusing an existing attribute diagnostic 2017-05-03 14:05:00 +00:00
arc-ppe.mm Adding a -Wunused-value warning for expressions with side effects used in an unevaluated expression context, such as sizeof(), or decltype(). Also adds a similar warning when the expression passed to typeid() *is* evaluated, since it is equally likely that the user would expect the expression operand to be unevaluated in that case. 2014-12-17 21:57:17 +00:00
arc-ptr-comparison.mm [ARC][ObjC++] Use ObjC semantic rules for comparisons between a pointer and 2017-03-30 13:48:33 +00:00
arc-system-header.mm [test] Make Lit tests C++11 Compatible - Objective-C++ 2017-02-13 23:09:56 +00:00
arc-templates.mm Print nested name specifiers for typedefs and type aliases 2017-03-10 15:04:58 +00:00
arc-type-conversion.mm Some minor ARC diagnostic improvements. 2015-10-21 18:06:38 +00:00
arc-type-traits.mm
arc-unavailable-for-weakref.mm [Objective-C] Fix "weak-unavailable" warning with -fobjc-weak 2017-03-29 18:09:02 +00:00
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 [Sema] Remove assert in TreeTransform<Derived>::TransformObjCObjectType. 2016-02-25 07:08:33 +00:00
block-cleanup.mm Re-commit r321223, which adds a printing policy to the ASTDumper. 2017-12-21 21:42:42 +00:00
block-for-lambda-conversion.mm ObjCXX: fix a crash during typo correction. 2016-02-02 22:23:03 +00:00
block-variable-move.mm [ObjC++] Don't warn about pessimizing move for __block variables 2017-11-07 21:40:11 +00:00
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 [ObjC++] Don't enter a C++ declarator scope when the current context is 2016-12-07 10:24:44 +00:00
cstyle-block-pointer-cast.mm
cstyle-cast.mm
cxx1y-lambda.mm Perform Objective-C lifetime adjustments before comparing deduced lambda result types. 2015-10-01 20:20:47 +00:00
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 Add a new frontend warning for referencing members from the handler of a constructor or destructor function-try-block, which is UB in C++. 2015-09-01 14:49:24 +00:00
dllexport.mm Sema: support __declspec(dll*) on ObjC interfaces 2016-07-15 20:41:10 +00:00
dllimport.mm Sema: support __declspec(dll*) on ObjC interfaces 2016-07-15 20:41:10 +00:00
exceptions-fragile.mm
exceptions.mm [Sema] Be consistent about diagnostic wording: always use "cannot". 2015-08-15 15:23:14 +00:00
expr-objcxx.mm
flexible-array.mm [Sema] Add support for flexible array members in Obj-C. 2017-10-23 22:01:41 +00:00
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 Obj-C: Fix assert-on-invalid (PR27822) 2016-06-03 16:59:13 +00:00
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 Fix errored return value in CheckFunctionReturnType and add a fixit hint 2017-05-10 20:03:16 +00:00
is-base-of.mm [Sema] Objective-C++ support for type trait __is_base_of 2017-05-10 17:18:56 +00:00
ivar-construct.mm [test] Make Lit tests C++11 Compatible - Objective-C++ 2017-02-13 23:09:56 +00:00
ivar-lookup.mm
ivar-reference-type.mm
ivar-struct.mm
linkage-spec.mm
lit.local.cfg
literals.mm
message.mm [Lit Test] Updated 20 Lit tests to be C++11 compatible. 2015-12-10 01:07:17 +00:00
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 DR583, DR1512: Implement a rewrite to C++'s 'composite pointer type' rules. 2016-10-21 22:00:42 +00:00
nullability-completeness-cferror.mm [Sema][ObjC] Look for either objc_bridge or objc_bridge_mutable when 2017-10-24 23:38:14 +00:00
nullability-consistency-arrays.mm Warn when 'assume_nonnull' infers nullability within an array. 2016-11-10 23:28:30 +00:00
nullability-consistency.mm Replace __double_underscored type nullability qualifiers with _Uppercase_underscored 2015-06-24 22:02:08 +00:00
nullability-pragmas.mm Substitute type arguments into uses of Objective-C interface members. 2015-07-07 03:57:53 +00:00
nullptr.mm
objc-boxed-expressions-nsvalue.mm Cleanup ObjCInterfaceDecl lookup for ObjC literals 2015-07-24 05:09:40 +00:00
objc-container-subscripting.mm
objc-decls-inside-namespace.mm
objc-extern-c.mm
objc-pointer-conv.mm
objc-weak-type-traits.mm [Objective-C] Fix __weak type traits with -fobjc-weak 2017-03-29 17:40:35 +00:00
objc-weak.mm [Objective-C] Miscellaneous -fobjc-weak Fixes 2017-03-29 18:16:38 +00:00
objc2-merge-gc-attribue-decl.mm [Sema] Emit a better diagnostic when variable redeclarations disagree 2015-07-14 20:08:49 +00:00
objcbridge-attribute-arc.mm [Objective-C Sema] Fixes a typo which did not allow 2015-04-10 22:07:47 +00:00
objcbridge-attribute.mm [Objective-C Sema] Fixes a typo which did not allow 2015-04-10 22:07:47 +00:00
objcbridge-related-attribute.mm
objcbridge-static-cast.mm [Objective-C Sema] Fixes a typo which did not allow 2015-04-10 22:07:47 +00:00
old-style-cast.mm
overload-gc.mm
overload.mm [ObjC++] Conversions from specialized to non-specialized Objective-C generic 2017-04-06 13:06:34 +00:00
parameterized_classes.mm Handle Objective-C type arguments. 2015-07-07 03:57:35 +00:00
parameterized_classes_arc.mm Forbid qualifiers on ObjC generic parameters and arguments, but 2015-09-23 22:14:21 +00:00
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 Sema: protect against ObjC++ typo-correction failure 2017-04-20 22:23:10 +00:00
propert-dot-error.mm Update error message text. 2015-01-18 19:05:48 +00:00
properties.mm
property-invalid-type.mm Stop back-patching 'readonly' Objective-C properties with 'readwrite' ones. 2015-11-03 01:15:46 +00:00
property-reference.mm
property-synthesis-error.mm
property-type-mismatch.mm Objective-C properties: fix bogus use of "isa<>" on a QualType. 2015-12-08 22:45:17 +00:00
protocol-lookup.mm
pseudo-destructor.mm Allow pseudo-destructor calls on forward-declared Objective-C class pointers. 2015-12-14 19:12:54 +00:00
references.mm
reinterpret-cast-objc-pointertype.mm
related-result-type-inference.mm
reserved-keyword-methods.mm
sel-address.mm Don't crash when passing &@selector to a _Nonnull parameter. Fixes PR24774. 2015-09-15 23:17:17 +00:00
standard-conversion-to-bool.mm
static-cast.mm
synchronized.mm Allow @synchronized to contextually convert a C++ object to an ObjC object pointer. 2014-08-12 16:20:36 +00:00
typeloc-data-alignment.mm [Sema] Fix bug in TypeLocBuilder::pushImpl 2016-02-18 21:05:09 +00:00
typo-correction.mm Typo correct the condition of 'do-while' before exiting its scope 2017-10-30 22:55:11 +00:00
unknown-anytype.mm
vararg-non-pod.mm [Lit Test] Updated 26 Lit tests to be C++11 compatible. 2015-11-11 19:34:47 +00:00
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