From: Mike Stump Date: Wed, 4 Mar 2009 19:03:44 +0000 (+0000) Subject: Move more blocks CodeGenFunction code up and out. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ad75ab414ecdddd193d6f2f0e798e85ad5a07242;p=clang Move more blocks CodeGenFunction code up and out. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66049 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGBlocks.h b/lib/CodeGen/CGBlocks.h index 6c3ca748b9..bef745945f 100644 --- a/lib/CodeGen/CGBlocks.h +++ b/lib/CodeGen/CGBlocks.h @@ -118,10 +118,33 @@ public: support routines */ }; + /// BlockInfo - Information to generate a block literal. + struct BlockInfo { + /// BlockLiteralTy - The type of the block literal. + const llvm::Type *BlockLiteralTy; + + /// Name - the name of the function this block was created for, if any + const char *Name; + + /// ByCopyDeclRefs - Variables from parent scopes that have been imported + /// into this block. + llvm::SmallVector ByCopyDeclRefs; + + // ByRefDeclRefs - __block variables from parent scopes that have been + // imported into this block. + llvm::SmallVector ByRefDeclRefs; + + BlockInfo(const llvm::Type *blt, const char *n) + : BlockLiteralTy(blt), Name(n) {} + }; + CGBuilderTy &Builder; BlockFunction(CGBuilderTy &B) : Builder(B) { } + ImplicitParamDecl *BlockStructDecl; + ImplicitParamDecl *getBlockStructDecl() { return BlockStructDecl; } + llvm::Value *BuildCopyHelper(int flag); llvm::Value *BuildDestroyHelper(int flag); diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index 6455f119c0..dec265aaf9 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -268,34 +268,11 @@ public: llvm::Value *BuildBlockLiteralTmp(const BlockExpr *); llvm::Constant *BuildDescriptorBlockDecl(uint64_t Size); - /// BlockInfo - Information to generate a block literal. - struct BlockInfo { - /// BlockLiteralTy - The type of the block literal. - const llvm::Type *BlockLiteralTy; - - /// Name - the name of the function this block was created for, if any - const char *Name; - - /// ByCopyDeclRefs - Variables from parent scopes that have been imported - /// into this block. - llvm::SmallVector ByCopyDeclRefs; - - // ByRefDeclRefs - __block variables from parent scopes that have been - // imported into this block. - llvm::SmallVector ByRefDeclRefs; - - BlockInfo(const llvm::Type *blt, const char *n) - : BlockLiteralTy(blt), Name(n) {} - }; - llvm::Function *GenerateBlockFunction(const BlockExpr *BExpr, const BlockInfo& Info, uint64_t &Size, uint64_t &Align, llvm::SmallVector &subBlockDeclRefDecls); - ImplicitParamDecl *BlockStructDecl; - - ImplicitParamDecl *getBlockStructDecl() { return BlockStructDecl; } llvm::Value *LoadBlockStruct();