]> granicus.if.org Git - clang/commitdiff
Pass the CodeGenModule object to GenerateBlockFunction, instead of *this (which will...
authorAnders Carlsson <andersca@mac.com>
Tue, 24 Feb 2009 04:19:41 +0000 (04:19 +0000)
committerAnders Carlsson <andersca@mac.com>
Tue, 24 Feb 2009 04:19:41 +0000 (04:19 +0000)
Also, since we're creating a new CodeGenFunction object for each block function, we don't need to clear the BreakContinueStack.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65371 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGBlocks.cpp

index 5c09e4b2d55eeaf958ff9e80bcb37430a9dbbe67..163046ee589c5ebd2801cccdbd44e0905374ee25 100644 (file)
@@ -154,7 +154,7 @@ llvm::Constant *CodeGenFunction::BuildBlockLiteralTmp(const BlockExpr *BE) {
     BlockInfo Info(0, Name);
     uint64_t subBlockSize;
     llvm::Function *Fn
-      = CodeGenFunction(*this).GenerateBlockFunction(BE, Info, subBlockSize);
+      = CodeGenFunction(CGM).GenerateBlockFunction(BE, Info, subBlockSize);
     Elts.push_back(Fn);
 
     // __descriptor
@@ -412,11 +412,6 @@ llvm::Function *CodeGenFunction::GenerateBlockFunction(const BlockExpr *Expr,
 
   const BlockDecl *BD = Expr->getBlockDecl();
 
-  // FIXME: there are tons of variables in CGF that are copied, we probably
-  // don't want many of them, any of them.  When we trim that, this can go away.
-  // Help ensure no control flow in or out of the block.
-  BreakContinueStack.clear();
-
   // FIXME: This leaks
   ImplicitParamDecl *SelfDecl =
     ImplicitParamDecl::Create(getContext(), 0,