]> granicus.if.org Git - clang/commitdiff
Move some of the CodeGenFunction blocks code up and out. No
authorMike Stump <mrs@apple.com>
Wed, 4 Mar 2009 18:57:26 +0000 (18:57 +0000)
committerMike Stump <mrs@apple.com>
Wed, 4 Mar 2009 18:57:26 +0000 (18:57 +0000)
functionality change.

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

lib/CodeGen/CGBlocks.cpp
lib/CodeGen/CGBlocks.h
lib/CodeGen/CodeGenFunction.cpp
lib/CodeGen/CodeGenFunction.h

index d877b171b9ebd63b95ea892ea5d01e719dc133a0..bd30c558004d2700f61dcba8af1a6c570a5cc969 100644 (file)
@@ -664,7 +664,7 @@ uint64_t CodeGenFunction::getBlockOffset(const BlockDeclRefExpr *BDRE) {
   return BlockOffset-Size;
 }
 
-llvm::Value *CodeGenFunction::BuildCopyHelper(int flag) {
+llvm::Value *BlockFunction::BuildCopyHelper(int flag) {
   const llvm::PointerType *PtrToInt8Ty
     = llvm::PointerType::getUnqual(llvm::Type::Int8Ty);
   // FIXME: implement
@@ -674,7 +674,7 @@ llvm::Value *CodeGenFunction::BuildCopyHelper(int flag) {
   return V;
 }
 
-llvm::Value *CodeGenFunction::BuildDestroyHelper(int flag) {
+llvm::Value *BlockFunction::BuildDestroyHelper(int flag) {
   const llvm::PointerType *PtrToInt8Ty
     = llvm::PointerType::getUnqual(llvm::Type::Int8Ty);
   // FIXME: implement
index f58831423ef11552124369b7b4f140bf77e98227..6c3ca748b9d166cfab5868059a93f6ff225a37a7 100644 (file)
@@ -117,6 +117,14 @@ public:
     BLOCK_BYREF_CALLER      = 128  /* called from __block (byref) copy/dispose
                                       support routines */
   };
+
+  CGBuilderTy &Builder;
+
+  BlockFunction(CGBuilderTy &B) : Builder(B) { }
+
+  llvm::Value *BuildCopyHelper(int flag);
+  llvm::Value *BuildDestroyHelper(int flag);
+
 };
 
 }  // end namespace CodeGen
index d6e3394b8d84a3002bf17501ab1e4ce2a00991fb..0e9bf1a5bb9a6ad2786c9151e4f756e3046d3d88 100644 (file)
@@ -24,8 +24,8 @@ using namespace clang;
 using namespace CodeGen;
 
 CodeGenFunction::CodeGenFunction(CodeGenModule &cgm) 
-  : CGM(cgm), Target(CGM.getContext().Target), DebugInfo(0), SwitchInsn(0), 
-    CaseRangeBlock(0), InvokeDest(0) {
+  : BlockFunction(Builder), CGM(cgm), Target(CGM.getContext().Target),
+    DebugInfo(0), SwitchInsn(0), CaseRangeBlock(0), InvokeDest(0) {
   LLVMIntTy = ConvertType(getContext().IntTy);
   LLVMPointerWidth = Target.getPointerWidth(0);
 
index caf50d35b21900890e2119ef89711fa42c7da824..6455f119c08708a129a50b606f51ea39247520fe 100644 (file)
@@ -265,9 +265,6 @@ public:
   //                                  Block Bits
   //===--------------------------------------------------------------------===//
 
-  llvm::Value *BuildCopyHelper(int flag);
-  llvm::Value *BuildDestroyHelper(int flag);
-
   llvm::Value *BuildBlockLiteralTmp(const BlockExpr *);
   llvm::Constant *BuildDescriptorBlockDecl(uint64_t Size);