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
..
2013-12-03 14:06:23 +00:00
2018-02-23 19:30:48 +00:00
2018-02-23 19:30:48 +00:00
2018-02-23 19:30:48 +00:00
2013-12-03 14:16:22 +00:00
2018-05-01 18:50:15 +00:00
2018-02-23 19:30:48 +00:00
2018-02-23 19:30:48 +00:00
2017-08-30 21:31:16 +00:00
2016-12-01 20:16:56 +00:00
2018-02-23 19:30:48 +00:00
2014-05-20 17:12:51 +00:00
2013-11-08 03:06:45 +00:00
2018-03-20 20:42:55 +00:00
2018-02-23 19:30:48 +00:00
2018-02-23 19:30:48 +00:00
2018-02-23 19:30:48 +00:00
2013-08-20 22:01:44 +00:00
2018-02-23 19:30:48 +00:00
2016-07-12 16:56:33 +00:00
2017-09-20 07:22:00 +00:00
2018-02-23 19:30:48 +00:00
2018-02-23 19:30:48 +00:00
2018-02-23 19:30:48 +00:00
2018-02-23 19:30:48 +00:00
2014-09-26 06:28:25 +00:00
2014-12-22 18:13:07 +00:00
2018-02-23 19:30:48 +00:00
2017-08-09 06:07:08 +00:00
2018-05-17 18:34:05 +00:00
2018-02-23 19:30:48 +00:00
2018-03-22 22:57:48 +00:00
2018-02-23 19:30:48 +00:00
2018-02-23 19:30:48 +00:00
2018-02-07 22:15:33 +00:00
2013-08-22 18:45:40 +00:00
2013-12-13 20:49:58 +00:00
2018-02-23 19:30:48 +00:00
2018-02-23 19:30:48 +00:00
2018-02-23 19:30:48 +00:00
2018-02-23 19:30:48 +00:00
2018-02-15 19:12:41 +00:00
2018-02-23 19:30:48 +00:00
2018-02-23 19:30:48 +00:00