Move some of the CodeGenFunction blocks code up and out. No
functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66048 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp
index d877b17..bd30c55 100644
--- a/lib/CodeGen/CGBlocks.cpp
+++ b/lib/CodeGen/CGBlocks.cpp
@@ -664,7 +664,7 @@
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 @@
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/lib/CodeGen/CGBlocks.h b/lib/CodeGen/CGBlocks.h
index f588314..6c3ca74 100644
--- a/lib/CodeGen/CGBlocks.h
+++ b/lib/CodeGen/CGBlocks.h
@@ -117,6 +117,14 @@
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/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index d6e3394..0e9bf1a 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/lib/CodeGen/CodeGenFunction.cpp
@@ -24,8 +24,8 @@
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/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h
index caf50d3..6455f11 100644
--- a/lib/CodeGen/CodeGenFunction.h
+++ b/lib/CodeGen/CodeGenFunction.h
@@ -265,9 +265,6 @@
// Block Bits
//===--------------------------------------------------------------------===//
- llvm::Value *BuildCopyHelper(int flag);
- llvm::Value *BuildDestroyHelper(int flag);
-
llvm::Value *BuildBlockLiteralTmp(const BlockExpr *);
llvm::Constant *BuildDescriptorBlockDecl(uint64_t Size);