Move more of the blocks code up and out.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66046 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGBlocks.h b/lib/CodeGen/CGBlocks.h
index a55c578..f588314 100644
--- a/lib/CodeGen/CGBlocks.h
+++ b/lib/CodeGen/CGBlocks.h
@@ -43,6 +43,7 @@
namespace clang {
namespace CodeGen {
+class CodeGenModule;
class BlockBase {
public:
@@ -59,11 +60,14 @@
class BlockModule : public BlockBase {
ASTContext &Context;
llvm::Module &TheModule;
+ const llvm::TargetData &TheTargetData;
CodeGenTypes &Types;
+ CodeGenModule &CGM;
ASTContext &getContext() const { return Context; }
llvm::Module &getModule() const { return TheModule; }
CodeGenTypes &getTypes() { return Types; }
+ const llvm::TargetData &getTargetData() const { return TheTargetData; }
public:
llvm::Constant *getNSConcreteGlobalBlock();
llvm::Constant *getNSConcreteStackBlock();
@@ -73,6 +77,8 @@
const llvm::Type *getGenericBlockLiteralType();
const llvm::Type *getGenericExtendedBlockLiteralType();
+ llvm::Constant *GetAddrOfGlobalBlock(const BlockExpr *BE, const char *);
+
/// NSConcreteGlobalBlock - Cached reference to the class pointer for global
/// blocks.
llvm::Constant *NSConcreteGlobalBlock;
@@ -88,9 +94,11 @@
int GlobalUniqueCount;
} Block;
- BlockModule(ASTContext &C, llvm::Module &M, CodeGenTypes &T)
- : Context(C), TheModule(M), Types(T), NSConcreteGlobalBlock(0),
- NSConcreteStackBlock(0), BlockDescriptorType(0),
+ BlockModule(ASTContext &C, llvm::Module &M, const llvm::TargetData &TD,
+ CodeGenTypes &T, CodeGenModule &CodeGen)
+ : Context(C), TheModule(M), TheTargetData(TD), Types(T),
+ CGM(CodeGen),
+ NSConcreteGlobalBlock(0), NSConcreteStackBlock(0), BlockDescriptorType(0),
GenericBlockLiteralType(0) {
Block.GlobalUniqueCount = 0;
}