summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGObjCMac.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-08-05 21:00:25 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-08-05 21:00:25 +0000
commit903aba39eea68679058a49ff07364aed12592a1d (patch)
tree65dae5e7c81308dec110194e36096ec10272f70c /clang/lib/CodeGen/CGObjCMac.cpp
parentd3c94af1422dd3ac1664af1e1ebe75d3c0de10ed (diff)
downloadbcm5719-llvm-903aba39eea68679058a49ff07364aed12592a1d.tar.gz
bcm5719-llvm-903aba39eea68679058a49ff07364aed12592a1d.zip
Add support for block imported struct variable layout info.
(objc gc and blocks in NeXt runtime). llvm-svn: 110377
Diffstat (limited to 'clang/lib/CodeGen/CGObjCMac.cpp')
-rw-r--r--clang/lib/CodeGen/CGObjCMac.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp
index b8ed516ad7d..b3921a48165 100644
--- a/clang/lib/CodeGen/CGObjCMac.cpp
+++ b/clang/lib/CodeGen/CGObjCMac.cpp
@@ -1727,10 +1727,18 @@ llvm::Constant *CGObjCCommonMac::GCBlockLayout(CodeGen::CodeGenFunction &CGF,
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);
OpenPOWER on IntegriCloud