Add support for block imported struct variable layout info.
(objc gc and blocks in NeXt runtime).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110377 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index b8ed516..b3921a4 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -1727,10 +1727,18 @@
QualType Ty = VD->getType();
assert(!Ty->isArrayType() &&
"Array block variable should have been caught");
+ if (Ty->isRecordType() && !BDRE->isByRef()) {
+ bool HasUnion = false;
+ BuildAggrIvarRecordLayout(Ty->getAs<RecordType>(),
+ FieldOffset,
+ true,
+ HasUnion);
+ continue;
+ }
// FIXME. Handle none __block Aggregate variables
#if 0
- if ((Ty->isRecordType() || Ty->isUnionType()) && !BDRE->isByRef())
- assert(false && "Aggregate block variable layout NYI");
+ if (Ty->isUnionType() && !BDRE->isByRef())
+ assert(false && "union block variable layout NYI");
#endif
Qualifiers::GC GCAttr = GetGCAttrTypeForType(CGM.getContext(), Ty);
unsigned FieldSize = CGM.getContext().getTypeSize(Ty);