Allocate space in a block record for implicit references to the Objective C
'self' variable arising from uses of the 'super' keyword. Also reorganize
some code so that BlockInfo (now CGBlockInfo) can be opaque outside of
CGBlocks.cpp.
Fixes rdar://problem/8010633.
llvm-svn: 104312
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 048bd09..bac05ba 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -67,6 +67,7 @@
class CGDebugInfo;
class CGFunctionInfo;
class CGRecordLayout;
+ class CGBlockInfo;
/// CodeGenFunction - This class organizes the per-function state that is used
/// while generating LLVM code.
@@ -501,19 +502,18 @@
std::vector<HelperInfo> *);
llvm::Function *GenerateBlockFunction(const BlockExpr *BExpr,
- const BlockInfo& Info,
+ CGBlockInfo &Info,
const Decl *OuterFuncDecl,
- llvm::DenseMap<const Decl*, llvm::Value*> ldm,
- CharUnits &Size, CharUnits &Align,
- llvm::SmallVectorImpl<const Expr*> &subBlockDeclRefDecls,
- bool &subBlockHasCopyDispose);
+ llvm::DenseMap<const Decl*, llvm::Value*> ldm);
- void BlockForwardSelf();
llvm::Value *LoadBlockStruct();
void AllocateBlockCXXThisPointer(const CXXThisExpr *E);
void AllocateBlockDecl(const BlockDeclRefExpr *E);
- llvm::Value *GetAddrOfBlockDecl(const BlockDeclRefExpr *E);
+ llvm::Value *GetAddrOfBlockDecl(const BlockDeclRefExpr *E) {
+ return GetAddrOfBlockDecl(E->getDecl(), E->isByRef());
+ }
+ llvm::Value *GetAddrOfBlockDecl(const ValueDecl *D, bool ByRef);
const llvm::Type *BuildByRefType(const ValueDecl *D);
void GenerateCode(GlobalDecl GD, llvm::Function *Fn);