diff options
author | John McCall <rjmccall@apple.com> | 2011-11-10 08:15:53 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-11-10 08:15:53 +0000 |
commit | 1a343ebbf413e8eae6b2737b2b2d79cbf5765571 (patch) | |
tree | f19088ff715fded786ec81b96a04bcceadff0b12 /lib/CodeGen/CGExprComplex.cpp | |
parent | 180f47959a066795cc0f409433023af448bb0328 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144268 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprComplex.cpp')
-rw-r--r-- | lib/CodeGen/CGExprComplex.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExprComplex.cpp b/lib/CodeGen/CGExprComplex.cpp index e62f9a620e..d58db67917 100644 --- a/lib/CodeGen/CGExprComplex.cpp +++ b/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!"); |