summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprComplex.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-11-10 08:15:53 +0000
committerJohn McCall <rjmccall@apple.com>2011-11-10 08:15:53 +0000
commit08ef466048e06328401fd06527b20315902cab19 (patch)
tree01f03a622005ef6cc5d4967c1bbed7623bd3380f /clang/lib/CodeGen/CGExprComplex.cpp
parentd33b2d6b7a7aacb6fe9db39b0b6c529dafba057c (diff)
downloadbcm5719-llvm-08ef466048e06328401fd06527b20315902cab19.tar.gz
bcm5719-llvm-08ef466048e06328401fd06527b20315902cab19.zip
Enter the cleanups for a block outside the enclosing
full-expression. Naturally they're inactive before we enter the block literal expression. This restores the intended behavior that blocks belong to their enclosing scope. There's a useful -O0 / compile-time optimization that we're missing here with activating cleanups following straight-line code from their inactive beginnings. llvm-svn: 144268
Diffstat (limited to 'clang/lib/CodeGen/CGExprComplex.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprComplex.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExprComplex.cpp b/clang/lib/CodeGen/CGExprComplex.cpp
index e62f9a620ea..d58db67917a 100644
--- a/clang/lib/CodeGen/CGExprComplex.cpp
+++ b/clang/lib/CodeGen/CGExprComplex.cpp
@@ -179,7 +179,9 @@ public:
return Visit(DAE->getExpr());
}
ComplexPairTy VisitExprWithCleanups(ExprWithCleanups *E) {
- return CGF.EmitExprWithCleanups(E).getComplexVal();
+ CGF.enterFullExpression(E);
+ CodeGenFunction::RunCleanupsScope Scope(CGF);
+ return Visit(E->getSubExpr());
}
ComplexPairTy VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
assert(E->getType()->isAnyComplexType() && "Expected complex type!");
OpenPOWER on IntegriCloud