From e2e8ed2c17862141377f042280add569a3851650 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Mon, 24 Feb 2014 19:10:37 +0000 Subject: [PATCH] Objective-C. Remove an assertion which asserts on correctly handled block layout IRGen. // rdar://16111839 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202063 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGObjCMac.cpp | 6 ------ test/CodeGenObjC/block-var-layout.m | 8 ++++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index 7b7c1ef746..99bd35f0fb 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -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(); @@ -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; diff --git a/test/CodeGenObjC/block-var-layout.m b/test/CodeGenObjC/block-var-layout.m index 0ad44daa0b..171df7b274 100644 --- a/test/CodeGenObjC/block-var-layout.m +++ b/test/CodeGenObjC/block-var-layout.m @@ -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; }; +} -- 2.40.0