diff options
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGBlocks.cpp | 4 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGBlocks.h | 8 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 4 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 3 |
4 files changed, 12 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp index d877b171b9e..bd30c558004 100644 --- a/clang/lib/CodeGen/CGBlocks.cpp +++ b/clang/lib/CodeGen/CGBlocks.cpp @@ -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 diff --git a/clang/lib/CodeGen/CGBlocks.h b/clang/lib/CodeGen/CGBlocks.h index f58831423ef..6c3ca748b9d 100644 --- a/clang/lib/CodeGen/CGBlocks.h +++ b/clang/lib/CodeGen/CGBlocks.h @@ -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 diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index d6e3394b8d8..0e9bf1a5bb9 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -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); diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index caf50d35b21..6455f119c08 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -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); |