]> granicus.if.org Git - clang/commitdiff
Objective-C. Remove an assertion which asserts
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 24 Feb 2014 19:10:37 +0000 (19:10 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 24 Feb 2014 19:10:37 +0000 (19:10 +0000)
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
test/CodeGenObjC/block-var-layout.m

index 7b7c1ef7466311dc169e63a241b1d831115be32e..99bd35f0fb751c055a49099f2841e109d187e9d8 100644 (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;
index 0ad44daa0bdbabac78903b6ff3caa219ac033745..171df7b27489354c83c3ae74e57b4c45283f0705 100644 (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; };
+}