The instance size of a metaclass should be the size of a class. This is not, in fact, 0, even for very small classes. (GNU runtime)

llvm-svn: 126161
This commit is contained in:
David Chisnall 2011-02-21 23:47:40 +00:00
parent e69108a78f
commit 055f064756
1 changed files with 6 additions and 1 deletions

View File

@ -949,7 +949,12 @@ llvm::Constant *CGObjCGNU::GenerateClassStructure(
Elements.push_back(MakeConstantString(Name, ".class_name"));
Elements.push_back(Zero);
Elements.push_back(llvm::ConstantInt::get(LongTy, info));
Elements.push_back(InstanceSize);
if (isMeta) {
llvm::TargetData td(&TheModule);
Elements.push_back(llvm::ConstantInt::get(LongTy,
td.getTypeSizeInBits(ClassTy)/8));
} else
Elements.push_back(InstanceSize);
Elements.push_back(IVars);
Elements.push_back(Methods);
Elements.push_back(NULLPtr);