aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGClass.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-03-01 04:01:32 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-03-01 04:01:32 +0000
commit23f0267e2d56c0407f12e62df3561ecf75d74e6e (patch)
treef6e536907913aaa1fa958f250092fefd74cb7d4c /lib/CodeGen/CGClass.cpp
parent5e4e58b805e0e03a669aa517d1d20d4735a3192e (diff)
Implement "optimization" for lambda-to-block conversion which inlines the generated block literal for lambdas which are immediately converted to block pointer type. This simplifies the AST, avoids an unnecessary copy of the lambda and makes it much easier to avoid copying the result onto the heap.
Note that this transformation has a substantial semantic effect outside of ARC: it gives the converted lambda lifetime semantics similar to a block literal. With ARC, the effect is much less obvious because the lifetime of blocks is already managed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151797 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGClass.cpp')
-rw-r--r--lib/CodeGen/CGClass.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/lib/CodeGen/CGClass.cpp b/lib/CodeGen/CGClass.cpp
index e3b5777387..6b5a149710 100644
--- a/lib/CodeGen/CGClass.cpp
+++ b/lib/CodeGen/CGClass.cpp
@@ -1795,9 +1795,7 @@ void CodeGenFunction::EmitLambdaToBlockPointerBody(FunctionArgList &Args) {
return;
}
- InLambdaConversionToBlock = true;
EmitFunctionBody(Args);
- InLambdaConversionToBlock = false;
}
void CodeGenFunction::EmitLambdaDelegatingInvokeBody(const CXXMethodDecl *MD) {