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
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp
index 1322ca2..abb1337 100644
--- a/lib/CodeGen/CGDecl.cpp
+++ b/lib/CodeGen/CGDecl.cpp
@@ -340,6 +340,7 @@
// The block literal will need a copy/destroy helper.
BlockHasCopyDispose = true;
+ needsDispose = true;
if (Ty->isBlockPointerType()) {
flag |= BLOCK_FIELD_IS_BLOCK;
@@ -348,7 +349,10 @@
flag |= BLOCK_FIELD_IS_OBJECT;
flags |= BLOCK_HAS_COPY_DISPOSE;
}
- // FIXME: Need to set BLOCK_FIELD_IS_WEAK as appropriate.
+
+ // FIXME: Someone double check this.
+ if (Ty.isObjCGCWeak())
+ flag |= BLOCK_FIELD_IS_WEAK;
int isa = 0;
if (flag&BLOCK_FIELD_IS_WEAK)
@@ -380,7 +384,6 @@
Builder.CreateStore(BuildbyrefDestroyHelper(DeclPtr->getType(), flag),
destroy_helper);
}
- needsDispose = true;
}
// Handle the cleanup attribute