Avoid needlessly copying a block to the heap when a block literal
authorAkira Hatanaka <ahatanaka@apple.com>
Wed, 27 Feb 2019 18:17:16 +0000 (18:17 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Wed, 27 Feb 2019 18:17:16 +0000 (18:17 +0000)
commitc5792aa90fa45a1842f190c146f19e2c71ea6fbd
tree3b0e58ac909124579b2391ffd93e404edea8dc6e
parent69bec61998c702f790cf5c9f17a3a4a086bd5804
Avoid needlessly copying a block to the heap when a block literal
initializes a local auto variable or is assigned to a local auto
variable that is declared in the scope that introduced the block
literal.

rdar://problem/13289333

https://reviews.llvm.org/D58514

llvm-svn: 355012
12 files changed:
clang/include/clang/AST/Decl.h
clang/include/clang/AST/DeclBase.h
clang/lib/AST/Decl.cpp
clang/lib/CodeGen/CGObjC.cpp
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaExpr.cpp
clang/lib/Serialization/ASTReaderDecl.cpp
clang/lib/Serialization/ASTWriterDecl.cpp
clang/test/CodeGenObjC/arc-block-copy-escape.m
clang/test/CodeGenObjC/arc-blocks.m
clang/test/CodeGenObjCXX/arc-blocks.mm
clang/test/PCH/arc-blocks.mm [new file with mode: 0644]