summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@apple.com>2019-02-27 18:17:16 +0000
committerAkira Hatanaka <ahatanaka@apple.com>2019-02-27 18:17:16 +0000
commitc5792aa90fa45a1842f190c146f19e2c71ea6fbd (patch)
tree3b0e58ac909124579b2391ffd93e404edea8dc6e /clang/lib/AST/Decl.cpp
parent69bec61998c702f790cf5c9f17a3a4a086bd5804 (diff)
downloadbcm5719-llvm-c5792aa90fa45a1842f190c146f19e2c71ea6fbd.tar.gz
bcm5719-llvm-c5792aa90fa45a1842f190c146f19e2c71ea6fbd.zip
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
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r--clang/lib/AST/Decl.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index 4f49bd79878..78501f5e3a9 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -4265,6 +4265,7 @@ BlockDecl::BlockDecl(DeclContext *DC, SourceLocation CaretLoc)
setBlockMissingReturnType(true);
setIsConversionFromLambda(false);
setDoesNotEscape(false);
+ setCanAvoidCopyToHeap(false);
}
void BlockDecl::setParams(ArrayRef<ParmVarDecl *> NewParamInfo) {
OpenPOWER on IntegriCloud