Framework for codegen for copy/dispose helpers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66231 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGBlocks.h b/lib/CodeGen/CGBlocks.h
index 24b0cc9..84ad190 100644
--- a/lib/CodeGen/CGBlocks.h
+++ b/lib/CodeGen/CGBlocks.h
@@ -110,6 +110,7 @@
 
 class BlockFunction : public BlockBase {
   CodeGenModule &CGM;
+  CodeGenFunction &CGF;
   ASTContext &getContext() const;
 
 public:
@@ -148,16 +149,19 @@
 
   CGBuilderTy &Builder;
 
-  BlockFunction(CodeGenModule &cgm, CGBuilderTy &B)
-    : CGM(cgm), Builder(B) {
+  BlockFunction(CodeGenModule &cgm, CodeGenFunction &cgf, CGBuilderTy &B)
+    : CGM(cgm), CGF(cgf), Builder(B) {
     PtrToInt8Ty = llvm::PointerType::getUnqual(llvm::Type::Int8Ty);
   }
 
   ImplicitParamDecl *BlockStructDecl;
   ImplicitParamDecl *getBlockStructDecl() { return BlockStructDecl; }
 
-  llvm::Value *BuildCopyHelper(int flag);
-  llvm::Value *BuildDestroyHelper(int flag);
+  llvm::Constant *GenerateCopyHelperFunction();
+  llvm::Constant *GenerateDestroyHelperFunction();
+
+  llvm::Constant *BuildCopyHelper(int flag);
+  llvm::Constant *BuildDestroyHelper(int flag);
 
   llvm::Value *getBlockObjectDispose();
   void BuildBlockRelease(const VarDecl &D, llvm::Value *DeclPtr);