summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
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
commitd1148a7f72bca7fb58fe8bfa5e4a58ed3ee99ce6 (patch)
treeb790504d28b749136e1af4756742020e61856a40 /clang/lib/CodeGen
parentd361c345c62f1739b1daf6cae8977f265a235ebe (diff)
downloadbcm5719-llvm-d1148a7f72bca7fb58fe8bfa5e4a58ed3ee99ce6.tar.gz
bcm5719-llvm-d1148a7f72bca7fb58fe8bfa5e4a58ed3ee99ce6.zip
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. llvm-svn: 69728
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGObjCMac.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp
index ed71b09942b..de29427c0e9 100644
--- a/clang/lib/CodeGen/CGObjCMac.cpp
+++ b/clang/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(),
OpenPOWER on IntegriCloud