diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-08-04 16:57:49 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-08-04 16:57:49 +0000 |
commit | c05349e53a8d8910f97041a7ee18d14c09e6eea3 (patch) | |
tree | 0e1d7d1157697a2cca05fa50951391a479c52625 /clang/lib/CodeGen/CodeGenFunction.h | |
parent | a3ed071166536b6f0d2b8290a514d5cfdbb15d61 (diff) | |
download | bcm5719-llvm-c05349e53a8d8910f97041a7ee18d14c09e6eea3.tar.gz bcm5719-llvm-c05349e53a8d8910f97041a7ee18d14c09e6eea3.zip |
Some early work for providing block layout info.
for objective-c/c++ blocks (NeXt runtime).
llvm-svn: 110213
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 78745709177..b9abe140521 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -759,8 +759,7 @@ public: llvm::Value *BuildBlockLiteralTmp(const BlockExpr *); llvm::Constant *BuildDescriptorBlockDecl(const BlockExpr *, - bool BlockHasCopyDispose, - CharUnits Size, + const CGBlockInfo &Info, const llvm::StructType *, std::vector<HelperInfo> *); @@ -1677,7 +1676,36 @@ private: void EmitDeclMetadata(); }; - +/// CGBlockInfo - Information to generate a block literal. +class CGBlockInfo { +public: + /// Name - The name of the block, kindof. + const char *Name; + + /// DeclRefs - Variables from parent scopes that have been + /// imported into this block. + llvm::SmallVector<const BlockDeclRefExpr *, 8> DeclRefs; + + /// InnerBlocks - This block and the blocks it encloses. + llvm::SmallPtrSet<const DeclContext *, 4> InnerBlocks; + + /// CXXThisRef - Non-null if 'this' was required somewhere, in + /// which case this is that expression. + const CXXThisExpr *CXXThisRef; + + /// NeedsObjCSelf - True if something in this block has an implicit + /// reference to 'self'. + bool NeedsObjCSelf; + + /// These are initialized by GenerateBlockFunction. + bool BlockHasCopyDispose; + CharUnits BlockSize; + CharUnits BlockAlign; + llvm::SmallVector<const Expr*, 8> BlockLayout; + + CGBlockInfo(const char *Name); +}; + } // end namespace CodeGen } // end namespace clang |