During interface layout, don't forget super class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52033 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index 4a1fb39..8733a6b 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -405,7 +405,15 @@
 
   // Allocate and assign into ASTRecordLayouts here.  The "Entry" reference can
   // be invalidated (dangle) if the ASTRecordLayouts hashtable is inserted into.
-  ASTRecordLayout *NewEntry = new ASTRecordLayout();
+  unsigned Alignment = 8;
+  uint64_t Size = 0;
+  if (ObjCInterfaceDecl *SD = D->getSuperClass()) {
+    const ASTRecordLayout &SL = getASTObjCInterfaceLayout(SD);
+    Alignment = SL.getAlignment();
+    Size = SL.getSize();
+  } 
+  ASTRecordLayout *NewEntry = new ASTRecordLayout(Size, Alignment);
+
   Entry = NewEntry;
 
   NewEntry->InitializeLayout(D->ivar_size());