From 1a343ebbf413e8eae6b2737b2b2d79cbf5765571 Mon Sep 17 00:00:00 2001 From: John McCall Date: Thu, 10 Nov 2011 08:15:53 +0000 Subject: 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 --- lib/CodeGen/CGExprAgg.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen/CGExprAgg.cpp') diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp index 0fda665963..f3e86fbb44 100644 --- a/lib/CodeGen/CGExprAgg.cpp +++ b/lib/CodeGen/CGExprAgg.cpp @@ -536,7 +536,9 @@ AggExprEmitter::VisitCXXConstructExpr(const CXXConstructExpr *E) { } void AggExprEmitter::VisitExprWithCleanups(ExprWithCleanups *E) { - CGF.EmitExprWithCleanups(E, Dest); + CGF.enterFullExpression(E); + CodeGenFunction::RunCleanupsScope cleanups(CGF); + Visit(E->getSubExpr()); } void AggExprEmitter::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) { -- cgit v1.2.3