diff options
Diffstat (limited to 'clang/lib/CodeGen/CGObjCGNU.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGObjCGNU.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGObjCGNU.cpp b/clang/lib/CodeGen/CGObjCGNU.cpp index cd94290000d..f7936fda554 100644 --- a/clang/lib/CodeGen/CGObjCGNU.cpp +++ b/clang/lib/CodeGen/CGObjCGNU.cpp @@ -739,8 +739,12 @@ void CGObjCGNU::GenerateClass(const ObjCImplementationDecl *OID) { // Get the size of instances. For runtimes that support late-bound instances // this should probably be something different (size just of instance // varaibles in this class, not superclasses?). - const llvm::Type *ObjTy = - CGM.getTypes().ConvertType(Context.getObjCInterfaceType(ClassDecl)); + const llvm::Type *ObjTy; + + if (ClassDecl->isForwardDecl()) + ObjTy = llvm::StructType::get(NULL, NULL); + else + ObjTy = CGM.getTypes().ConvertType(Context.getObjCInterfaceType(ClassDecl)); int instanceSize = CGM.getTargetData().getTypePaddedSize(ObjTy); // Collect information about instance variables. |