From c5792aa90fa45a1842f190c146f19e2c71ea6fbd Mon Sep 17 00:00:00 2001 From: Akira Hatanaka Date: Wed, 27 Feb 2019 18:17:16 +0000 Subject: 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 --- clang/lib/AST/Decl.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clang/lib/AST/Decl.cpp') 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 NewParamInfo) { -- cgit v1.2.3