Make sure to mark the interface as completed when we see an
@implementation that closes a @class delcaration.
 - I don't know how to make a test case for this, but this strengthens
   the invariants that hold internally. The functionality change here
   is the edit to SemaDeclObjC.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69728 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index ed71b09..de29427 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -2564,11 +2564,7 @@
 /// interface declaration.
 const llvm::StructLayout *CGObjCCommonMac::GetInterfaceDeclStructLayout(
                                         const ObjCInterfaceDecl *OID) const {
-  // FIXME: When does this happen? It seems pretty bad to do this...
-  if (OID->isForwardDecl())
-    return CGM.getTargetData().getStructLayout(llvm::StructType::get(NULL, 
-                                                                     NULL));
-
+  assert(!OID->isForwardDecl() && "Invalid interface decl!");
   QualType T = 
     CGM.getContext().getObjCInterfaceType(const_cast<ObjCInterfaceDecl*>(OID));
   const llvm::StructType *InterfaceTy = 
@@ -4231,6 +4227,7 @@
 void CGObjCNonFragileABIMac::GetClassSizeInfo(const ObjCInterfaceDecl *OID,
                                               uint32_t &InstanceStart,
                                               uint32_t &InstanceSize) {
+  assert(!OID->isForwardDecl() && "Invalid interface decl!");
   const llvm::StructLayout *Layout = GetInterfaceDeclStructLayout(OID);
     
   int countSuperClassIvars = countInheritedIvars(OID->getSuperClass(),