Objective-C. Remove an assertion which asserts

on correctly handled block layout IRGen. 
// rdar://16111839

llvm-svn: 202063
This commit is contained in:
Fariborz Jahanian 2014-02-24 19:10:37 +00:00
parent 3c5d3339be
commit a7352db7b4
2 changed files with 8 additions and 6 deletions

View File

@ -2123,9 +2123,6 @@ void CGObjCCommonMac::BuildRCRecordLayout(const llvm::StructLayout *RecLayout,
ElCount *= CArray->getSize().getZExtValue();
FQT = CArray->getElementType();
}
assert(!FQT->isUnionType() &&
"layout for array of unions not supported");
if (FQT->isRecordType() && ElCount) {
int OldIndex = RunSkipBlockVars.size() - 1;
const RecordType *RT = FQT->getAs<RecordType>();
@ -4594,9 +4591,6 @@ void CGObjCCommonMac::BuildAggrIvarLayout(const ObjCImplementationDecl *OI,
ElCount *= CArray->getSize().getZExtValue();
FQT = CArray->getElementType();
}
assert(!FQT->isUnionType() &&
"layout for array of unions not supported");
if (FQT->isRecordType() && ElCount) {
int OldIndex = IvarsInfo.size() - 1;
int OldSkIndex = SkipIvars.size() -1;

View File

@ -164,3 +164,11 @@ void test_empty_block() {
};
wrapperBlock();
}
// rdar://16111839
typedef union { char ch[8]; } SS;
typedef struct { SS s[4]; } CS;
void test_union_in_layout() {
CS cs;
^{ cs; };
}