diff options
author | Mike Stump <mrs@apple.com> | 2009-03-07 06:04:31 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-03-07 06:04:31 +0000 |
commit | f4bc312fc701100af8d3b5af73366715169f5585 (patch) | |
tree | 6596ee2eeaed6626dd61e2792e90e5e8e6ef6540 /lib/CodeGen/CGBlocks.cpp | |
parent | 8339b35ca05dd040a9a0ecfc92e7b49d80c5a96b (diff) |
Remove some FIXMEs for block literals that should be close to working.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66322 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGBlocks.cpp')
-rw-r--r-- | lib/CodeGen/CGBlocks.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp index 344ac60d98..4e4698273f 100644 --- a/lib/CodeGen/CGBlocks.cpp +++ b/lib/CodeGen/CGBlocks.cpp @@ -254,8 +254,8 @@ llvm::Value *CodeGenFunction::BuildBlockLiteralTmp(const BlockExpr *BE) { if (BDRE->isByRef()) { // FIXME: For only local, or all byrefs? NoteForHelper[helpersize].flag = BLOCK_FIELD_IS_BYREF | - (0?BLOCK_FIELD_IS_WEAK : 0); - // FIXME: Add weak support + // FIXME: Someone double check this. + (VD->getType().isObjCGCWeak() ? BLOCK_FIELD_IS_WEAK : 0); const llvm::Type *Ty = Types[i+5]; llvm::Value *Loc = LocalDeclMap[VD]; Loc = Builder.CreateStructGEP(Loc, 1, "forwarding"); @@ -484,7 +484,7 @@ llvm::Value *CodeGenFunction::GetAddrOfBlockDecl(const BlockDeclRefExpr *E) { ErrorUnsupported(E, "__block variable in block literal"); else if (!Enable__block && E->getType()->isBlockPointerType()) ErrorUnsupported(E, "block pointer in block literal"); - else if (E->getDecl()->getAttr<ObjCNSObjectAttr>() || + else if (!Enable__block && E->getDecl()->getAttr<ObjCNSObjectAttr>() || getContext().isObjCNSObjectType(E->getType())) ErrorUnsupported(E, "__attribute__((NSObject)) variable in block " "literal"); @@ -946,11 +946,6 @@ BlockFunction::GeneratebyrefDestroyHelperFunction(const llvm::Type *T, V = Builder.CreateStructGEP(V, 6, "x"); V = Builder.CreateBitCast(V, PtrToInt8Ty); - // FIXME: Move to other one. - // int flag = BLOCK_FIELD_IS_BYREF; - // FIXME: Add weak support - if (0) - flag |= BLOCK_FIELD_IS_WEAK; flag |= BLOCK_BYREF_CALLER; BuildBlockRelease(V, flag); CGF.FinishFunction(); |