aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGObjCMac.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-04-21 21:41:56 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-04-21 21:41:56 +0000
commit24c8991f4dd0ab86678b5ab11f05586687b55be9 (patch)
tree50defd3e554fad9cdedf93ac775308ffad4384a4 /lib/CodeGen/CGObjCMac.cpp
parent5bd0939989e31113dcded537176311a822682422 (diff)
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
Diffstat (limited to 'lib/CodeGen/CGObjCMac.cpp')
-rw-r--r--lib/CodeGen/CGObjCMac.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index ed71b09942..de29427c0e 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -2564,11 +2564,7 @@ llvm::Constant *CGObjCCommonMac::GetClassName(IdentifierInfo *Ident) {
/// 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 @@ static int countInheritedIvars(const ObjCInterfaceDecl *OI,
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(),