]> granicus.if.org Git - clang/commitdiff
Use RAII object for cleanups.
authorEli Friedman <eli.friedman@gmail.com>
Thu, 9 Feb 2012 03:47:20 +0000 (03:47 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Thu, 9 Feb 2012 03:47:20 +0000 (03:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150147 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExprCXX.cpp

index b049e024034ca45e7a3d8a63bc4629c15a105f49..673c9442e05fd2c310df8f5947dbaeb12d1addcf 100644 (file)
@@ -1784,7 +1784,8 @@ namespace {
 }
 
 void CodeGenFunction::EmitLambdaExpr(const LambdaExpr *E, AggValueSlot Slot) {
-  EHScopeStack::stable_iterator CleanupDepth = EHStack.stable_begin();
+  RunCleanupsScope Scope(*this);
+
   CXXRecordDecl::field_iterator CurField = E->getLambdaClass()->field_begin();
   for (LambdaExpr::capture_init_iterator i = E->capture_init_begin(),
                                          e = E->capture_init_end();
@@ -1809,5 +1810,4 @@ void CodeGenFunction::EmitLambdaExpr(const LambdaExpr *E, AggValueSlot Slot) {
                                                 RD->getDestructor(),
                                                 Slot.getAddr());
   }
-  PopCleanupBlocks(CleanupDepth);
 }